Project/ProjectBaseBrowser.py

branch
Py2 comp.
changeset 2791
a9577f248f04
parent 2677
3d4277929fb3
parent 2769
8cbebde7a984
child 3057
10516539f238
equal deleted inserted replaced
2790:6686a3326df8 2791:a9577f248f04
331 if sindex.isValid(): 331 if sindex.isValid():
332 index = self.model().mapFromSource(sindex) 332 index = self.model().mapFromSource(sindex)
333 if index.isValid(): 333 if index.isValid():
334 self._selectSingleItem(index) 334 self._selectSingleItem(index)
335 self.scrollTo(index, QAbstractItemView.PositionAtTop) 335 self.scrollTo(index, QAbstractItemView.PositionAtTop)
336
337 def selectFileLine(self, fn, lineno):
338 """
339 Public method to highlight a node given its filename.
340
341 @param fn filename of file to be highlighted (string)
342 @param lineno one based line number of the item (integer)
343 """
344 newfn = os.path.abspath(fn)
345 newfn = self.project.getRelativePath(newfn)
346 sindex = self._model.itemIndexByNameAndLine(newfn, lineno)
347 if sindex.isValid():
348 index = self.model().mapFromSource(sindex)
349 if index.isValid():
350 self._selectSingleItem(index)
351 self.scrollTo(index)
336 352
337 def _expandAllDirs(self): 353 def _expandAllDirs(self):
338 """ 354 """
339 Protected slot to handle the 'Expand all directories' menu action. 355 Protected slot to handle the 'Expand all directories' menu action.
340 """ 356 """

eric ide

mercurial