rpms/ibus/F-12 ibus-HEAD.patch,1.24,1.25 ibus.spec,1.101,1.102

Huang Peng phuang at fedoraproject.org
Thu Feb 4 06:59:17 UTC 2010


Author: phuang

Update of /cvs/pkgs/rpms/ibus/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9142

Modified Files:
	ibus-HEAD.patch ibus.spec 
Log Message:
Fix crash in IBusFactory

ibus-HEAD.patch:
 ibusfactory.c |   83 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 76 insertions(+), 7 deletions(-)

Index: ibus-HEAD.patch
===================================================================
RCS file: /cvs/pkgs/rpms/ibus/F-12/ibus-HEAD.patch,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- ibus-HEAD.patch	12 Aug 2009 01:54:42 -0000	1.24
+++ ibus-HEAD.patch	4 Feb 2010 06:59:16 -0000	1.25
@@ -1 +1,143 @@
+diff --git a/src/ibusfactory.c b/src/ibusfactory.c
+index 7b13276..214fb35 100644
+--- a/src/ibusfactory.c
++++ b/src/ibusfactory.c
+@@ -31,6 +31,11 @@ enum {
+     LAST_SIGNAL,
+ };
+ 
++enum {
++    PROP_0,
++    PROP_CONNECTION,
++};
++
+ /* IBusFactoryPriv */
+ struct _IBusFactoryPrivate {
+     guint id;
+@@ -44,6 +49,15 @@ typedef struct _IBusFactoryPrivate IBusFactoryPrivate;
+ static void     ibus_factory_class_init     (IBusFactoryClass   *klass);
+ static void     ibus_factory_init           (IBusFactory        *factory);
+ static void     ibus_factory_destroy        (IBusFactory        *factory);
++static void     ibus_factory_set_property   (IBusFactory        *engine,
++                                             guint               prop_id,
++                                             const GValue       *value,
++                                             GParamSpec         *pspec);
++static void     ibus_factory_get_property   (IBusFactory        *factory,
++                                             guint               prop_id,
++                                             GValue             *value,
++                                             GParamSpec         *pspec);
++
+ static gboolean ibus_factory_ibus_message   (IBusFactory        *factory,
+                                              IBusConnection     *connection,
+                                              IBusMessage        *message);
+@@ -100,29 +114,45 @@ ibus_factory_new (IBusConnection *connection)
+ 
+     factory = (IBusFactory *) g_object_new (IBUS_TYPE_FACTORY,
+                                             "path", IBUS_PATH_FACTORY,
++                                            "connection", connection,
+                                             NULL);
+     priv = IBUS_FACTORY_GET_PRIVATE (factory);
+ 
+-    priv->connection = g_object_ref (connection);
+-    ibus_service_add_to_connection ((IBusService *)factory, connection);
+-
+     return factory;
+ }
+ 
+ static void
+ ibus_factory_class_init (IBusFactoryClass *klass)
+ {
+-    // GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
++    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+     IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass);
+ 
+     factory_parent_class = (IBusServiceClass *) g_type_class_peek_parent (klass);
+ 
+     g_type_class_add_private (klass, sizeof (IBusFactoryPrivate));
+ 
++    gobject_class->set_property = (GObjectSetPropertyFunc) ibus_factory_set_property;
++    gobject_class->get_property = (GObjectGetPropertyFunc) ibus_factory_get_property;
++
++
+     ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_factory_destroy;
+ 
+     IBUS_SERVICE_CLASS (klass)->ibus_message = (ServiceIBusMessageFunc) ibus_factory_ibus_message;
+ 
++    /**
++     * IBusFactory:connection:
++     *
++     * Connection of this IBusFactory.
++     **/
++    g_object_class_install_property (gobject_class,
++                PROP_CONNECTION,
++                g_param_spec_object ("connection",
++                "connection",
++                "The connection of factory object",
++                IBUS_TYPE_CONNECTION,
++                G_PARAM_READWRITE |  G_PARAM_CONSTRUCT_ONLY));
++
++
+ }
+ 
+ static void
+@@ -158,15 +188,55 @@ ibus_factory_destroy (IBusFactory *factory)
+     }
+ 
+     if (priv->connection) {
+-        ibus_service_remove_from_connection ((IBusService *)factory,
+-                                             priv->connection);
+         g_object_unref (priv->connection);
++        priv->connection = NULL;
+     }
+ 
+     IBUS_OBJECT_CLASS(factory_parent_class)->destroy (IBUS_OBJECT (factory));
+ }
+ 
+ static void
++ibus_factory_set_property (IBusFactory  *factory,
++                           guint         prop_id,
++                           const GValue *value,
++                           GParamSpec   *pspec)
++{
++    IBusFactoryPrivate *priv;
++    priv = IBUS_FACTORY_GET_PRIVATE (factory);
++
++    switch (prop_id) {
++    case PROP_CONNECTION:
++        priv->connection = g_value_get_object (value);
++        g_object_ref (priv->connection);
++        ibus_service_add_to_connection ((IBusService *) factory,
++                                        priv->connection);
++        break;
++
++    default:
++        G_OBJECT_WARN_INVALID_PROPERTY_ID (factory, prop_id, pspec);
++    }
++}
++
++static void
++ibus_factory_get_property (IBusFactory *factory,
++                           guint        prop_id,
++                           GValue      *value,
++                           GParamSpec  *pspec)
++{
++    IBusFactoryPrivate *priv;
++    priv = IBUS_FACTORY_GET_PRIVATE (factory);
++
++    switch (prop_id) {
++    case PROP_CONNECTION:
++        g_value_set_object (value, priv->connection);
++        break;
++
++    default:
++        G_OBJECT_WARN_INVALID_PROPERTY_ID (factory, prop_id, pspec);
++    }
++}
++
++static void
+ _engine_destroy_cb (IBusEngine  *engine,
+                     IBusFactory *factory)
+ {
+-- 
+1.6.6
 


Index: ibus.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ibus/F-12/ibus.spec,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -p -r1.101 -r1.102
--- ibus.spec	11 Jan 2010 06:40:37 -0000	1.101
+++ ibus.spec	4 Feb 2010 06:59:17 -0000	1.102
@@ -8,14 +8,14 @@
 
 Name:       ibus
 Version:    1.2.0.20100111
-Release:    1%{?dist}
+Release:    2%{?dist}
 Summary:    Intelligent Input Bus for Linux OS
 License:    LGPLv2+
 Group:      System Environment/Libraries
 URL:        http://code.google.com/p/ibus/
 Source0:    http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
 Source1:    xinput-ibus
-# Patch0:     ibus-HEAD.patch
+Patch0:     ibus-HEAD.patch
 
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -103,7 +103,7 @@ The ibus-devel-docs package contains dev
 
 %prep
 %setup -q
-# %patch0 -p1
+%patch0 -p1
 
 %build
 %configure --disable-static \
@@ -217,6 +217,9 @@ fi
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Thu Feb 04 2010 Peng Huang <shawn.p.huang at gmail.com> - 1.2.0.20100111-2
+- Update ibus-HEAD.patch to avoid crash in IBusFactory
+
 * Mon Jan 11 2010 Peng Huang <shawn.p.huang at gmail.com> - 1.2.0.20100111-1
 - Update to 1.2.0.20100111
 



More information about the scm-commits mailing list