Bug 410682 - Plasma Add-On Installer deletes plasmoids/ folder entirely when uninstalling a widget if the widget's folder is not present
Summary: Plasma Add-On Installer deletes plasmoids/ folder entirely when uninstalling ...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kpackage
Classification: Frameworks and Libraries
Component: default (other bugs)
Version First Reported In: 5.60.0
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-07 04:48 UTC by Konstantin L
Modified: 2020-08-10 12:10 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.74
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin L 2019-08-07 04:48:14 UTC
SUMMARY

Plasma Add-On Installer deletes ~/.local/share/plasma/plasmoids/ folder entirely when uninstalling a widget if the widget's folder isn't present (i.e. it was renamed/moved/deleted manually by the user).

STEPS TO REPRODUCE

1. Open Plasma Add-On Installer (Add widgets...>Get New Widgets...>Download New Plasma Widgets). 
2. Install any widget.
3. Go to ~/.local/share/plasma/plasmoids/ folder and rename/move/delete the folder of the widget that was just installed.
3a. Create a file inside the plasmoids/ folder to see that it gets deleted later.
4. Click Uninstall in Plasma Add-On Installer.
5. Plasma Add-On Installer removes plasmoids/ folder entirely, even if it contains other widgets and any files.

OBSERVED RESULT

Plasma Add-On Installer removes plasmoids/ folder entirely, even if it contains other widgets and any files.

EXPECTED RESULT

Plasma Add-On Installer marks the widget as uninstalled and does nothing.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Manjaro Linux 18.0.4
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.60.0
Comment 1 Dan Leinir Turthra Jensen 2019-08-07 08:21:33 UTC
Plasmoids downloaded through KNewStuff are installed and uninstalled using kpackagetool5, which handles all the creation and removal of folders and whatnot, so i'll redirect this to a more appropriate product :)
Comment 2 Alexander Lohnau 2020-08-05 18:51:23 UTC
Confirmed, this is still an issue.
Comment 3 Bug Janitor Service 2020-08-09 08:40:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kpackage/-/merge_requests/2
Comment 4 Alexander Lohnau 2020-08-10 12:10:10 UTC
Git commit b77735be60c07d4a24a2c3c5893ae6bd1bf1303a by Alexander Lohnau.
Committed on 09/08/2020 at 08:34.
Pushed by alex into branch 'master'.

Do not delete package root if package was deleted
FIXED-IN: 5.74

M  +9    -1    src/kpackage/packagestructure.cpp
M  +2    -2    src/kpackage/private/packagejobthread.cpp

https://invent.kde.org/frameworks/kpackage/commit/b77735be60c07d4a24a2c3c5893ae6bd1bf1303a