KDBusService: pass executable name to QStringList arguments in the activateRequested signal
AbandonedPublic

Authored by dfaure on Jul 9 2017, 8:51 AM.

Details

Summary

It was done in one case (CommandLine) and not the other (Activate), making
things very inconsistent. An empty list of arguments makes QCommandLineParser
fail with a warning (or even exit, when using process() instead of parse()),
so apps would warn or exit unless they had an explicit check for empty list of args.

Test Plan

Since this is a (necessary) behaviour change, I had a look at all the users of KDBusService::Unique I could find.

  • khelpcenter: was exiting due to QCLP::process when started twice, fixed by calling parse() instead, and fixed by this commit.
  • konsole: was unconditionally prepending the exe name, but fortunately ignoring positional args, so no behaviour change. Debug output (independent from this commit) : Konsole::Application::slotActivateRequested: ("/usr/bin/konsole", "konsole", "--new-tab")
  • plasmawindowed: early exit when called without arguments, so not affected.
  • plasma-discover: got a bug report for the QCLP assert (367944), fixed by early return, now unnecessary.
  • kfontinst, pim-data-exporter: early return if args list empty, will be ok with going in the if now.
  • kleopatra, kalarm: had a check (workaround) for the case of empty argument list, now unnecessary.
  • kwalletmanager, bluedevil, systemsettings, krunner, plasma-nm-editor: no parsing of arguments in the slot connected to ActivateRequested, OK
  • about 15-20 others: no handling of activateRequested, OK
  • kde-print-queue: BUGGY. On second run, it tries to print the queue "kde-print-queue" as well. Can only be fixed by skipping first arg, after relying on this fix.

Diff Detail

Repository
R271 KDBusAddons
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Jul 9 2017, 8:51 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 9 2017, 8:51 AM
dfaure updated this revision to Diff 16374.Jul 9 2017, 8:52 AM

Make the behaviour explicit in the documentation.

dfaure abandoned this revision.Jul 9 2017, 9:21 AM

It was already documented that the arg list could be empty when called directly via DBus, so this fix is wrong. Apps have to handle empty args list correctly.

Docu updated in https://commits.kde.org/kdbusaddons/856ddb707268c683be3406eeb7d41437a531e4d9 instead.