RefactoringRope/MatchesDialog.py

changeset 21
46236998ad5f
parent 20
83b71483e198
child 35
79e19b499675
--- a/RefactoringRope/MatchesDialog.py	Sun Jan 30 19:19:40 2011 +0100
+++ b/RefactoringRope/MatchesDialog.py	Wed Feb 02 08:55:36 2011 +0100
@@ -20,6 +20,8 @@
     """
     Class implementing a dialog to show matching references/definitions.
     """
+    FilePathRole = Qt.UserRole
+    
     def __init__(self, ui, showConfidence, parent=None, name=None):
         """
         Constructor
@@ -39,6 +41,7 @@
         
         self.ui = ui
         self.__showConfidence = showConfidence
+        self.__e5project = e5App().getObject("Project")
         
         if not self.__showConfidence:
             self.matchesList.setColumnHidden(2, True)
@@ -64,7 +67,7 @@
         Private slot to handle the itemActivated signal of the list.
         """
         lineno = int(item.text(1))
-        fn = item.text(0)
+        fn = item.data(0, MatchesDialog.FilePathRole)
         e5App().getObject("ViewManager").openSourceFile(fn, lineno)
     
     def addEntry(self, resource, lineno, unsure=False):
@@ -81,9 +84,10 @@
         else:
             conf = 100
         itm = QTreeWidgetItem(self.matchesList,
-            [resource.real_path,
+            [self.__e5project.getRelativePath(resource.real_path),
              " {0:5d}".format(lineno),
              " {0:5d}%".format(conf)])
+        itm.setData(0, MatchesDialog.FilePathRole, resource.real_path)
         itm.setTextAlignment(1, Qt.AlignRight)
         itm.setTextAlignment(2, Qt.AlignRight)
         self.__resort()

eric ide

mercurial