Ticket #4307: 0001-get_mime_description-use-Gio-from-dynamic-bindings-S.patch

File 0001-get_mime_description-use-Gio-from-dynamic-bindings-S.patch, 1.2 KB (added by manuq, 11 years ago)

Patch for the crash, was because we were mixing static and dynamic bindings, calling 'import gio' in the toolkit.

  • src/sugar3/mime.py

    From 1af80acd589d0eca61810dff19b08000e8fc3cc5 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Tue, 18 Dec 2012 13:04:40 -0300
    Subject: [PATCH toolkit] get_mime_description, use Gio from dynamic bindings
     - SL #4323 #4307
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    'import gio' was importing static gobject, and mixing static and
    dynamic bindings provoked a crash.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/sugar3/mime.py | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/sugar3/mime.py b/src/sugar3/mime.py
    index 70b4d2b..be9b5eb 100644
    a b import logging 
    2626import gettext
    2727
    2828from gi.repository import GdkPixbuf
     29from gi.repository import Gio
    2930
    3031from sugar3 import _sugarbaseext
    3132
    def get_mime_description(mime_type): 
    149150    if generic_type:
    150151        return generic_type['name']
    151152
    152     import gio
    153     return gio.content_type_get_description(mime_type)
     153    return Gio.content_type_get_description(mime_type)
    154154
    155155
    156156def get_mime_parents(mime_type):