Skip to content

Commit

Permalink
statusNotifierWatcher: use nicer lambda functions in traverseBusNames
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Apr 4, 2018
1 parent 2bb3172 commit 3d2abd6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions statusNotifierWatcher.js
Expand Up @@ -118,16 +118,14 @@ var StatusNotifierWatcher = new Lang.Class({
// when the plugin is enabled/disabled, thus we need to manually look
// for the objects in the session bus that implements the
// StatusNotifierItem interface...
let self = this;
Util.traverseBusNames(Gio.DBus.session, this._cancellable, function(bus, name, cancellable) {
Util.introspectBusObject(bus, name, cancellable, function(node_info) {
return Util.dbusNodeImplementsInterfaces(node_info, ["org.kde.StatusNotifierItem"]);
},
function(name, path) {
let id = self._getItemId(name, path);
if (!self._items[id]) {
Util.traverseBusNames(Gio.DBus.session, this._cancellable, (bus, name, cancellable) => {
Util.introspectBusObject(bus, name, cancellable, (node_info) => {
return Util.dbusNodeImplementsInterfaces(node_info, ['org.kde.StatusNotifierItem']);
}, (name, path) => {
let id = this._getItemId(name, path);
if (!this._items[id]) {
Util.Logger.debug("Using Brute-force mode for StatusNotifierItem "+id);
self._registerItem(path, name, path);
this._registerItem(path, name, path);
}
})
});
Expand Down

0 comments on commit 3d2abd6

Please sign in to comment.