Fix CD lookup

tagger.lookup_cd is connected to by a QMenu.triggered and a
QAction.triggered. The latter sends a "checked" argument even if the
QAction is not checkable, so action is never None. The old-style signal
syntax allowed you to ignore arguments for certain connections.
This commit is contained in:
Michael Wiencek
2012-09-22 09:47:01 -05:00
parent 95b328c8f8
commit fc18e3f894

View File

@@ -534,12 +534,12 @@ class Tagger(QtGui.QApplication):
else:
disc.lookup()
def lookup_cd(self, action=None):
def lookup_cd(self, action):
"""Reads CD from the selected drive and tries to lookup the DiscID on MusicBrainz."""
if action is None:
device = self.config.setting["cd_lookup_device"].split(",", 1)[0]
else:
if isinstance(action, QtGui.QAction):
device = unicode(action.text())
else:
device = self.config.setting["cd_lookup_device"].split(",", 1)[0]
disc = Disc()
self.set_wait_cursor()