Emit signals when a package is installed/uninstalled
ClosedPublic

Authored by davidedmundson on Aug 30 2018, 10:56 PM.

Details

Summary

This is needed for situations such as Plasma reloading the wallpaper
plugins when one is installed.

We want something with more granularity than arbitrarily reloading when
the KNS dialog closes, and less horrible than file watchers.

The service type (for example Plasma/Wallpaper) makes up part of the
path for optimal filtering.

Test Plan

Ran dbus-monitor and kpacktool5 -r / -i

Diff Detail

Repository
R290 KPackage
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 30 2018, 10:56 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Aug 30 2018, 10:56 PM
Zren added a subscriber: Zren.Aug 30 2018, 11:34 PM

+1

src/kpackage/private/packagejob.cpp
93

Can packageType contain characters not allowed in DBus?

src/kpackage/private/packagejob.cpp
93

Technically, yes, it's a string in the metadata of the package type so could.

By convention format X-KDE-ServiceTypes is always in the format Foo/Blah and generally we control the package structures.

broulik added inline comments.Sep 10 2018, 9:56 AM
src/kpackage/private/packagejob.cpp
90

Can this be invalid or does install already check for validity?

src/kpackage/private/packagejob.cpp
90

bool PackageJobThread::installPackage(const QString &src, const QString &dest, OperationType operation)
{

...

if (!meta.isValid()) {
      qCDebug(KPACKAGE_LOG) << "No metadata file in package" << src << path;
      d->errorMessage = i18n("No metadata file in package: %1", src);
      d->errorCode = Package::JobError::MetadataFileMissingError;
      return false;
  }
broulik accepted this revision.Sep 10 2018, 11:45 AM
This revision is now accepted and ready to land.Sep 10 2018, 11:45 AM
This revision was automatically updated to reflect the committed changes.