Skip to content

Commit

Permalink
Spices.py: Skip actions when they contain the 'Active' key and
Browse files Browse the repository at this point in the history
its value is false.
  • Loading branch information
mtwebster committed Dec 12, 2023
1 parent 5de2b89 commit 64e09e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions files/usr/share/cinnamon/cinnamon-settings/bin/Spices.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,16 @@ def _load_metadata(self):
metadata = dict()
keyfile = GLib.KeyFile.new()
keyfile.load_from_file(full_path, GLib.KeyFileFlags.KEEP_TRANSLATIONS)

try:
# The Active key is not typically used, but there are some inactive actions
# installed by Nemo, which should not show in the list.
if not keyfile.get_boolean('Nemo Action', 'Active'):
continue
except GLib.Error as e:
if e.code == GLib.KeyFileError.NOT_FOUND:
pass

metadata['name'] = keyfile.get_locale_string('Nemo Action', 'Name')
metadata['description'] = keyfile.get_locale_string('Nemo Action', 'Comment')
metadata['writable'] = False
Expand Down

0 comments on commit 64e09e4

Please sign in to comment.