Fixed some QDateTime use of obsolete methods. eric7

Wed, 26 May 2021 17:26:12 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 26 May 2021 17:26:12 +0200
branch
eric7
changeset 8382
28f7ef365d1b
parent 8378
d8b213573638
child 8383
c090300126df

Fixed some QDateTime use of obsolete methods.

eric7/Network/IRC/IrcChannelWidget.py file | annotate | diff | comparison | revisions
eric7/Plugins/VcsPlugins/vcsPySvn/SvnUtilities.py file | annotate | diff | comparison | revisions
eric7/WebBrowser/Bookmarks/NsHtmlReader.py file | annotate | diff | comparison | revisions
--- a/eric7/Network/IRC/IrcChannelWidget.py	Tue May 25 17:37:59 2021 +0200
+++ b/eric7/Network/IRC/IrcChannelWidget.py	Wed May 26 17:26:12 2021 +0200
@@ -894,7 +894,8 @@
             self.__addManagementMessage(
                 IrcChannelWidget.MessageIndicator,
                 self.tr("The topic was set by {0} on {1}.").format(
-                    match.group(2), QDateTime.fromTime_t(int(match.group(3)))
+                    match.group(2),
+                    QDateTime.fromSecsSinceEpoch(int(match.group(3)))
                     .toString("yyyy-MM-dd hh:mm")))
             return True
         
@@ -963,7 +964,7 @@
             self.__addManagementMessage(
                 IrcChannelWidget.MessageIndicator,
                 self.tr("This channel was created on {0}.").format(
-                    QDateTime.fromTime_t(int(match.group(2)))
+                    QDateTime.fromSecsSinceEpoch(int(match.group(2)))
                     .toString("yyyy-MM-dd hh:mm")))
             return True
         
--- a/eric7/Plugins/VcsPlugins/vcsPySvn/SvnUtilities.py	Tue May 25 17:37:59 2021 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsPySvn/SvnUtilities.py	Wed May 26 17:26:12 2021 +0200
@@ -25,7 +25,7 @@
     @return formatted time string (string)
     """
     return (
-        QDateTime.fromTime_t(int(seconds))
+        QDateTime.fromSecsSinceEpoch(int(seconds))
         .toTimeSpec(Qt.TimeSpec.LocalTime)
         .toString("yyyy-MM-dd hh:mm:ss")
     )
@@ -38,7 +38,7 @@
     @param seconds time in seconds since epoch to be formatted (float or long)
     @return date (QDate)
     """
-    return QDateTime.fromTime_t(int(seconds)).toTimeSpec(
+    return QDateTime.fromSecsSinceEpoch(int(seconds)).toTimeSpec(
         Qt.TimeSpec.LocalTime).date()
 
 
--- a/eric7/WebBrowser/Bookmarks/NsHtmlReader.py	Tue May 25 17:37:59 2021 +0200
+++ b/eric7/WebBrowser/Bookmarks/NsHtmlReader.py	Wed May 26 17:26:12 2021 +0200
@@ -84,7 +84,7 @@
                 node.expanded = self.__foldedRx.search(arguments) is None
                 addedMatch = self.__addedRx.search(arguments)
                 if addedMatch is not None:
-                    node.added = QDateTime.fromTime_t(
+                    node.added = QDateTime.fromSecsSinceEpoch(
                         int(addedMatch.group(1)))
                 folders.append(node)
                 lastNode = node
@@ -104,15 +104,15 @@
                     node.url = match1.group(1)
                 match1 = self.__addedRx.search(arguments)
                 if match1 is not None:
-                    node.added = QDateTime.fromTime_t(
+                    node.added = QDateTime.fromSecsSinceEpoch(
                         int(match1.group(1)))
                 match1 = self.__modifiedRx.search(arguments)
                 if match1 is not None:
-                    node.modified = QDateTime.fromTime_t(
+                    node.modified = QDateTime.fromSecsSinceEpoch(
                         int(match1.group(1)))
                 match1 = self.__visitedRx.search(arguments)
                 if match1 is not None:
-                    node.visited = QDateTime.fromTime_t(
+                    node.visited = QDateTime.fromSecsSinceEpoch(
                         int(match1.group(1)))
                 lastNode = node
             

eric ide

mercurial