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

reporegistry: use QString for self.name of RepoGroupItem

and don't convert to str. Allows to use for example "André" in group
names.

Changeset e8f197f5769a

Parent d0b852aa5032

by Adrian Buehlmann

Changes to one file · Browse files at e8f197f5769a Showing diff from parent d0b852aa5032 Diff from another changeset...

 
191
192
193
194
 
195
196
 
 
 
 
197
198
199
 
202
203
204
205
 
206
207
208
 
219
220
221
222
 
223
224
225
 
372
373
374
375
376
377
378
379
380
381
382
383
 
 
 
 
 
 
 
 
 
384
385
386
 
191
192
193
 
194
195
 
196
197
198
199
200
201
202
 
205
206
207
 
208
209
210
211
 
222
223
224
 
225
226
227
228
 
375
376
377
 
 
 
 
 
 
 
 
 
378
379
380
381
382
383
384
385
386
387
388
389
@@ -191,9 +191,12 @@
     class RepoGroupItem(RepoTreeItem): - def __init__(self, name='', parent=None): + def __init__(self, name=None, parent=None):   RepoTreeItem.__init__(self, parent) - self.name = name + if name: + self.name = name + else: + self.name = QString()     def data(self, column):   if column == 0: @@ -202,7 +205,7 @@
    def setData(self, column, value):   if column == 0: - self.name = str(value.toString()) + self.name = value.toString()   return True   return False   @@ -219,7 +222,7 @@
    def undump(self, xr):   a = xr.attributes() - self.name = str(a.value('', 'name').toString()) + self.name = a.value('', 'name').toString()   RepoTreeItem.undump(self, xr)     @@ -372,15 +375,15 @@
  return True     def setData(self, index, value, role): - s = str(value.toString()) - print "RepoTreeModel.setData(value='%s')" % s - if index.isValid() and role == Qt.EditRole: - if len(s) == 0: - return False - item = index.internalPointer() - if item.setData(index.column(), value): - self.emit(SIGNAL('dataChanged(index, index)'), index, index) - return True + if not index.isValid() or role != Qt.EditRole: + return False + s = value.toString() + if s.isEmpty(): + return False + item = index.internalPointer() + if item.setData(index.column(), value): + self.emit(SIGNAL('dataChanged(index, index)'), index, index) + return True   return False     # functions not defined in QAbstractItemModel