UI/BrowserModel.py

changeset 1785
9c6d23391248
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
1782:90bd49fec9ff 1785:9c6d23391248
297 entryInfoList = qdir.entryInfoList(filter) 297 entryInfoList = qdir.entryInfoList(filter)
298 298
299 # step 1: check for new entries 299 # step 1: check for new entries
300 children = itm.children() 300 children = itm.children()
301 for f in entryInfoList: 301 for f in entryInfoList:
302 fpath = f.absoluteFilePath() 302 fpath = Utilities.toNativeSeparators(f.absoluteFilePath())
303 childFound = False 303 childFound = False
304 for child in children: 304 for child in children:
305 if child.name() == fpath: 305 if child.name() == fpath:
306 childFound = True 306 childFound = True
307 children.remove(child) 307 children.remove(child)
324 324
325 # step 2: check for removed entries 325 # step 2: check for removed entries
326 if len(entryInfoList) != itm.childCount(): 326 if len(entryInfoList) != itm.childCount():
327 for row in range(oldCnt - 1, -1, -1): 327 for row in range(oldCnt - 1, -1, -1):
328 child = itm.child(row) 328 child = itm.child(row)
329 childname = Utilities.fromNativeSeparators(child.name())
329 entryFound = False 330 entryFound = False
330 for f in entryInfoList: 331 for f in entryInfoList:
331 if f.absoluteFilePath() == child.name(): 332 if f.absoluteFilePath() == childname:
332 entryFound = True 333 entryFound = True
333 entryInfoList.remove(f) 334 entryInfoList.remove(f)
334 break 335 break
335 if entryFound: 336 if entryFound:
336 continue 337 continue

eric ide

mercurial