Fix tertiary updates being notified if the current primary.secondary version is less than the released primary.secondary

This commit is contained in:
Kovid Goyal 2018-06-02 18:36:43 +05:30
parent 66be8fe65d
commit d91585c7dc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -101,6 +101,12 @@ class CheckForUpdates(Thread):
self.shutdown_event.set()
def version_key(calibre_version):
if calibre_version.count('.') > 1:
calibre_version = calibre_version.rpartition('.')[0]
return 'update to version %s' % calibre_version
class UpdateNotification(QDialog):
def __init__(self, calibre_version, plugin_updates, parent=None):
@ -143,7 +149,7 @@ class UpdateNotification(QDialog):
self.l.addWidget(self.bb, 2, 0, 1, -1)
self.bb.accepted.connect(self.accept)
self.bb.rejected.connect(self.reject)
dynamic.set('update to version %s'%calibre_version, False)
dynamic.set(version_key(calibre_version), False)
def get_plugins(self):
from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
@ -208,8 +214,7 @@ class UpdateMixin(object):
self.status_bar.update_label.setVisible(True)
if has_calibre_update:
if (force or (config.get('new_version_notification') and dynamic.get(
'update to version %s'%calibre_version, True))):
if (force or (config.get('new_version_notification') and dynamic.get(version_key(calibre_version), True))):
if not no_show_popup:
self._update_notification__ = UpdateNotification(calibre_version,
number_of_plugin_updates, parent=self)