Bug 430320 - Scrolling to year -1 in the calendar applet crashes Plasma
Summary: Scrolling to year -1 in the calendar applet crashes Plasma
Status: RESOLVED FIXED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: components (show other bugs)
Version: 5.77.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-12 21:04 UTC by Vojtěch Bartoň
Modified: 2020-12-19 14:55 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.78


Attachments
calendar applet (75.22 KB, image/png)
2020-12-17 13:05 UTC, Vojtěch Bartoň
Details

Note You need to log in before you can comment on or make changes to this bug.
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