From 1741bcffe160d75cea7d03412d075dc6e3a4c818 Mon Sep 17 00:00:00 2001 From: alby128 Date: Sat, 16 Sep 2017 19:39:08 +0200 Subject: [PATCH] Fixed (again) QSettings on Windows and macOS --- syncplay/ui/GuiConfiguration.py | 2 +- syncplay/ui/gui.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 syncplay/ui/GuiConfiguration.py mode change 100644 => 100755 syncplay/ui/gui.py diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py old mode 100644 new mode 100755 index f2a66e7..061aa5a --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -279,7 +279,7 @@ class ConfigDialog(QtWidgets.QDialog): self.lastCheckedForUpdates = settings.value("lastChecked", None) if self.lastCheckedForUpdates: if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] is not "": - if self.lastCheckedForUpdates > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"): + if self.lastCheckedForUpdates.toPython() > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"): self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z") else: self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z") diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py old mode 100644 new mode 100755 index 690df1a..78d5a65 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -1445,12 +1445,12 @@ class MainWindow(QtWidgets.QMainWindow): return if self.config['lastCheckedForUpdates']: configLastChecked = datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f") - if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates: + if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates.toPython(): self.lastCheckedForUpdates = configLastChecked if self.lastCheckedForUpdates is None: self.checkForUpdates() else: - timeDelta = currentDateTimeValue - self.lastCheckedForUpdates + timeDelta = currentDateTimeValue.toPython() - self.lastCheckedForUpdates.toPython() if timeDelta.total_seconds() > constants.AUTOMATIC_UPDATE_CHECK_FREQUENCY: self.checkForUpdates()