eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 7775
4a1db75550bd
parent 7771
787a6b3f8c9f
child 7779
757334671130
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Oct 10 16:03:53 2020 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun Oct 11 17:54:52 2020 +0200
@@ -11,7 +11,7 @@
 import re
 import collections
 
-from PyQt5.QtCore import pyqtSlot, Qt, QDate, QRegExp, QSize, QPoint, QFileInfo
+from PyQt5.QtCore import pyqtSlot, Qt, QDate, QSize, QPoint, QFileInfo
 from PyQt5.QtGui import (
     QColor, QPixmap, QPainter, QPen, QBrush, QIcon, QTextCursor, QPalette
 )
@@ -1841,7 +1841,7 @@
                     (branch == self.__allBranchesFilter or
                      topItem.text(self.BranchColumn) in
                         [branch, closedBranch]) and
-                    searchRx.indexIn(txt) > -1
+                    searchRx.search(txt) is not None
                 ):
                     topItem.setHidden(False)
                     if topItem is currentItem:
@@ -1866,25 +1866,25 @@
         txt = self.fieldCombo.itemData(self.fieldCombo.currentIndex())
         if txt == "author":
             fieldIndex = self.AuthorColumn
-            searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive)
+            searchRx = re.compile(self.rxEdit.text(), re.IGNORECASE)
         elif txt == "revision":
             fieldIndex = self.RevisionColumn
             txt = self.rxEdit.text()
             if txt.startswith("^"):
-                searchRx = QRegExp(r"^\s*{0}".format(txt[1:]),
-                                   Qt.CaseInsensitive)
+                searchRx = re.compile(r"^\s*{0}".format(txt[1:]),
+                                      re.IGNORECASE)
             else:
-                searchRx = QRegExp(txt, Qt.CaseInsensitive)
+                searchRx = re.compile(txt, re.IGNORECASE)
         elif txt == "file":
             fieldIndex = self.__changesRole
-            searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive)
+            searchRx = re.compile(self.rxEdit.text(), re.IGNORECASE)
             indexIsRole = True
         elif txt == "phase":
             fieldIndex = self.PhaseColumn
-            searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive)
+            searchRx = re.compile(self.rxEdit.text(), re.IGNORECASE)
         else:
             fieldIndex = self.__messageRole
-            searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive)
+            searchRx = re.compile(self.rxEdit.text(), re.IGNORECASE)
             indexIsRole = True
         
         return fieldIndex, searchRx, indexIsRole
@@ -2430,7 +2430,7 @@
                     txt = "\n".join(topItem.data(0, self.__messageRole))
             else:
                 txt = topItem.text(fieldIndex)
-            if searchRx.indexIn(txt) > -1:
+            if searchRx.search(txt) is not None:
                 self.logTree.setCurrentItem(self.logTree.topLevelItem(index))
                 break
         else:

eric ide

mercurial