Commits

Yuya Nishihara committed 5f06f9c

filectxactions: remove dead code to handle null of custom-tools "make" function

  • Participants
  • Parent commits 763001c

Comments (0)

Files changed (1)

tortoisehg/hgqt/filectxactions.py

         if not tools:
             return
         submenu = QMenu(_('Custom Tools'), self.parent())
-        emptysubmenu = True
         for name in toollist:
             if name == '|':
                 submenu.addSeparator()
             icon = info.get('icon', customtools.DEFAULTICONNAME)
             status = info.get('status')
             a = submenu.addAction(label)
+            a.setData(name)
             if icon:
                 a.setIcon(qtlib.geticon(icon))
             if status:
             else:
                 fdfilters = ()
             self._customactions[name] = (a, fdfilters)
-            if a is not None:
-                a.setData(name)
-                emptysubmenu = False
-        if emptysubmenu:
-            submenu.setParent(None)  # will be deleted
-            return
         return submenu
 
     @pyqtSlot(QAction)