[meld/meld-3-20] dirdiff: Fix folder comparison display with >2G files



commit cf57d2ddc42c73e9af846452a1e101952ebddf0e
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 9ee22b85..ae33ed23 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -243,7 +243,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 = {
@@ -1427,9 +1428,12 @@ class DirDiff(MeldDoc, Component):
                     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]