-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
manager: Resort extension list only with sort-enabled-first
Helps #220
- Loading branch information
Showing
1 changed file
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* exm-manager.c | ||
/* | ||
* exm-manager.c | ||
* | ||
* Copyright 2022-2024 Matthew Jakeman <[email protected]> | ||
* Copyright 2022-2025 Matthew Jakeman <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -26,6 +27,8 @@ | |
#include "../exm-types.h" | ||
#include "../exm-enums.h" | ||
|
||
#include "exm-config.h" | ||
|
||
struct _ExmManager | ||
{ | ||
GObject parent_instance; | ||
|
@@ -764,13 +767,19 @@ on_state_changed (ShellExtensions *object, | |
return; | ||
} | ||
|
||
GSettings *settings; | ||
settings = g_settings_new (APP_ID); | ||
|
||
// Emit items-changed signal to re-sort extension list | ||
if (g_settings_get_boolean (settings, "sort-enabled-first")) | ||
{ | ||
guint position; | ||
if (g_list_store_find_with_equal_func (list_store, extension, (GEqualFunc)is_extension_equal, &position)) | ||
g_list_model_items_changed (G_LIST_MODEL (list_store), position, 1, 1); | ||
} | ||
|
||
g_object_unref (settings); | ||
|
||
// If the extension that has changed has an update, then | ||
// one or more extensions have updates available. Lazily | ||
// check the exact number and emit the 'updates-available' | ||
|