Fix build error and warnings in Fedora 18.
authorPeng Huang <shawn.p.huang@gmail.com>
Tue, 26 Mar 2013 10:54:43 +0000 (06:54 -0400)
committerPeng Huang <shawn.p.huang@gmail.com>
Tue, 26 Mar 2013 14:26:03 +0000 (10:26 -0400)
BUG=None
TEST=Manual

Review URL: https://codereview.appspot.com/7531047

bus/dbusimpl.c
bus/main.c
client/gtk2/ibusimcontext.c
configure.ac
ibus.spec.in

index 366a246..7b8294b 100644 (file)
@@ -61,10 +61,10 @@ struct _BusDBusImpl {
     /* a serial number used to generate a unique name of a bus. */
     guint id;
 
-    GMutex *dispatch_lock;
+    GMutex dispatch_lock;
     GList *dispatch_queue;
 
-    GMutex *forward_lock;
+    GMutex forward_lock;
     GList *forward_queue;
 
     /* a list of BusMethodCall to be used to reply when services are
@@ -582,8 +582,8 @@ bus_dbus_impl_init (BusDBusImpl *dbus)
                                          NULL,
                                          (GDestroyNotify) bus_name_service_free);
 
-    dbus->dispatch_lock = g_mutex_new ();
-    dbus->forward_lock = g_mutex_new ();
+    g_mutex_init (&dbus->dispatch_lock);
+    g_mutex_init (&dbus->forward_lock);
 
     /* other members are automatically zero-initialized. */
 }
@@ -633,6 +633,9 @@ bus_dbus_impl_destroy (BusDBusImpl *dbus)
                       (GDestroyNotify) bus_method_call_free);
     dbus->start_service_calls = NULL;
 
+    g_mutex_clear (&dbus->dispatch_lock);
+    g_mutex_clear (&dbus->forward_lock);
+
     /* FIXME destruct _lock and _queue members. */
     IBUS_OBJECT_CLASS(bus_dbus_impl_parent_class)->destroy ((IBusObject *) dbus);
 }
