UI/BrowserModel.py

branch
5_2_x
changeset 1786
27dab28b0482
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
1784:f74f03e98128 1786:27dab28b0482
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