Fixed (again) QSettings on Windows and macOS
This commit is contained in:
parent
81a1d9e7b2
commit
1741bcffe1
2
syncplay/ui/GuiConfiguration.py
Normal file → Executable file
2
syncplay/ui/GuiConfiguration.py
Normal file → Executable 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
4
syncplay/ui/gui.py
Normal file → Executable 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()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user