From 6b2e6aab97e4d48a092b904745a6c0b702cdeb17 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Thu, 8 Oct 2009 14:45:03 -0700 Subject: [PATCH] models.gitrepo: Ignore unknown paths PyQt4 segfaults when children are added to QStandardItemModels after a view is observing it. This works on older version of PyQt4 so this is a workaround until we have a better solution. The downside of this change is that we won't recognize when new files appear in the repository. The upside is that it avoids PyQt4 segfaults. Closes #25 Signed-off-by: David Aguilar --- cola/models/gitrepo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cola/models/gitrepo.py b/cola/models/gitrepo.py index 0f4ccc78..6bec328e 100644 --- a/cola/models/gitrepo.py +++ b/cola/models/gitrepo.py @@ -122,10 +122,9 @@ class GitRepoModel(QtGui.QStandardItemModel): """Observes model changes and updates paths accordingly.""" old_paths = self._interesting_paths new_paths = self._get_paths() - for path in new_paths - old_paths: - if path not in self._known_paths: - self.add_file(path, insert=True) for path in new_paths.union(old_paths): + if path not in self._known_paths: + continue self.entry(path).update() self._interesting_paths = new_paths -- 2.11.4.GIT