Fix compatibility with newer python3-nautilus
authorNathan Pratta Teodosio <nathan.teodosio@canonical.com>
Fri, 26 Aug 2022 18:03:03 +0000 (15:03 -0300)
committerClaudio Cambra <claudio.cambra@gmail.com>
Sat, 29 Oct 2022 12:37:41 +0000 (14:37 +0200)
Signed-off-by: Nathan Pratta Teodosio <nathan.teodosio@canonical.com>
shell_integration/nautilus/syncstate.py

index c4dacb5b0f503487507f1f6103a7bb929b09aba9..f5116d1839e7198eb8381194b1965a0cb9579087 100644 (file)
@@ -200,9 +200,13 @@ class MenuExtension_ownCloud(GObject.GObject, Nautilus.MenuProvider):
                 break
         return (topLevelFolder, internalFile)
 
-    def get_file_items(self, window, files):
+    # The get_file_items method of Nautilus.MenuProvider no longer takes
+    # the window argument. To keep supporting older versions of Nautilus,
+    # we can use variadic arguments.
+    def get_file_items(self, *args):
         # Show the menu extension to share a file or folder
 
+        files = args[-1]
         # Get usable file paths from the uris
         all_internal_files = True
         for i, file_uri in enumerate(files):