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

modeltest: bug fixes from Wolfgang Rohdewald <wolfgang@rohdewald.de>

Also included a few trailing white-space cleanups.

Changeset c8b88546b90e

Parent 461390733a05

by Steve Borho

Changes to one file · Browse files at c8b88546b90e Showing diff from parent 461390733a05 Diff from another changeset...

 
104
105
106
107
 
108
109
110
 
121
122
123
124
 
125
126
127
 
256
257
258
259
 
260
261
262
 
266
267
268
269
 
270
271
272
273
274
275
276
277
 
278
279
280
 
322
323
324
325
 
326
327
328
 
339
340
341
342
343
344
 
 
 
345
346
347
348
349
350
 
351
352
353
354
 
 
355
356
357
 
104
105
106
 
107
108
109
110
 
121
122
123
 
124
125
126
127
 
256
257
258
 
259
260
261
262
 
266
267
268
 
269
270
271
272
273
 
 
 
 
274
275
276
277
 
319
320
321
 
322
323
324
325
 
336
337
338
 
 
 
339
340
341
342
343
344
345
346
 
347
348
349
 
 
350
351
352
353
354
@@ -104,7 +104,7 @@
  def rowCount(self):   """   Tests self.model's implementation of QtCore.QAbstractItemModel::rowCount() and hasChildren() - +   self.models that are dynamically populated are not as fully tested here.   """   # check top row @@ -121,7 +121,7 @@
  assert(rows >= 0)   if rows > 0:   assert(self.model.hasChildren(secondlvl) == True) - +   # The self.models rowCount() is tested more extensively in checkChildren,   # but this catches the big mistakes   @@ -256,7 +256,7 @@
  variant = self.model.data(self.model.index(0,0,QtCore.QModelIndex()), QtCore.Qt.WhatsThisRole)   if variant.isValid():   assert( variant.canConvert( QtCore.QVariant.String ) ) - +   # General Purpose roles that should return a QSize   variant = self.model.data(self.model.index(0,0,QtCore.QModelIndex()), QtCore.Qt.SizeHintRole)   if variant.isValid(): @@ -266,15 +266,12 @@
  variant = self.model.data(self.model.index(0,0,QtCore.QModelIndex()), QtCore.Qt.FontRole)   if variant.isValid():   assert( variant.canConvert( QtCore.QVariant.Font ) ) - +   # Check that the alignment is one we know about   variant = self.model.data(self.model.index(0,0,QtCore.QModelIndex()), QtCore.Qt.TextAlignmentRole)   if variant.isValid():   alignment = variant.toInt()[0] - assert( alignment == QtCore.Qt.AlignLeft or - alignment == QtCore.Qt.AlignRight or - alignment == QtCore.Qt.AlignHCenter or - alignment == QtCore.Qt.AlignJustify) + assert( alignment == (alignment & int(QtCore.Qt.AlignHorizontal_Mask | QtCore.Qt.AlignVertical_Mask)))     # General Purpose roles that should return a QColor   variant = self.model.data(self.model.index(0,0,QtCore.QModelIndex()), QtCore.Qt.BackgroundColorRole) @@ -322,7 +319,7 @@
  c = self.insert.pop()   assert(c['parent'] == parent)   assert(c['oldSize'] + (end - start + 1) == self.model.rowCount(parent)) - assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) + assert(c['last'] == self.model.data(self.model.index(start-1, 0, c['parent'])))     # if c['next'] != self.model.data(model.index(end+1, 0, c['parent'])):   # qDebug << start << end @@ -339,19 +336,19 @@
  c = {}   c['parent'] = parent   c['oldSize'] = self.model.rowCount(parent) - c['last'] = self.model.data(model.index(start-1, 0, parent)) - c['next'] = self.model.data(model.index(end+1, 0, parent)) - remove.append(c) + c['last'] = self.model.data(self.model.index(start-1, 0, parent)) + c['next'] = self.model.data(self.model.index(end+1, 0, parent)) + self.remove.append(c)     def rowsRemoved(self, parent, start, end):   """   Confirm that what was said was going to happen actually did   """ - c = remove.pop() + c = self.remove.pop()   assert(c['parent'] == parent)   assert(c['oldSize'] - (end - start + 1) == self.model.rowCount(parent)) - assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) - assert(c['next'] == self.model.data(model.index(start, 0, c['parent']))) + assert(c['last'] == self.model.data(self.model.index(start-1, 0, c['parent']))) + assert(c['next'] == self.model.data(self.model.index(start, 0, c['parent'])))     def checkChildren(self, parent, depth = 0):   """