[Sugar-devel] [PATCH shell 2/2] Journal details view, fix get_text method in text buffers - SL #3920

Manuel Quiñones manuq at laptop.org
Fri Sep 21 01:38:08 EDT 2012


Gtk.TextBuffer.get_text() needs new parameter include_hidden_chars,
setting it to False the given text excludes undisplayed text (text
marked with tags that set the invisibility attribute) [1]

[1] http://developer.gnome.org/gtk/2.24/GtkTextBuffer.html#gtk-text-buffer-get-text

Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 src/jarabe/journal/expandedentry.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py
index 21a3c5f..8144980 100644
--- a/src/jarabe/journal/expandedentry.py
+++ b/src/jarabe/journal/expandedentry.py
@@ -380,7 +380,8 @@ class ExpandedEntry(Gtk.EventBox):
 
         bounds = self._tags.get_buffer().get_bounds()
         old_tags = self._metadata.get('tags', None)
-        new_tags = self._tags.get_buffer().get_text(bounds[0], bounds[1])
+        new_tags = self._tags.get_buffer().get_text(bounds[0], bounds[1],
+                                                    include_hidden_chars=False)
 
         if old_tags != new_tags:
             self._metadata['tags'] = new_tags
@@ -389,7 +390,7 @@ class ExpandedEntry(Gtk.EventBox):
         bounds = self._description.get_buffer().get_bounds()
         old_description = self._metadata.get('description', None)
         new_description = self._description.get_buffer().get_text(
-            bounds[0], bounds[1])
+            bounds[0], bounds[1], include_hidden_chars=False)
         if old_description != new_description:
             self._metadata['description'] = new_description
             needs_update = True
-- 
1.7.11.4



More information about the Sugar-devel mailing list