Revert "add Baloo DBus signals for moved or removed files"
ClosedPublic

Authored by bruns on Apr 19 2020, 1:53 PM.

Details

Summary

Revert "add missing license"
This reverts commit 96fb5896c304b7292fc3cea87fb584b14b270448.

This reverts commit ef0e268c657718d4a353638f91d3723624c358ac.

The BalooWatcherApplication DBus interface was created to be used by
Elisa, but the only use there is to create some debug output.
As soon as Elisa registers itself, each rename causes a bunch
of DB queries (in case a directory is renamed, it builds the list
of all children) and a (potentially huge) DBus call.

The DBus interface is totally awkward, as it calls a method in the
watcher application (i.e. replicating the message on the sender side)
instead of using DBus signals and letting the DBus daemon do its job.

Keep the DBus interface as a stub, but remove the caused overhead.

Test Plan

ctest

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Apr 19 2020, 1:53 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 19 2020, 1:53 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Apr 19 2020, 1:53 PM

Sorry for the lack of time to do a proper review.

I will need to have a thorough look at what Elisa is currently doing and what is working (or not).

Is there another working way to get information about files that have moved without having an application monitor them itself ?

If I remember correctly, Baloo is not providing information about that even though it is monitoring it. Is this still the case ?

The unusual method to get notified is about avoiding signaling moved files if nobody is watching. Baloo will only callback if applications have registered themselves.

mgallien accepted this revision.Apr 19 2020, 8:20 PM

To be clear, I am fine with this change going in.

I would still like to work on a proper solution to allow an application to monitor moved files or similar stuff without having to add file system watchers itself (duplicate from Baloo owns watchers).

Do you have an idea ?

This revision is now accepted and ready to land.Apr 19 2020, 8:20 PM
ngraham accepted this revision.Apr 19 2020, 10:26 PM

The unusual method to get notified is about avoiding signaling moved files if nobody is watching. Baloo will only callback if applications have registered themselves.

Registering for (expensive) notifications is fine, the org.kde.baloo.fileindexer interface is doing it as well the awkward part is
a) using a method call instead of a signal
b) registering an interface to be called, instead of just a service name

To be clear, I am fine with this change going in.

I would still like to work on a proper solution to allow an application to monitor moved files or similar stuff without having to add file system watchers itself (duplicate from Baloo owns watchers).

Do you have an idea ?

Elisa would need to register something like a "persistent query". This is something also dolphin needs - there definitely already is some notification between dolphin/baloo, but that is not working properly.

This could be something like "Audio files in ~/Music/", "Audio files in ~/Audio books/", etc., and you get a signal whenever the query would return a different result.

To be clear, I am fine with this change going in.

I would still like to work on a proper solution to allow an application to monitor moved files or similar stuff without having to add file system watchers itself (duplicate from Baloo owns watchers).

Do you have an idea ?

Elisa would need to register something like a "persistent query". This is something also dolphin needs - there definitely already is some notification between dolphin/baloo, but that is not working properly.

This could be something like "Audio files in ~/Music/", "Audio files in ~/Audio books/", etc., and you get a signal whenever the query would return a different result.

That solution would be perfect and rely on working code inside Elisa.

Do you plan to work on it or should I start working on that ? That could take several weeks to be done.

This revision was automatically updated to reflect the committed changes.