Bug 420312 - Dolphin services not being remove after uninstall
Summary: Dolphin services not being remove after uninstall
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 19.12.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-19 19:09 UTC by raul.aventuramenuda
Modified: 2020-09-05 17:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.70


Attachments
options of an uninstalled services are still there (61.79 KB, image/png)
2020-04-19 19:09 UTC, raul.aventuramenuda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description raul.aventuramenuda 2020-04-19 19:09:02 UTC
Created attachment 127695 [details]
options of an uninstalled services are still there

SUMMARY
When I uninstall a service on Dolphin It keeps showing it's services options under the "Services" tab

STEPS TO REPRODUCE
1. Install a Service
2. Uninstall it
3. Watch the Service tab, their options are still there

OBSERVED RESULT
The options from an uninstalled service (like "mount ISO") are not being remove from the service list.

EXPECTED RESULT
"select which services should be shown in the context menu" should only show the dafault options and the installed ones. Not the options from an uninstalled service.
Comment 1 Alexander Lohnau 2020-04-22 12:14:35 UTC
Hello,

I can reproduce the issue and will do my best to write a patch.
Comment 2 Alexander Lohnau 2020-04-22 16:01:40 UTC
https://phabricator.kde.org/D29101
Comment 4 Alexander Lohnau 2020-05-03 16:10:03 UTC
The uninstallation failing was one issue(fixed now), the entry being marked as installed another:
https://phabricator.kde.org/D29123

