Skip to content

Commit

Permalink
LauncherManager: listen to the changes in launchers in the configurat…
Browse files Browse the repository at this point in the history
…ion file

Allow to add a launcher and it being taken into account.
  • Loading branch information
tintou committed Jul 9, 2024
1 parent 6d4d6e5 commit 2f7d9b4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/LauncherManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@
if (key == "icon-size") {
reposition_launchers ();
}

if (key == "launchers") {
int index = 0;
foreach (string app_id in settings.get_strv ("launchers")) {
var app_info = new GLib.DesktopAppInfo (app_id);
unowned List<Launcher>? launcher = launchers.search<DesktopAppInfo> (app_info, (l, info) => {
return l.app.app_info.equal (info) ? 0 : -1;
});
if (launcher == null) {
add_launcher (app_info, true, false, index);
} else {
index = launchers.index (launcher.data) + 1;
}
}

reposition_launchers ();
}
});

var drop_target_file = new Gtk.DropTarget (typeof (File), COPY) {
Expand Down

0 comments on commit 2f7d9b4

Please sign in to comment.