From: =?utf-8?q?Jes=C3=BAs_Soto?= <jesus.soto@canonical.com>
Date: Wed, 17 Aug 2022 16:57:23 -0500
Subject: compatibility with nautilus 43

---
 extension/nautilus-admin.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/extension/nautilus-admin.py b/extension/nautilus-admin.py
index 4719bbc..2ca77a9 100644
--- a/extension/nautilus-admin.py
+++ b/extension/nautilus-admin.py
@@ -18,8 +18,6 @@
 import os, subprocess
 
 from gi import require_version
-require_version('Gtk', '3.0')
-require_version('Nautilus', '3.0')
 
 from gi.repository import Nautilus, GObject
 from gettext import gettext, bindtextdomain, textdomain
@@ -40,9 +38,10 @@ class NautilusAdmin(Nautilus.MenuProvider, GObject.GObject):
 	def __init__(self):
 		pass
 
-	def get_file_items(self, window, files):
+	def get_file_items(self, *args):
 		"""Returns the menu items to display when one or more files/folders are
 		selected."""
+		files = args[-1]
 		# Don't show when already running as root, or when more than 1 file is selected
 		if os.geteuid() == ROOT_UID or len(files) != 1:
 			return
@@ -51,7 +50,6 @@ class NautilusAdmin(Nautilus.MenuProvider, GObject.GObject):
 		# Add the menu items
 		items = []
 		self._setup_gettext();
-		self.window = window
 		if file.get_uri_scheme() == "file": # must be a local file/directory
 			if file.is_directory():
 				if os.path.exists(NAUTILUS_PATH):
@@ -62,9 +60,10 @@ class NautilusAdmin(Nautilus.MenuProvider, GObject.GObject):
 
 		return items
 
-	def get_background_items(self, window, file):
+	def get_background_items(self, *args):
 		"""Returns the menu items to display when no file/folder is selected
 		(i.e. when right-clicking the background)."""
+		file = args[-1]
 		# Don't show when already running as root
 		if os.geteuid() == ROOT_UID:
 			return
@@ -72,7 +71,6 @@ class NautilusAdmin(Nautilus.MenuProvider, GObject.GObject):
 		# Add the menu items
 		items = []
 		self._setup_gettext();
-		self.window = window
 		if file.is_directory() and file.get_uri_scheme() == "file":
 			if os.path.exists(NAUTILUS_PATH):
 				items += [self._create_nautilus_item(file)]
