[meld] dirdiff: Fix folder comparison display with >2G files



commit d6d1297f872a875501e221f5ca251ab1dbb6ec52
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Jan 19 10:21:10 2019 +1000

    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.

 meld/dirdiff.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index e04d0408..5b95bda2 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -244,7 +244,8 @@ COL_EMBLEM, COL_EMBLEM_SECONDARY, COL_SIZE, COL_TIME, COL_PERMS, COL_END = \
 
 class DirDiffTreeStore(tree.DiffTreeStore):
     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):
         defaults = {
@@ -1512,9 +1513,12 @@ class DirDiff(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
                     COL_EMBLEM: emblem,
                     COL_EMBLEM_SECONDARY: link_emblem,
                     COL_TIME: times[j],
-                    COL_SIZE: sizes[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:
                 self.model.set_path_state(
                     it, j, tree.STATE_NONEXIST, any(isdir))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]