74 """ |
74 """ |
75 lineno = int(item.text(1)) |
75 lineno = int(item.text(1)) |
76 fn = item.data(0, MatchesDialog.FilePathRole) |
76 fn = item.data(0, MatchesDialog.FilePathRole) |
77 e5App().getObject("ViewManager").openSourceFile(fn, lineno) |
77 e5App().getObject("ViewManager").openSourceFile(fn, lineno) |
78 |
78 |
79 def addEntry(self, resource, lineno, unsure=False): |
79 def addEntry(self, filename, lineno, unsure=False): |
80 """ |
80 """ |
81 Public slot to add an entry to the list. |
81 Public slot to add an entry to the list. |
82 |
82 |
83 @param resource reference to the resource object |
83 @param filename full path of the matched file |
84 (rope.base.resources.Resource) |
84 @type str |
85 @param lineno linenumber of the match (integer) |
85 @param lineno line number of the match |
86 @param unsure flag indicating an unsure match (boolean) |
86 @type int |
|
87 @param unsure flag indicating an unsure match |
|
88 @type bool |
87 """ |
89 """ |
88 if unsure: |
90 if unsure: |
89 conf = 50 |
91 conf = 50 |
90 else: |
92 else: |
91 conf = 100 |
93 conf = 100 |
92 itm = QTreeWidgetItem( |
94 itm = QTreeWidgetItem( |
93 self.matchesList, |
95 self.matchesList, |
94 [self.__e5project.getRelativePath(resource.real_path), |
96 [self.__e5project.getRelativePath(filename), |
95 " {0:5d}".format(lineno), |
97 " {0:5d}".format(lineno), |
96 " {0:5d}%".format(conf)]) |
98 " {0:5d}%".format(conf)]) |
97 itm.setData(0, MatchesDialog.FilePathRole, resource.real_path) |
99 itm.setData(0, MatchesDialog.FilePathRole, filename) |
98 itm.setTextAlignment(1, Qt.AlignRight) |
100 itm.setTextAlignment(1, Qt.AlignRight) |
99 itm.setTextAlignment(2, Qt.AlignRight) |
101 itm.setTextAlignment(2, Qt.AlignRight) |
100 self.__resort() |
102 self.__resort() |
101 self.__resizeColumns() |
103 self.__resizeColumns() |