eric6/WebBrowser/QtHelp/HelpDocsInstaller.py

changeset 8143
2c730d5fd177
parent 7960
e8fc383322f7
child 8218
7c09585bd960
--- a/eric6/WebBrowser/QtHelp/HelpDocsInstaller.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/WebBrowser/QtHelp/HelpDocsInstaller.py	Tue Mar 02 17:17:09 2021 +0100
@@ -60,7 +60,7 @@
         """
         Public method to start the installation procedure.
         """
-        self.start(QThread.LowPriority)
+        self.start(QThread.Priority.LowPriority)
     
     def run(self):
         """
@@ -119,7 +119,7 @@
         
         dt = QDateTime()
         if len(lst) and lst[0]:
-            dt = QDateTime.fromString(lst[0], Qt.ISODate)
+            dt = QDateTime.fromString(lst[0], Qt.DateFormat.ISODate)
         
         qchFile = ""
         if len(lst) == 2:
@@ -127,10 +127,12 @@
         
         if version == 4:
             docsPath = QDir(
-                QLibraryInfo.location(QLibraryInfo.DocumentationPath) +
+                QLibraryInfo.location(
+                    QLibraryInfo.LibraryLocation.DocumentationPath) +
                 QDir.separator() + "qch")
         elif version == 5:
-            docsPath = QLibraryInfo.location(QLibraryInfo.DocumentationPath)
+            docsPath = QLibraryInfo.location(
+                QLibraryInfo.LibraryLocation.DocumentationPath)
             if (
                 not os.path.isdir(docsPath) or
                 len(QDir(docsPath).entryList(["*.qch"])) == 0
@@ -148,7 +150,7 @@
         if not files:
             engine.setCustomValue(
                 versionKey,
-                QDateTime().toString(Qt.ISODate) + '|')
+                QDateTime().toString(Qt.DateFormat.ISODate) + '|')
             return False
         
         for f in files:
@@ -162,8 +164,8 @@
                 if (
                     dt.isValid() and
                     namespace in engine.registeredDocumentations() and
-                    (fi.lastModified().toString(Qt.ISODate) ==
-                     dt.toString(Qt.ISODate)) and
+                    (fi.lastModified().toString(Qt.DateFormat.ISODate) ==
+                     dt.toString(Qt.DateFormat.ISODate)) and
                     qchFile == fi.absoluteFilePath()
                 ):
                     return False
@@ -182,7 +184,7 @@
                 
                 engine.setCustomValue(
                     versionKey,
-                    fi.lastModified().toString(Qt.ISODate) + '|' +
+                    fi.lastModified().toString(Qt.DateFormat.ISODate) + '|' +
                     fi.absoluteFilePath())
                 return True
         
@@ -201,7 +203,7 @@
         
         dt = QDateTime()
         if len(lst) and lst[0]:
-            dt = QDateTime.fromString(lst[0], Qt.ISODate)
+            dt = QDateTime.fromString(lst[0], Qt.DateFormat.ISODate)
         
         qchFile = ""
         if len(lst) == 2:
@@ -212,7 +214,7 @@
         files = docsPath.entryList(["*.qch"])
         if not files:
             engine.setCustomValue(
-                versionKey, QDateTime().toString(Qt.ISODate) + '|')
+                versionKey, QDateTime().toString(Qt.DateFormat.ISODate) + '|')
             return False
         
         for f in files:
@@ -226,8 +228,8 @@
                 if (
                     dt.isValid() and
                     namespace in engine.registeredDocumentations() and
-                    (fi.lastModified().toString(Qt.ISODate) ==
-                     dt.toString(Qt.ISODate)) and
+                    (fi.lastModified().toString(Qt.DateFormat.ISODate) ==
+                     dt.toString(Qt.DateFormat.ISODate)) and
                     qchFile == fi.absoluteFilePath()
                 ):
                     return False
@@ -246,7 +248,7 @@
                 
                 engine.setCustomValue(
                     versionKey,
-                    fi.lastModified().toString(Qt.ISODate) + '|' +
+                    fi.lastModified().toString(Qt.DateFormat.ISODate) + '|' +
                     fi.absoluteFilePath())
                 return True
         

eric ide

mercurial