From d0bfa2a6cace5d35e7539e524e6ea47618b28f03 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 16 Mar 2012 14:07:29 -0400 Subject: [PATCH] Converted dupeguru to the new automated QVariant conversion protocol introduced in PyQt (which is the default protocol when running under python 3). --- qt/base/results_model.py | 3 +-- run_template_qt.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/qt/base/results_model.py b/qt/base/results_model.py index 8617f753..e0cec6f9 100644 --- a/qt/base/results_model.py +++ b/qt/base/results_model.py @@ -52,11 +52,10 @@ class ResultsModel(Table): def _setData(self, row, column, value, role): if role == Qt.CheckStateRole: if column.name == 'name': - self.model.app.mark_dupe(row._dupe, value.toBool()) + self.model.app.mark_dupe(row._dupe, bool(value)) return True elif role == Qt.EditRole: if column.name == 'name': - value = value.toString() return self.model.rename_selected(value) return False diff --git a/run_template_qt.py b/run_template_qt.py index 765c7a1c..45c4906c 100644 --- a/run_template_qt.py +++ b/run_template_qt.py @@ -7,8 +7,6 @@ import sys import os.path as op -import sip -sip.setapi('QVariant', 1) from PyQt4.QtCore import QCoreApplication, QSettings from PyQt4.QtGui import QApplication, QIcon, QPixmap @@ -29,7 +27,7 @@ if __name__ == "__main__": QCoreApplication.setApplicationName(__appname__) QCoreApplication.setApplicationVersion(__version__) settings = QSettings() - lang = settings.value('Language').toString() + lang = settings.value('Language') locale_folder = op.join(BASE_PATH, 'locale') install_gettext_trans_under_qt(locale_folder, lang) # Many strings are translated at import time, so this is why we only import after the translator