Changed name of lastChecked QDateTime setting

This commit is contained in:
alby128 2017-10-08 00:13:59 +02:00
parent d8edc2d3ca
commit 9b2191dde2
3 changed files with 23 additions and 6 deletions

19
bintray.json Normal file
View File

@ -0,0 +1,19 @@
{
"package": {
"name": "Syncplay",
"repo": "Syncplay",
"subject": "alby128"
},
"version": {
"name": "1.5.0_test"
},
"files":
[
{"includePattern": "dist_dmg/(.*)", "uploadPattern": "$1",
"matrixParams": {
"override": 1 }}
],
"publish": true
}

View File

@ -278,8 +278,8 @@ class ConfigDialog(QtWidgets.QDialog):
def loadLastUpdateCheckDate(self):
settings = QSettings("Syncplay", "Interface")
settings.beginGroup("Update")
self.lastCheckedForUpdates = settings.value("lastChecked", None)
if self.lastCheckedForUpdates and type(self.lastCheckedForUpdates).__name__ == 'QDateTime':
self.lastCheckedForUpdates = settings.value("lastCheckedQt", None)
if self.lastCheckedForUpdates:
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")

View File

@ -1524,8 +1524,6 @@ class MainWindow(QtWidgets.QMainWindow):
return
if self.config['lastCheckedForUpdates']:
configLastChecked = datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f")
if type(self.lastCheckedForUpdates).__name__ != 'QDateTime':
self.lastCheckedForUpdates = None
if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates.toPython():
self.lastCheckedForUpdates = QDateTime.fromString(self.config["lastCheckedForUpdates"],'yyyy-MM-dd HH-mm-ss')
if self.lastCheckedForUpdates is None:
@ -1672,7 +1670,7 @@ class MainWindow(QtWidgets.QMainWindow):
settings.endGroup()
settings = QSettings("Syncplay", "Interface")
settings.beginGroup("Update")
settings.setValue("lastChecked", self.lastCheckedForUpdates)
settings.setValue("lastCheckedQt", self.lastCheckedForUpdates)
settings.endGroup()
settings.beginGroup("PublicServerList")
if self.publicServerList:
@ -1699,7 +1697,7 @@ class MainWindow(QtWidgets.QMainWindow):
settings.endGroup()
settings = QSettings("Syncplay", "Interface")
settings.beginGroup("Update")
self.lastCheckedForUpdates = settings.value("lastChecked", None)
self.lastCheckedForUpdates = settings.value("lastCheckedQt", None)
settings.endGroup()
settings.beginGroup("PublicServerList")
self.publicServerList = settings.value("publicServers", None)