fix: migrate to nautilus api 4.0
The new Version introduced a breaking change to the MenuProvider interface. This change keeps compatibility with the lower version. See: <https://gnome.pages.gitlab.gnome.org/nautilus-python/nautilus-python-migrating-to-4.html>
This commit is contained in:
@@ -34,12 +34,14 @@ class KittyNautilusExtension(GObject.GObject, Nautilus.MenuProvider):
|
||||
item.connect("activate", self.launch_kitty, path)
|
||||
return item
|
||||
|
||||
def get_file_items(self, _window, files) -> [Nautilus.MenuItem]:
|
||||
def get_file_items(self, *args) -> [Nautilus.MenuItem]:
|
||||
files = args[-1]
|
||||
if len(files) == 1:
|
||||
path = files[0].get_location().get_path()
|
||||
if os.path.isdir(path):
|
||||
return [self.make_item("NautilusFileOpenKitty", path)]
|
||||
|
||||
def get_background_items(self, _window, file) -> [Nautilus.MenuItem]:
|
||||
path = file.get_location().get_path()
|
||||
def get_background_items(self, *args) -> [Nautilus.MenuItem]:
|
||||
folder = args[-1]
|
||||
path = folder.get_location().get_path()
|
||||
return [self.make_item("NautilusBackgroundOpenKitty", path)]
|
||||
|
||||
Reference in New Issue
Block a user