Hello,
the bug that was described in the following thread:
https://groups.google.com/forum/?fromgroups=#!topic/spyderlib/9fK32oIY4fo
was fixed in beta 1, but now it is back again.
If I look into the source than the following function in the file
explorer.py - that fixed the bug -
is missing in beta2:
def restore_directory_state(self, fname):
674 """Restore directory expanded state""" 674 """Restore
directory expanded state"""
675 root = osp.normpath(unicode(fname)) 675 root =
osp.normpath(unicode(fname))
676 if not osp.exists(root): 676 if not osp.exists(root):
677 # Directory has been (re)moved outside Spyder 677 #
Directory has been (re)moved outside Spyder
678 return 678 return
679 for basename in os.listdir(root): 679 for basename in
os.listdir(root):
680 path = osp.normpath(osp.join(root, basename)) 680 path =
osp.normpath(osp.join(root, basename))
681 if osp.isdir(path) and path in self.__expanded_state: 681 if
osp.isdir(path) and path in self.__expanded_state:
682 self.__expanded_state.pop(self.__expanded_state.index(path))
682 self.__expanded_state.pop(self.__expanded_state.index(path))
683 if self._to_be_loaded is None: 683 if self._to_be_loaded
is None:
684 self._to_be_loaded = [] 684 self._to_be_loaded = []
685 self._to_be_loaded.append(path) 685
self._to_be_loaded.append(path)
686 686
687 # Prevent Qt from crashing or showing warnings like: 687
# Prevent Qt from crashing or showing warnings like:
688 # "QSortFilterProxyModel: index from wrong model passed to
688 # "QSortFilterProxyModel: index from wrong model passed to
689 # mapFromSource", probably due to the fact that the file 689
# mapFromSource", probably due to the fact that the file
690 # system model is being built 690 # system model is
being built
691 QTimer.singleShot(50, lambda path=path: 691 #
692 # This is just a workaround (any cleaner implementation
would
693 # be welcomed). The delay was first set to 50ms, but with
694 # slower machines, it appears that 200ms is a better
choice:
695 #
https://groups.google.com/group/spyderlib/browse_thread/thread/f5f2b7da8218e1fa
696 QTimer.singleShot(200, lambda path=path:
692 self.setExpanded(self.get_index(path), True)) 697
self.setExpanded(self.get_index(path), True))
693 698
694 if not self.__expanded_state: 699 if not
self.__expanded_state:
695 self.disconnect(self.fsmodel,
SIGNAL('directoryLoaded(QString)'), 700
self.disconnect(self.fsmodel, SIGNAL('directoryLoaded(QString)'),
696 self.restore_directory_state) 701 self.restore_directory_state)
Can someone please check how this could happen and fix it?
Best regards:
Uwe Fechner
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.