move SolidUiServer::showActionsDialog to hotplug dataengine
ClosedPublic

Authored by sitter on Jun 12 2019, 10:21 AM.

Details

Summary

it was the only remaining user of that dialog helper.
the connection between the two was fairly meh. the engine would invoke the
kded module over dbus, the module would then process the request, find that
only one desktop entry is specified, resulting in one action being found
and then running that action on behalf of the engine. this is overly
complicated for no additional gain. the engine is the sole user of this
functionality AND it already had knowledge of the service system, so
soliduiserver in this case doesn't actually add anything. it's just a more
involved call chain.

the useful code of soliduiserver is now in the hotplug dataengine directly
and the soliduiserver no longer supports the actions dialog. hotplug is now
the sole authority for hotplugging.

soliduiserver:

  • include cleanup
  • all classes no longer in use have been removed
  • kdelibs4support is no longer a link target
  • new link targets i18n + widgetsaddons (previously pulled in by kdelibs4support)

hotplug:

  • hotplugjob now directly executes service actions using classes imported from soliduiserver
  • no longer links qtdbus
  • new translation domain plasma_engine_hotplug (for i18n call in imported service classes)
  • new link against ki18n for that reason
Test Plan

running an action works same as before, internally it no longer relies on dbus/kded

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jun 12 2019, 10:21 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 12 2019, 10:21 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sitter requested review of this revision.Jun 12 2019, 10:21 AM

I am unsure about the error handling in HotplugJob::start I suppose it should never happen that an action cannot be resolved, so maybe an assertion to that extent is sufficient?

I suppose it should never happen that an action cannot be resolved, so maybe an assertion to that extent is sufficient?

Given device notifier only invokes it on actions it queried for earlier, it should not fail. However, dataengines are kinda "public API", so a 3rd party applet could trip an error here.

How do I correctly forward a visible error to the caller though? This ServiceJob tech is fairly beyond me. Showing a KNotification on error may be a solution, but surely there must be a better way.

sitter updated this revision to Diff 59651.Jun 12 2019, 1:30 PM

handle error conditions

since we use QSP::locate we can at most have 0-1 service.
in the event that we have 0 we'll set the kjob into error state and return false as result.

broulik accepted this revision.Jun 28 2019, 1:34 PM
This revision is now accepted and ready to land.Jun 28 2019, 1:34 PM
This revision was automatically updated to reflect the committed changes.