Commit d6d1297f authored by Kai Willadsen's avatar Kai Willadsen

dirdiff: Fix folder comparison display with >2G files

This was broken with the unsafe_set speed ups. Because the "unsafe" bit
here is the part that avoids the GObject.Value boxing, Python integers
end up getting mapped to int, which then breaks with large values.
parent 472d099a
...@@ -244,7 +244,8 @@ COL_EMBLEM, COL_EMBLEM_SECONDARY, COL_SIZE, COL_TIME, COL_PERMS, COL_END = \ ...@@ -244,7 +244,8 @@ COL_EMBLEM, COL_EMBLEM_SECONDARY, COL_SIZE, COL_TIME, COL_PERMS, COL_END = \
class DirDiffTreeStore(tree.DiffTreeStore): class DirDiffTreeStore(tree.DiffTreeStore):
def __init__(self, ntree): def __init__(self, ntree):
super().__init__(ntree, [str, str, int, float, int]) # FIXME: size should be a GObject.TYPE_UINT64, but we use -1 as a flag
super().__init__(ntree, [str, str, GObject.TYPE_INT64, float, int])
def add_error(self, parent, msg, pane): def add_error(self, parent, msg, pane):
defaults = { defaults = {
...@@ -1512,9 +1513,12 @@ class DirDiff(Gtk.VBox, tree.TreeviewCommon, MeldDoc): ...@@ -1512,9 +1513,12 @@ class DirDiff(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
COL_EMBLEM: emblem, COL_EMBLEM: emblem,
COL_EMBLEM_SECONDARY: link_emblem, COL_EMBLEM_SECONDARY: link_emblem,
COL_TIME: times[j], COL_TIME: times[j],
COL_SIZE: sizes[j],
COL_PERMS: perms[j] COL_PERMS: perms[j]
}) })
# Size is handled independently, because unsafe_set
# can't correctly box GObject.TYPE_INT64.
self.model.set(
it, self.model.column_index(COL_SIZE, j), sizes[j])
else: else:
self.model.set_path_state( self.model.set_path_state(
it, j, tree.STATE_NONEXIST, any(isdir)) it, j, tree.STATE_NONEXIST, any(isdir))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment