[meld] Don't insert integers into string TreeStore column (closes bgo#639917)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Don't insert integers into string TreeStore column (closes bgo#639917)
- Date: Sat, 5 Feb 2011 22:27:22 +0000 (UTC)
commit 9d5cc7605b42e49f78a6730516e65a8353bf0a28
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Jan 30 11:04:06 2011 +1000
Don't insert integers into string TreeStore column (closes bgo#639917)
Based on a patch from Iain Buclaw.
meld/dirdiff.py | 4 ++--
meld/tree.py | 9 +++++----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 6c063ab..9f182a9 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -580,8 +580,8 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
fname = self.model.value_path( self.model.get_iter(paths[0]), pane )
try:
stat = os.stat(fname)
- except OSError:
- self.emit("status-changed", "" )
+ except (OSError, TypeError):
+ self.emit("status-changed", "")
else:
self.emit("status-changed", "%s : %s" % (rwx(stat.st_mode), nice(time.time() - stat.st_mtime) ) )
diff --git a/meld/tree.py b/meld/tree.py
index 430fbb3..a052452 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -90,15 +90,16 @@ class DiffTreeStore(gtk.TreeStore):
def add_empty(self, parent, text="empty folder"):
child = self.append(parent)
for i in range(self.ntree):
- self.set_value(child, self.column_index(COL_STATE,i), STATE_EMPTY)
- self.set_value(child, self.column_index(COL_PATH,i), self.pixstyle[STATE_EMPTY])
+ self.set_value(child, self.column_index(COL_PATH, i), None)
+ self.set_value(child, self.column_index(COL_STATE, i), str(STATE_EMPTY))
+ self.set_value(child, self.column_index(COL_ICON, i), self.pixstyle[STATE_EMPTY][0])
self.set_value(child, self.column_index(COL_TEXT, i), self.textstyle[STATE_EMPTY] % gobject.markup_escape_text(text))
return child
def add_error(self, parent, msg, pane):
err = self.append(parent)
for i in range(self.ntree):
- self.set_value(err, self.column_index(COL_STATE,i), STATE_ERROR)
+ self.set_value(err, self.column_index(COL_STATE, i), str(STATE_ERROR))
self.set_value(err, self.column_index(COL_ICON, pane), self.pixstyle[STATE_ERROR][0] )
self.set_value(err, self.column_index(COL_TINT, pane),
self.icon_tints[STATE_ERROR][0])
@@ -118,7 +119,7 @@ class DiffTreeStore(gtk.TreeStore):
TEXT = self.column_index(COL_TEXT, pane)
ICON = self.column_index(COL_ICON, pane)
TINT = self.column_index(COL_TINT, pane)
- self.set_value(it, STATE, state)
+ self.set_value(it, STATE, str(state))
self.set_value(it, TEXT, self.textstyle[state] % name)
self.set_value(it, ICON, self.pixstyle[state][isdir])
self.set_value(it, TINT, self.icon_tints[state][isdir])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]