[meld] newdifftab: Avoid decoding paths for VcView; it wants bytes



commit 07dfe6d93d848be2ff0a64d102ba0979b073c86f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jun 21 08:35:42 2015 +1000

    newdifftab: Avoid decoding paths for VcView; it wants bytes
    
    Eventually, the other methods should also want bytes or GFiles, but
    for now we just need to make sure that VcView gets them.

 meld/newdifftab.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/meld/newdifftab.py b/meld/newdifftab.py
index d16d205..978923b 100644
--- a/meld/newdifftab.py
+++ b/meld/newdifftab.py
@@ -106,9 +106,14 @@ class NewDiffTab(GObject.GObject, gnomeglade.Component):
         for chooser in type_choosers[self.diff_type][:num_paths]:
             gfile = chooser.get_file()
             path = gfile.get_path() if gfile else ""
-            path = path.decode('utf8')
             compare_paths.append(path)
 
+        # TODO: We should be migrating to passing around either GFiles
+        # or raw (i.e., not decoded) paths. Currently VcView is the
+        # only thing that expects this.
+        if self.diff_type in (0, 1):
+            compare_paths = [p.decode('utf8') for p in compare_paths]
+
         tab = self.diff_methods[self.diff_type](compare_paths)
         recent_comparisons.add(tab)
         self.emit('diff-created', tab)


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