1
0
mirror of synced 2024-11-22 09:14:23 +01:00

Minor code simplification

This commit is contained in:
jvoisin 2018-07-18 23:15:47 +02:00
parent dc026f99ad
commit 0cd510938a

View File

@ -125,12 +125,6 @@ class ColumnExtension(GObject.GObject, Nautilus.MenuProvider):
return False return False
return True return True
def __validate_set(self, files):
for f in files:
if self.__validate(f):
return True
return False
def menu_activate_cb(self, menu, files): def menu_activate_cb(self, menu, files):
items = list(map(lambda x: unquote(x.get_uri()[7:]), files)) items = list(map(lambda x: unquote(x.get_uri()[7:]), files))
StatusWindow(items) StatusWindow(items)
@ -142,7 +136,7 @@ class ColumnExtension(GObject.GObject, Nautilus.MenuProvider):
def get_file_items(self, window, files): def get_file_items(self, window, files):
# Do not show the menu item if not a single file has a chance to be # Do not show the menu item if not a single file has a chance to be
# processed by mat2. # processed by mat2.
if not self.__validate_set(files): if not any(map(self.__validate, files)):
return return
item = Nautilus.MenuItem( item = Nautilus.MenuItem(