WIP Dolphin Service: Show error message when uninstalling packages
AbandonedPublic

Authored by alex on Apr 22 2020, 5:39 AM.

Details

Reviewers
ngraham
nicolasfella
elvisangelaccio
Group Reviewers
Dolphin
Summary

The binary packages(deb and rpm) can't be uninstalled like the other packages.
Before the installer would give an error message that the deinstallation failed,
now the error message contains information on what to do.

WIP: If you think that an option to run a deinstall command should be executed instead, I will implement it.

Test Plan

servicemenuinstaller uninstall somepackage.deb

Diff Detail

Repository
R318 Dolphin
Branch
deb_rpm_uninstall_msg (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25659
Build 25677: arc lint + arc unit
alex created this revision.Apr 22 2020, 5:39 AM
Restricted Application added a project: Dolphin. · View Herald TranscriptApr 22 2020, 5:39 AM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
alex requested review of this revision.Apr 22 2020, 5:39 AM
broulik added inline comments.
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp
276

Why not show a KMessageBox?
Alternatively, offer the user to do that?
"This thing needs to be installed [Open in whatever app for the mime type, e.g. Discover] [Cancel]"

alex added inline comments.Apr 22 2020, 6:49 AM
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp
276

So far the messages have been show with kdialog, thats why I didn't wanted to mix that too much up in this patch.

But there is an issue when opening the files for uninstalling by the mime type:
If you install a local deb file in discover you get the uninstall button afterwards.
But if you close discover and launch the local deb file again you only get the install option.

WIP: If you think that an option to run a deinstall command should be executed instead, I will implement it.

Yeah, telling the user how to fix it is a nice improvement for sure, but even better would be uninstalling automatically. If you have the package namer, you can use packagekit to uninstall it so you don't need to write code specific for apt, zypper, dnf, etc.

There's an example of how to do this in the kdenetwork-filesharing repo, where we use PackageKit to install samba packages at the user's request.

This is reminding me that I need to finish up my patch to make Konsole installable via PackageKit if you open the terminal panel when it's not installed.

alex added a comment.Apr 22 2020, 5:17 PM

This sounds interesting, is it also possible to install local packages?
In that case the install process could be improved, because we actually know if the user installed the package or aborted.

I am also not sure on which branch this should go. It would make sense to me to
land this on 20.04.1, but then introducing new dependencies seems like a bad idea^^.

In D29082#654968, @alex wrote:

This sounds interesting, is it also possible to install local packages?
In that case the install process could be improved, because we actually know if the user installed the package or aborted.

Yup, PackageKit can do that.

I am also not sure on which branch this should go. It would make sense to me to
land this on 20.04.1, but then introducing new dependencies seems like a bad idea^^.

Since this patch includes a new string, if landed in its current form, it would have to be the master branch. String changes can only be made on master. Same with dependency changes, obviously. :)

alex added a comment.Apr 22 2020, 5:23 PM

Should I make the PackageKit integration in a new patch where I also refactor the install method?
And in that case should I abandon this patch?

In D29082#654974, @alex wrote:

Should I make the PackageKit integration in a new patch where I also refactor the install method?
And in that case should I abandon this patch?

That would make sense to me. :) Using PackageKit for both would be quite nice.

alex abandoned this revision.Apr 22 2020, 5:25 PM

Ok, see you in the next patch :-)