Avoid error on unexpected last update check format when changing between Python versions (#170)
This commit is contained in:
parent
e1b12327fd
commit
79c34f823e
@ -289,13 +289,16 @@ class ConfigDialog(QtWidgets.QDialog):
|
|||||||
def loadLastUpdateCheckDate(self):
|
def loadLastUpdateCheckDate(self):
|
||||||
settings = QSettings("Syncplay", "Interface")
|
settings = QSettings("Syncplay", "Interface")
|
||||||
settings.beginGroup("Update")
|
settings.beginGroup("Update")
|
||||||
self.lastCheckedForUpdates = settings.value("lastCheckedQt", None)
|
try:
|
||||||
if self.lastCheckedForUpdates:
|
self.lastCheckedForUpdates = settings.value("lastCheckedQt", None)
|
||||||
if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] is not "":
|
if self.lastCheckedForUpdates:
|
||||||
if self.lastCheckedForUpdates.toPython() > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"):
|
if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] is not "":
|
||||||
|
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")
|
self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z")
|
||||||
else:
|
except:
|
||||||
self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z")
|
self.lastCheckedForUpdates = None
|
||||||
|
|
||||||
def loadSavedPublicServerList(self):
|
def loadSavedPublicServerList(self):
|
||||||
settings = QSettings("Syncplay", "Interface")
|
settings = QSettings("Syncplay", "Interface")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user