From fc18e3f8943393d0d12bb47e7fc54da36bbdc49f Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Sat, 22 Sep 2012 09:47:01 -0500 Subject: [PATCH] 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. --- picard/tagger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/picard/tagger.py b/picard/tagger.py index 321bd2b2c..62edd9b53 100644 --- a/picard/tagger.py +++ b/picard/tagger.py @@ -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()