[gedit-plugins] charmap: bug fix



commit 5330bea689be4705fb753e621062706721792b85
Author: Jordi Mas <jmas softcatala org>
Date:   Sat Feb 20 18:18:51 2021 +0100

    charmap: bug fix
    
    Use only methods that can be called using GI.
    
    The traceback in the terminal was:
    ```
    Traceback (most recent call last):
      File "[...]/gedit/plugins/charmap/panel.py", line 61, in on_chapter_view_selection_changed
        codepoint_list = self.view.get_codepoint_list()
    AttributeError: 'ChaptersView' object has no attribute 'get_codepoint_list'
    ```
    
    Fixes https://gitlab.gnome.org/GNOME/gedit-plugins/-/issues/41

 plugins/charmap/charmap/__init__.py | 12 ------------
 plugins/charmap/charmap/panel.py    |  4 +++-
 2 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/plugins/charmap/charmap/__init__.py b/plugins/charmap/charmap/__init__.py
index 60dd5d1..d25ece5 100644
--- a/plugins/charmap/charmap/__init__.py
+++ b/plugins/charmap/charmap/__init__.py
@@ -98,18 +98,6 @@ class CharmapPlugin(GObject.Object, Gedit.WindowActivatable):
         uc = chartable.get_active_character()
         text = "%s %s" % (uc, Gucharmap.get_unicode_name(uc))
 
-        a = Gucharmap.get_nameslist_equals(uc)
-        if a:
-            text += "   = %s" % a[0]
-            for i in range(len (a) - 1):
-                text += "; %s" % a[i + 1]
-
-        a = Gucharmap.get_nameslist_stars(uc)
-        if a:
-            text += "   \342\200\242 %s" % a[0]
-            for i in range(len (a) - 1):
-                text += "; %s" % a[i + 1]
-
         self.on_table_status_message(chartable, text)
 
     def on_table_focus_out_event(self, chartable, event):
diff --git a/plugins/charmap/charmap/panel.py b/plugins/charmap/charmap/panel.py
index 351cf30..4a6c700 100644
--- a/plugins/charmap/charmap/panel.py
+++ b/plugins/charmap/charmap/panel.py
@@ -58,7 +58,9 @@ class CharmapPanel(Gtk.Box):
     def on_chapter_view_selection_changed(self, selection):
         model, it = selection.get_selected()
         if it:
-            codepoint_list = self.view.get_codepoint_list()
+            script_name = self.view.get_selected()
+            codepoint_list = Gucharmap.ScriptCodepointList()
+            codepoint_list.append_script(script_name)
             self.chartable.set_codepoint_list(codepoint_list)
 
     def get_chartable(self):


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