nixpkgs/pkgs/by-name/na/nautilus-open-any-terminal/hardcode-gsettings.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

46 lines
2.5 KiB
Diff

diff --git a/nautilus_open_any_terminal/nautilus_open_any_terminal.py b/nautilus_open_any_terminal/nautilus_open_any_terminal.py
index 05b6514..b5541dc 100644
--- a/nautilus_open_any_terminal/nautilus_open_any_terminal.py
+++ b/nautilus_open_any_terminal/nautilus_open_any_terminal.py
@@ -413,9 +413,10 @@ if API_VERSION in ("3.0", "2.0"):
"""Provide keyboard shortcuts for opening terminals in Nautilus."""
def __init__(self):
- gsettings_source = Gio.SettingsSchemaSource.get_default()
- if gsettings_source.lookup(GSETTINGS_PATH, True):
- self._gsettings = Gio.Settings.new(GSETTINGS_PATH)
+ gsettings_source = Gio.SettingsSchemaSource.new_from_directory("@gsettings_path@", Gio.SettingsSchemaSource.get_default(), True)
+ if True:
+ _schema = gsettings_source.lookup(GSETTINGS_PATH, False)
+ self._gsettings = Gio.Settings.new_full(_schema, None, None);
self._gsettings.connect("changed", self._bind_shortcut)
self._create_accel_group()
self._window = None
@@ -452,9 +453,10 @@ class OpenAnyTerminalExtension(GObject.GObject, FileManager.MenuProvider):
"""Provide context menu items for opening terminals in Nautilus."""
def __init__(self):
- gsettings_source = Gio.SettingsSchemaSource.get_default()
- if gsettings_source.lookup(GSETTINGS_PATH, True):
- self._gsettings = Gio.Settings.new(GSETTINGS_PATH)
+ gsettings_source = Gio.SettingsSchemaSource.new_from_directory("@gsettings_path@", Gio.SettingsSchemaSource.get_default(), True)
+ if True:
+ _schema = gsettings_source.lookup(GSETTINGS_PATH, False)
+ self._gsettings = Gio.Settings.new_full(_schema, None, None);
def _get_terminal_name(self):
if self._gsettings.get_boolean(GSETTINGS_USE_GENERIC_TERMINAL_NAME):
@@ -512,8 +514,9 @@ class OpenAnyTerminalExtension(GObject.GObject, FileManager.MenuProvider):
)
-source = Gio.SettingsSchemaSource.get_default()
-if source is not None and source.lookup(GSETTINGS_PATH, True):
- _gsettings = Gio.Settings.new(GSETTINGS_PATH)
+source = Gio.SettingsSchemaSource.new_from_directory("@gsettings_path@", Gio.SettingsSchemaSource.get_default(), True)
+if True:
+ _schema = source.lookup(GSETTINGS_PATH, False)
+ _gsettings = Gio.Settings.new_full(_schema, None, None);
_gsettings.connect("changed", set_terminal_args)
set_terminal_args()