rainerf / ricodebug

ricodebug is a debugger featuring data visualization, similar to DDD
12 stars 9 forks source link

fixed recentfilehandler #20

Closed bernschab closed 12 years ago

bernschab commented 12 years ago
bernschab commented 12 years ago

sorry, simply forgot about those. variables are dropped now.

bernschab commented 12 years ago

true, by default it is not possible that paths are stored more than once, but last time we said just in case of a somehow strangely broken .conf file, we check for this case nonetheless. if I pull a stunt like list(set(originallist)), can I be sure that the elements have the same relative order afterwards? plus, how can I find out if anything was deleted at all and HOW MANY elements where deleted? that would be required, in order to keep the list at exactly the same lengh, wouldn't it?

will fix the other issues immediately.

rainerf commented 12 years ago

@ multiple elements in the list: This check was because of the backwards compatibility IIRC.

@ uniquifying: True, the order would not be preserved. This should still be more readable:

self.recentfiles = []
for i in range(self.nrRecentFiles):
    ...
    filename = self.settings.value("Filename").toString()
    if not filename in self.recentfiles:
        recentfiles.append(filename)
    else:
        recentfiles.append("")

(NB: untested)