[meld: 54/63] filediff, meldbuffer: Get the encodings from the source file
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld: 54/63] filediff, meldbuffer: Get the encodings from the source file
- Date: Wed, 16 Dec 2015 21:23:31 +0000 (UTC)
commit a6ed5ccc2c063470c93c375b5834ea5ed8d7aa94
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Oct 11 07:54:09 2015 +1000
filediff, meldbuffer: Get the encodings from the source file
meld/filediff.py | 8 ++------
meld/meldbuffer.py | 1 -
2 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index ac89a22..8be01d8 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1074,13 +1074,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
'dialog-error-symbolic', primary, err.message)
buf = loader.get_buffer()
-
- if success:
- buf.data.encoding = loader.get_encoding()
-
start, end = buf.get_bounds()
buffer_text = buf.get_text(start, end, False)
- if not buf.data.encoding and '\\00' in buffer_text:
+ if not loader.get_encoding() and '\\00' in buffer_text:
primary = _("File %s appears to be a binary file.") % filename
secondary = _(
"Do you want to open the file using the default application?")
@@ -1482,7 +1478,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
start, end = buf.get_bounds()
text = text_type(buf.get_text(start, end, False), 'utf8')
- source_encoding = bufdata.encoding
+ source_encoding = bufdata.sourcefile.get_encoding()
while isinstance(text, unicode):
try:
encoding = source_encoding.get_charset()
diff --git a/meld/meldbuffer.py b/meld/meldbuffer.py
index a6b42fd..78e1a12 100644
--- a/meld/meldbuffer.py
+++ b/meld/meldbuffer.py
@@ -117,7 +117,6 @@ class MeldBufferData(GObject.GObject):
self.label = self._label if same_file else self.filename
self.loaded = False
self.savefile = None
- self.encoding = None
def __del__(self):
self._disconnect_monitor()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]