From ddb7afffa9d846b2798e6c7a644d8dc052ebb7eb Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 28 May 2011 13:59:16 +0100 Subject: [PATCH] Improve handling of affiliate flag. --- src/calibre/gui2/store/search/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/store/search/models.py b/src/calibre/gui2/store/search/models.py index 797195e202..44a993ef12 100644 --- a/src/calibre/gui2/store/search/models.py +++ b/src/calibre/gui2/store/search/models.py @@ -76,7 +76,7 @@ class Matches(QAbstractItemModel): self.reset() def add_result(self, result, store_plugin): - result.plugin = store_plugin + result.affiliate = getattr(store_plugin.base_plugin, 'affiliate', False) if result not in self.all_matches: self.layoutAboutToBeChanged.emit() self.all_matches.append(result) @@ -177,7 +177,7 @@ class Matches(QAbstractItemModel): elif result.drm == SearchResult.DRM_UNKNOWN: return QVariant(self.DRM_UNKNOWN_ICON) if col == 5: - if getattr(result.plugin.base_plugin, 'affiliate', False): + if result.affiliate: icon = QIcon() icon.addFile(I('donate.png'), QSize(16, 16)) return QVariant(icon) @@ -218,7 +218,7 @@ class Matches(QAbstractItemModel): elif col == 4: text = result.store_name elif col == 5: - if getattr(result.plugin.base_plugin, 'affiliate', False): + if result.affiliate: text = 'y' else: text = 'n'