Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

manifestmodel: rename pathFromIndex to filePath, like QFileSystemModel

Changeset beb8bfaaec04

Parent eed2fb21d453

by Yuya Nishihara

Changes to 3 files · Browse files at beb8bfaaec04 Showing diff from parent eed2fb21d453 Diff from another changeset...

 
40
41
42
43
44
45
46
 
 
 
 
47
48
49
 
40
41
42
 
 
 
 
43
44
45
46
47
48
49
@@ -40,10 +40,10 @@
   def test_pathfromindex():   m = newmodel() - assert_equals('', m.pathFromIndex(QModelIndex())) - assert_equals('bar', m.pathFromIndex(m.index(1, 0))) - assert_equals('baz', m.pathFromIndex(m.index(0, 0))) - assert_equals('baz/bax', m.pathFromIndex(m.index(0, 0, m.index(0, 0)))) + assert_equals('', m.filePath(QModelIndex())) + assert_equals('bar', m.filePath(m.index(1, 0))) + assert_equals('baz', m.filePath(m.index(0, 0))) + assert_equals('baz/bax', m.filePath(m.index(0, 0, m.index(0, 0))))    def test_indexfrompath():   m = newmodel()
 
218
219
220
221
 
222
223
224
 
229
230
231
232
 
233
234
235
 
218
219
220
 
221
222
223
224
 
229
230
231
 
232
233
234
235
@@ -218,7 +218,7 @@
  @property   def path(self):   """Return currently selected path""" - return self._treemodel.pathFromIndex(self._treeview.currentIndex()) + return self._treemodel.filePath(self._treeview.currentIndex())     @pyqtSlot(unicode)   def setpath(self, path): @@ -229,7 +229,7 @@
  # see http://thread.gmane.org/gmane.comp.python.pyqt-pykde/19836   #@pyqtSlot(QModelIndex)   def _fileselected(self, index): - path = self._treemodel.pathFromIndex(index) + path = self._treemodel.filePath(index)   if path not in self._repo[self._rev]:   self._contentview.setCurrentWidget(self._nullcontent)   return
 
104
105
106
107
 
108
109
110
 
104
105
106
 
107
108
109
110
@@ -104,7 +104,7 @@
  roote.sort()   return roote   - def pathFromIndex(self, index): + def filePath(self, index):   if not index.isValid():   return ''