Bug 430320

Summary: Scrolling to year -1 in the calendar applet crashes Plasma
Product: [Frameworks and Libraries] libplasma Reporter: Vojtěch Bartoň <gamingforyou875>
Component: componentsAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: jack.lilhammers, nate, plasma-bugs, zrenfire
Priority: NOR    
Version: 5.77.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In: 5.78
Attachments: calendar applet

Description Vojtěch Bartoň 2020-12-12 21:04:00 UTC
SUMMARY
Plasma crashes when you scroll past the year -50 in the calendar applet.
(IMPORTANT) Have Holidays or Astronomical events enabled.

STEPS TO REPRODUCE
1. Have Holidays/Astronomical events enabled in the applet settings
2. Scroll past -50 in the applet

OBSERVED RESULT
Plasma crash.

EXPECTED RESULT
Scroll past year -50.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro 20.2
(available in About System)
KDE Plasma Version: Plasma 5.20.4
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I think there should be a limit as to how far you can scroll in the applet.
Comment 1 Nate Graham 2020-12-16 22:19:30 UTC
How do you "Scroll past -50 in the applet"? Seems you discovered a feature I'm not aware of lol
Comment 2 Vojtěch Bartoň 2020-12-17 13:05:56 UTC
Created attachment 134145 [details]
calendar applet
Comment 3 Vojtěch Bartoň 2020-12-17 13:13:04 UTC
(In reply to Nate Graham from comment #1)
> How do you "Scroll past -50 in the applet"? Seems you discovered a feature
> I'm not aware of lol

Oh yeah, I forgot to say "year" in the title. If you open the applet and click on the month twice, you will get into a decade view. Then just scroll far back with your mouse wheel.
Comment 4 Nate Graham 2020-12-17 16:55:07 UTC
Can reproduce. It crashes for me as soon as I get to -1.

Negative calendar years don't make sense. Will fix.
Comment 5 Nate Graham 2020-12-17 17:11:18 UTC
Git commit 1cb14c21a9d2e8be066f764a3638ba324362ea67 by Nate Graham.
Committed on 17/12/2020 at 17:10.
Pushed by ngraham into branch 'master'.

Don't allow negative calendar years

The concept is nonsensical and trying to display them crashes the
app displaying the calendar.
FIXED-IN: 5.78

M  +8    -2    src/declarativeimports/calendar/calendar.cpp

https://invent.kde.org/frameworks/plasma-framework/commit/1cb14c21a9d2e8be066f764a3638ba324362ea67
Comment 6 Jacopo Martellini 2020-12-19 14:55:31 UTC
Well, negative years are dates before Christ. While I'm an atheist, those dates still make sense.
Of course I also think that hardly anyone will complain about this change :D

PS: I commented on your commit because I think that there's a little mistake