@@ -1711,11 +1714,11 @@ bus_dbus_impl_forward_message_idle_cb (BusDBusImpl   *dbus)
 {
     g_return_val_if_fail (dbus->forward_queue != NULL, FALSE);
 
-    g_mutex_lock (dbus->forward_lock);
+    g_mutex_lock (&dbus->forward_lock);
     BusForwardData *data = (BusForwardData *) dbus->forward_queue->data;
     dbus->forward_queue = g_list_delete_link (dbus->forward_queue, dbus->forward_queue);
     gboolean has_message = (dbus->forward_queue != NULL);
-    g_mutex_unlock (dbus->forward_lock);
+    g_mutex_unlock (&dbus->forward_lock);
 
     do {
         const gchar *destination = g_dbus_message_get_destination (data->message);
@@ -1782,10 +1785,10 @@ bus_dbus_impl_forward_message (BusDBusImpl   *dbus,
     data->message = g_object_ref (message);
     data->sender_connection = g_object_ref (connection);
 
-    g_mutex_lock (dbus->forward_lock);
+    g_mutex_lock (&dbus->forward_lock);
     gboolean is_running = (dbus->forward_queue != NULL);
     dbus->forward_queue = g_list_append (dbus->forward_queue, data);
-    g_mutex_unlock (dbus->forward_lock);
+    g_mutex_unlock (&dbus->forward_lock);
 
     if (!is_running) {
         g_idle_add_full (G_PRIORITY_DEFAULT,
@@ -1832,20 +1835,20 @@ bus_dbus_impl_dispatch_message_by_rule_idle_cb (BusDBusImpl *dbus)
 
     if (G_UNLIKELY (IBUS_OBJECT_DESTROYED (dbus))) {
         /* dbus was destryed */
-        g_mutex_lock (dbus->dispatch_lock);
+        g_mutex_lock (&dbus->dispatch_lock);
         g_list_free_full (dbus->dispatch_queue,
                           (GDestroyNotify) bus_dispatch_data_free);
         dbus->dispatch_queue = NULL;
-        g_mutex_unlock (dbus->dispatch_lock);
+        g_mutex_unlock (&dbus->dispatch_lock);
         return FALSE; /* return FALSE to prevent this callback to be called again. */
     }
 
     /* remove fist node */
-    g_mutex_lock (dbus->dispatch_lock);
+    g_mutex_lock (&dbus->dispatch_lock);
     BusDispatchData *data = (BusDispatchData *) dbus->dispatch_queue->data;
     dbus->dispatch_queue = g_list_delete_link (dbus->dispatch_queue, dbus->dispatch_queue);
     gboolean has_message = (dbus->dispatch_queue != NULL);
-    g_mutex_unlock (dbus->dispatch_lock);
+    g_mutex_unlock (&dbus->dispatch_lock);
 
     GList *link = NULL;
     GList *recipients = NULL;
@@ -1899,11 +1902,11 @@ bus_dbus_impl_dispatch_message_by_rule (BusDBusImpl     *dbus,
     g_object_set_qdata ((GObject *) message, dispatched_quark, GINT_TO_POINTER (1));
 
     /* append dispatch data into the queue, and start idle task if necessary */
-    g_mutex_lock (dbus->dispatch_lock);
+    g_mutex_lock (&dbus->dispatch_lock);
     gboolean is_running = (dbus->dispatch_queue != NULL);
     dbus->dispatch_queue = g_list_append (dbus->dispatch_queue,
                     bus_dispatch_data_new (message, skip_connection));
-    g_mutex_unlock (dbus->dispatch_lock);
+    g_mutex_unlock (&dbus->dispatch_lock);
     if (!is_running) {
         g_idle_add_full (G_PRIORITY_DEFAULT,
                          (GSourceFunc) bus_dbus_impl_dispatch_message_by_rule_idle_cb,
index 791a524..676988f 100644 (file)
@@ -214,9 +214,6 @@ main (gint argc, gchar **argv)
 
     ibus_init ();
 
-#ifdef G_THREADS_ENABLED
-    g_thread_init (NULL);
-#endif
     ibus_set_log_handler (g_verbose);
 
     /* check if ibus-daemon is running in this session */
index 94005b7..49598b4 100644 (file)
@@ -562,8 +562,12 @@ ibus_im_context_class_init (IBusIMContextClass *class)
 
 
     /* always install snooper */
-    if (_key_snooper_id == 0)
+    if (_key_snooper_id == 0) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
         _key_snooper_id = gtk_key_snooper_install (_key_snooper_cb, NULL);
+#pragma GCC diagnostic pop
+    }
 
     _daemon_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
                                               IBUS_SERVICE_IBUS,
@@ -579,7 +583,10 @@ ibus_im_context_class_fini (IBusIMContextClass *class)
 {
     if (_key_snooper_id != 0) {
         IDEBUG ("snooper is terminated.");
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
         gtk_key_snooper_remove (_key_snooper_id);
+#pragma GCC diagnostic pop
         _key_snooper_id = 0;
     }
 
@@ -1528,7 +1535,7 @@ _create_input_context_done (IBusBus       *bus,
 
         if (!g_queue_is_empty (ibusimcontext->events_queue)) {
             GdkEventKey *event;
-            while (event = g_queue_pop_head (ibusimcontext->events_queue)) {
+            while ((event = g_queue_pop_head (ibusimcontext->events_queue))) {
                 _process_key_event (context, event);
                 gdk_event_free ((GdkEvent *)event);
             }
index e48cc73..21c0d49 100644 (file)
@@ -51,7 +51,7 @@ m4_define([ibus_binary_version],
           [ibus_major_version.ibus_abi_current_minus_age.ibus_abi_age.ibus_abi_revision])
 
 # Required versions of other packages.
-m4_define([glib_required_version], [2.26.0])
+m4_define([glib_required_version], [2.32.0])
 
 
 # Init automake.
@@ -350,7 +350,7 @@ AM_PATH_PYTHON([2.5])
 PYGOBJECT_REQUIRED=3.0.0
 
 PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
-                 [enable_pygobject=yes],[enable_pygobject=no])
+                 [enable_pygobject=yes], [enable_pygobject=no])
 
 if test "x$enable_pygobject" = "xyes"; then
        PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
index aa36ea6..7989949 100644 (file)
@@ -257,7 +257,12 @@ dconf update &> /dev/null || :
 %{_bindir}/ibus
 %{_bindir}/ibus-daemon
 %{_bindir}/ibus-setup
-%{_datadir}/ibus/*
+%{_datadir}/ibus/component/gtkpanel.xml
+%{_datadir}/ibus/component/simple.xml
+%{_datadir}/ibus/keymaps/*
+%{_datadir}/ibus/setup/*
+
+
 %{_datadir}/applications/*
 %{_datadir}/icons/hicolor/*/apps/*
 %if %{build_python_library}
@@ -267,7 +272,7 @@ dconf update &> /dev/null || :
 %{_libexecdir}/ibus-x11
 %{_libexecdir}/ibus-engine-simple
 # %{_sysconfdir}/xdg/autostart/ibus.desktop
-%{_sysconfdir}/bash_completion.d/ibus.bash
+%{_datadir}/bash-completion/completions/ibus.bash
 %config %{_xinputconf}
 
 %files libs
@@ -277,11 +282,13 @@ dconf update &> /dev/null || :
 
 %files gconf
 %defattr(-,root,root,-)
+%{_datadir}/ibus/component/gconf.xml
 %{_libexecdir}/ibus-gconf
 %{_sysconfdir}/gconf/schemas/ibus.schemas
 
 %files dconf
 %defattr(-,root,root,-)
+%{_datadir}/ibus/component/dconf.xml
 %{_libexecdir}/ibus-dconf
 %{_sysconfdir}/dconf/db/ibus.d
 %{_sysconfdir}/dconf/profile/ibus