Force dbus introspection on the Dolphin_1 object
ClosedPublic

Authored by elvisangelaccio on Nov 24 2019, 6:33 PM.

Details

Summary

QtDBus caches known interfaces when passing a non-empty interface name
to the QDbusInterface constructor. This is an issue when calling the
FileManager1 methods more than once, because preferred could be a
valid interface from the cache, but it would later fail to call the
openFiles/openDirectories methods on the main window.

By passing an empty interface name, we prevent QtDBus from using the
cache so that we always get an invalid interface when calling the
FileManager1 methods on a daemonized dolphin process (that doesn't have
the Dolphin_1 dbus object).

BUG: 414402
FIXED-IN: 19.12.0

Test Plan
  1. dolphin --daemon
  2. qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 ShowFolders "/tmp" ""
  3. Close the dolphin window that was just opened.
  4. Start a normal dolphin process
  5. qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 ShowFolders "/tmp" ""
  6. Close again the dolphin window
  7. qdbus org.freedesktop.FileManager1 /org/freedesktop/FileManager1 ShowFolders "/tmp" ""

Diff Detail

Repository
R318 Dolphin
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: Dolphin. · View Herald TranscriptNov 24 2019, 6:33 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
elvisangelaccio requested review of this revision.Nov 24 2019, 6:33 PM
anthonyfieroni added a subscriber: anthonyfieroni.EditedNov 25 2019, 6:21 AM

It looks like a hack knowing Qt algorithm, can we append the pid in the name? It looks like same, but if we have more than one instances?

We could just not introspect at all.
We know the interface we'll be using in advanced.

We can use the generation from the XML.

It looks like a hack knowing Qt algorithm, can we append the pid in the name? It looks like same, but if we have more than one instances?

preferredService already has the pid appended.

We could just not introspect at all.
We know the interface we'll be using in advanced.

We can use the generation from the XML.

Yes, that's on my todo list. However it's too late for 19.12 :/

I'm going to push this tomorrow unless there are strong objections.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 28 2019, 8:59 PM
This revision was automatically updated to reflect the committed changes.