Fixed (again) QSettings on Windows and macOS

This commit is contained in:
alby128 2017-09-16 19:39:08 +02:00
parent 81a1d9e7b2
commit 1741bcffe1
2 changed files with 3 additions and 3 deletions

2
syncplay/ui/GuiConfiguration.py Normal file → Executable file
View File

@ -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")

4
syncplay/ui/gui.py Normal file → Executable file
View File

@ -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()