But I guess marking it as fixed is fine :-).
Comment 5 Patrick Silva 2020-05-09 13:41:19 UTC
which frameworks version contains this fix?
It's still reproducible on Arch after update to frameworks 5.70.
Comment 6 Alexander Lohnau 2020-05-09 13:51:44 UTC
The (In reply to Patrick Silva from comment #5)
> which frameworks version contains this fix?
5.70
> It's still reproducible on Arch after update to frameworks 5.70.

What you described is most likely caused by the malformed install path from the previous version.

If you install it again and then uninstall it it should be removed.
Comment 7 Patrick Silva 2020-05-09 13:57:20 UTC
(In reply to Alex from comment #6)
> The (In reply to Patrick Silva from comment #5)
> > which frameworks version contains this fix?
> 5.70
> > It's still reproducible on Arch after update to frameworks 5.70.
> 
> What you described is most likely caused by the malformed install path from
> the previous version.
> 
> If you install it again and then uninstall it it should be removed.

I have reproduced even with a newly installed service called Color Folder.
Comment 8 Alexander Lohnau 2020-05-09 14:15:00 UTC
Ah, that is an issue fixed with dolphin https://phabricator.kde.org/D28836.
Comment 9 Patrick Silva 2020-05-09 15:20:39 UTC
(In reply to Alex from comment #8)
> Ah, that is an issue fixed with dolphin https://phabricator.kde.org/D28836.

does 20.04 branch of Dolphin include that fix?
Comment 10 Alexander Lohnau 2020-05-09 15:51:50 UTC
> does 20.04 branch of Dolphin include that fix?

It is not in the initial release of 20.04, but on the 20.04 branch.
So it will be released with 20.04.1.
Comment 11 Christoph Feck 2020-05-09 15:59:58 UTC
Patrick, you can check which branches a phabricator commit landed in by clicking on the "Closed by commit" reference, and read the "Branches" details there.
Comment 12 Patrick Silva 2020-05-09 20:29:13 UTC
Thank you Christoph.

I have built 20.04 branch of Dolphin, uninstalled services are not immediately removed from "Services" section of Dolphin settings when they are uninstalled. The list of services only is updated when I reopen Dolphin settings, exactly as mentioned in bug 405186 comment 7.
Comment 13 Alexander Lohnau 2020-05-11 18:39:17 UTC
Git commit a2ecdd333c492d3e4be5c21301374073784f1b60 by Alexander Lohnau.
Committed on 11/05/2020 at 18:39.
Pushed by alex into branch 'master'.

Do not mark entry as uninstalled if uninstallation script failed

Summary:
As described in the bug report the uninstallation failed, but the
service was marked as removed. Now the service gets only marked as
uninstalled if the script runs without an error. If there is an error
the user gets a popup.

Depends on D29101

Test Plan:
Set the exit code to 1 and try to install a dolphin plugin.
You should get an error message.

Without modifying the exit code you should be able to install services.

The manual deletion can be tested by removing the installed service file. for example:
rm ~/.local/share/kservices5/ServiceMenus/iso_mounter_unmounter.desktop
Then the uninstaller will crash:
"Failed to remove .desktop file ... No such file or directory"
Then you delete the installed file manually:
rm ~/.local/share/servicemenu-download/iso_mounter_unmounter.desktop
And now you can click the uninstall button and it gets removed
from the list of installed services.

Reviewers: #knewstuff, meven, ngraham, leinir

Reviewed By: #knewstuff, ngraham, leinir

Subscribers: leinir, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D29123

M  +1    -3    src/core/engine.cpp
M  +41   -10   src/core/installation.cpp
M  +3    -3    src/core/installation.h

https://commits.kde.org/knewstuff/a2ecdd333c492d3e4be5c21301374073784f1b60
Comment 14 Patrick Silva 2020-06-15 19:52:42 UTC
Unfortunately this bug persists after update to frameworks 5.71.
Uninstalled services are still present in Services section until Dolphin settings is reopened.
I even tested with a new user account installing these services:
dolphin folder color (this one not even appears in "Services" section of Dolphin settings after apparently successful installation)
set as wallpaper
color folder
getMediaInfo (Dolphin crashed when I reopened its settings after install this one - reported as bug 423027)

Operating System: Arch Linux 
KDE Plasma Version: 5.19.0
KDE Frameworks Version: 5.71.0
Qt Version: 5.15.0
Comment 15 Alexander Lohnau 2020-06-16 06:03:12 UTC
> this one not even appears in "Services" section of Dolphin settings after apparently successful installation

Huh can confirm, this seems to be an issue on the service menu loading side of things.

The installer should just put the files in the right location, which works as it should.
Comment 16 Patrick Silva 2020-06-16 09:59:46 UTC
(In reply to Alexander Lohnau from comment #15)
> > this one not even appears in "Services" section of Dolphin settings after apparently successful installation
> 
> Huh can confirm, this seems to be an issue on the service menu loading side
> of things.
> 
> The installer should just put the files in the right location, which works
> as it should.

https://bugs.kde.org/show_bug.cgi?id=405186
Comment 17 Alexander Lohnau 2020-09-03 09:18:10 UTC
Marking this as fixed again, that is a problem with the individual plugins. They will be removed from the list of downloadable entries since they are not maintained anymore.
Comment 18 Alexander Lohnau 2020-09-03 11:09:09 UTC
On related note, I have made a version of the mediainfo plugin which actually works: https://www.pling.com/p/1418250/
Comment 19 Patrick Silva 2020-09-03 11:36:05 UTC
Tested these services on neon unstable:

Set as Wallpaper
KDE Services
KDE 5 Service Menu ReImage
getMediaInfo
Autoversion
Simple send as Attachment with Kmail
Mediainfo Service Menu

Mediainfo Service Menu and Set as Wallpaper are the only ones successfully installed, but Mediainfo Service Menu is not listed in Services section of Dolphin settings. And Set as Wallpaper is still present in Services section after uninstalling until Dolphin settings are reopened.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Comment 20 Alexander Lohnau 2020-09-03 11:42:59 UTC
>And Set as Wallpaper is still present in Services section after uninstalling until Dolphin settings are reopened.

Hmm okay. I will look into it.

For the others we would need to contact the authors to fix the installation.
Comment 21 Elvis Angelaccio 2020-09-05 17:32:53 UTC
Git commit 8e2f0a1d5b88f9ac6e06a0ac7a64d7080198f678 by Elvis Angelaccio, on behalf of Alexander Lohnau.
Committed on 05/09/2020 at 17:32.
Pushed by elvisangelaccio into branch 'master'.

Clear services model after KNS entries changed

We can not know if a service got deleted, so we clear
the model and reload the services. The issue that the entries are
not uninstalled has already been solved, this is just a patch to
fix the state of the UI.

M  +7    -0    src/settings/servicemodel.cpp
M  +1    -0    src/settings/servicemodel.h
M  +7    -1    src/settings/services/servicessettingspage.cpp

https://invent.kde.org/system/dolphin/commit/8e2f0a1d5b88f9ac6e06a0ac7a64d7080198f678