Updated ibus-HEAD.patch for dconf 0.13.4
This commit is contained in:
parent
db31e52830
commit
2e84674b35
264
ibus-HEAD.patch
264
ibus-HEAD.patch
@ -273,6 +273,270 @@ index fc3c11b..9118020 100644
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
From a454448111650c3e92fc9ba65c26a57adc9c3c6c Mon Sep 17 00:00:00 2001
|
||||
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||
Date: Thu, 19 Jul 2012 09:57:01 +0900
|
||||
Subject: [PATCH] Support dconf 0.13.4
|
||||
|
||||
TEST=Manually
|
||||
|
||||
Review URL: https://codereview.appspot.com/6426044
|
||||
---
|
||||
conf/dconf/Makefile.am | 2 +-
|
||||
conf/dconf/config-private.h | 56 +++++++++++++++++++++++++++++++++++++++++++
|
||||
conf/dconf/config.c | 26 +++++++++++++++++++-
|
||||
conf/dconf/config.h | 47 ------------------------------------
|
||||
conf/dconf/main.c | 2 +-
|
||||
configure.ac | 3 +++
|
||||
6 files changed, 86 insertions(+), 50 deletions(-)
|
||||
create mode 100644 conf/dconf/config-private.h
|
||||
delete mode 100644 conf/dconf/config.h
|
||||
|
||||
diff --git a/conf/dconf/Makefile.am b/conf/dconf/Makefile.am
|
||||
index 148ba62..f0e24b0 100644
|
||||
--- a/conf/dconf/Makefile.am
|
||||
+++ b/conf/dconf/Makefile.am
|
||||
@@ -29,7 +29,7 @@ libexec_PROGRAMS = \
|
||||
ibus_dconf_SOURCES = \
|
||||
main.c \
|
||||
config.c \
|
||||
- config.h \
|
||||
+ config-private.h \
|
||||
$(NULL)
|
||||
ibus_dconf_CFLAGS = \
|
||||
@GLIB2_CFLAGS@ \
|
||||
diff --git a/conf/dconf/config-private.h b/conf/dconf/config-private.h
|
||||
new file mode 100644
|
||||
index 0000000..9ba4fd5
|
||||
--- /dev/null
|
||||
+++ b/conf/dconf/config-private.h
|
||||
@@ -0,0 +1,56 @@
|
||||
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
||||
+/* vim:set et sts=4: */
|
||||
+/* ibus - The Input Bus
|
||||
+ * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
|
||||
+ * Copyright (C) 2008-2010 Red Hat, Inc.
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the
|
||||
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
+ * Boston, MA 02111-1307, USA.
|
||||
+ */
|
||||
+#ifndef __CONFIG_DCONF_H__
|
||||
+#define __CONFIG_DCONF_H__
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <ibus.h>
|
||||
+#ifdef DCONF_0_13_4
|
||||
+# include <client/dconf-client.h>
|
||||
+# include <common/dconf-paths.h>
|
||||
+#else
|
||||
+# include <dconf/dconf.h>
|
||||
+#endif
|
||||
+
|
||||
+#define IBUS_TYPE_CONFIG_DCONF \
|
||||
+ (ibus_config_dconf_get_type ())
|
||||
+#define IBUS_CONFIG_DCONF(obj) \
|
||||
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_CONFIG_DCONF, IBusConfigDConf))
|
||||
+#define IBUS_CONFIG_DCONF_CLASS(klass) \
|
||||
+ (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_CONFIG_DCONF, IBusConfigDConfClass))
|
||||
+#define IBUS_IS_CONFIG_DCONF(obj) \
|
||||
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_CONFIG_DCONF))
|
||||
+#define IBUS_IS_CONFIG_DCONF_CLASS(klass) \
|
||||
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_CONFIG_DCONF))
|
||||
+#define IBUS_CONFIG_DCONF_GET_CLASS(obj) \
|
||||
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_CONFIG_DCONF, IBusConfigDConfClass))
|
||||
+
|
||||
+typedef struct _IBusConfigDConf IBusConfigDConf;
|
||||
+typedef struct _IBusConfigDConfClass IBusConfigDConfClass;
|
||||
+
|
||||
+GType ibus_config_dconf_get_type (void);
|
||||
+IBusConfigDConf *ibus_config_dconf_new (GDBusConnection *connection);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/conf/dconf/config.c b/conf/dconf/config.c
|
||||
index faca932..44d7031 100644
|
||||
--- a/conf/dconf/config.c
|
||||
+++ b/conf/dconf/config.c
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <ibus.h>
|
||||
-#include "config.h"
|
||||
+#include "config-private.h"
|
||||
|
||||
#define DCONF_PREFIX "/desktop/ibus"
|
||||
#define DCONF_PRESERVE_NAME_PREFIXES_KEY \
|
||||
@@ -159,12 +159,19 @@ static void
|
||||
_watch_func (DConfClient *client,
|
||||
const gchar *gpath,
|
||||
const gchar * const *items,
|
||||
+#ifndef DCONF_0_13_4
|
||||
gint n_items,
|
||||
+#endif
|
||||
const gchar *tag,
|
||||
IBusConfigDConf *config)
|
||||
{
|
||||
gchar **gkeys = NULL;
|
||||
gint i;
|
||||
+#ifdef DCONF_0_13_4
|
||||
+ gint n_items;
|
||||
+
|
||||
+ n_items = g_strv_length ((gchar **)items);
|
||||
+#endif
|
||||
|
||||
g_return_if_fail (gpath != NULL);
|
||||
g_return_if_fail (n_items >= 0);
|
||||
@@ -231,6 +238,14 @@ static void
|
||||
ibus_config_dconf_init (IBusConfigDConf *config)
|
||||
{
|
||||
GVariant *variant;
|
||||
+#ifdef DCONF_0_13_4
|
||||
+ config->client = dconf_client_new ();
|
||||
+
|
||||
+ g_signal_connect (config->client, "changed",
|
||||
+ G_CALLBACK (_watch_func), config);
|
||||
+
|
||||
+ dconf_client_watch_fast (config->client, DCONF_PREFIX"/");
|
||||
+#else
|
||||
GError *error;
|
||||
|
||||
config->client = dconf_client_new ("ibus",
|
||||
@@ -241,6 +256,7 @@ ibus_config_dconf_init (IBusConfigDConf *config)
|
||||
error = NULL;
|
||||
if (!dconf_client_watch (config->client, DCONF_PREFIX"/", NULL, &error))
|
||||
g_warning ("Can not watch dconf path %s", DCONF_PREFIX"/");
|
||||
+#endif
|
||||
|
||||
config->preserve_name_prefixes = NULL;
|
||||
variant = dconf_client_read (config->client,
|
||||
@@ -265,9 +281,13 @@ static void
|
||||
ibus_config_dconf_destroy (IBusConfigDConf *config)
|
||||
{
|
||||
if (config->client) {
|
||||
+#ifdef DCONF_0_13_4
|
||||
+ dconf_client_unwatch_fast (config->client, DCONF_PREFIX"/");
|
||||
+#else
|
||||
GError *error = NULL;
|
||||
if (!dconf_client_unwatch (config->client, DCONF_PREFIX"/", NULL, &error))
|
||||
g_warning ("Can not unwatch dconf path %s", DCONF_PREFIX"/");
|
||||
+#endif
|
||||
|
||||
g_object_unref (config->client);
|
||||
config->client = NULL;
|
||||
@@ -307,12 +327,16 @@ ibus_config_dconf_set_value (IBusConfigService *config,
|
||||
g_free (gname);
|
||||
}
|
||||
|
||||
+#ifdef DCONF_0_13_4
|
||||
+ retval = dconf_client_write_fast (client, gkey, value, error);
|
||||
+#else
|
||||
retval = dconf_client_write (client,
|
||||
gkey,
|
||||
value,
|
||||
NULL, /* tag */
|
||||
NULL, /* cancellable */
|
||||
error);
|
||||
+#endif
|
||||
g_free (gkey);
|
||||
|
||||
return retval;
|
||||
diff --git a/conf/dconf/config.h b/conf/dconf/config.h
|
||||
deleted file mode 100644
|
||||
index 9f602d6..0000000
|
||||
--- a/conf/dconf/config.h
|
||||
+++ /dev/null
|
||||
@@ -1,47 +0,0 @@
|
||||
-/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
||||
-/* vim:set et sts=4: */
|
||||
-/* ibus - The Input Bus
|
||||
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
|
||||
- * Copyright (C) 2008-2010 Red Hat, Inc.
|
||||
- *
|
||||
- * This library is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU Lesser General Public
|
||||
- * License as published by the Free Software Foundation; either
|
||||
- * version 2 of the License, or (at your option) any later version.
|
||||
- *
|
||||
- * This library is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
- * Lesser General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU Lesser General Public
|
||||
- * License along with this library; if not, write to the
|
||||
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
- * Boston, MA 02111-1307, USA.
|
||||
- */
|
||||
-#ifndef __CONFIG_DCONF_H__
|
||||
-#define __CONFIG_DCONF_H__
|
||||
-
|
||||
-#include <ibus.h>
|
||||
-#include <dconf/dconf.h>
|
||||
-
|
||||
-#define IBUS_TYPE_CONFIG_DCONF \
|
||||
- (ibus_config_dconf_get_type ())
|
||||
-#define IBUS_CONFIG_DCONF(obj) \
|
||||
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_CONFIG_DCONF, IBusConfigDConf))
|
||||
-#define IBUS_CONFIG_DCONF_CLASS(klass) \
|
||||
- (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_CONFIG_DCONF, IBusConfigDConfClass))
|
||||
-#define IBUS_IS_CONFIG_DCONF(obj) \
|
||||
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_CONFIG_DCONF))
|
||||
-#define IBUS_IS_CONFIG_DCONF_CLASS(klass) \
|
||||
- (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_CONFIG_DCONF))
|
||||
-#define IBUS_CONFIG_DCONF_GET_CLASS(obj) \
|
||||
- (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_CONFIG_DCONF, IBusConfigDConfClass))
|
||||
-
|
||||
-typedef struct _IBusConfigDConf IBusConfigDConf;
|
||||
-typedef struct _IBusConfigDConfClass IBusConfigDConfClass;
|
||||
-
|
||||
-GType ibus_config_dconf_get_type (void);
|
||||
-IBusConfigDConf *ibus_config_dconf_new (GDBusConnection *connection);
|
||||
-
|
||||
-#endif
|
||||
diff --git a/conf/dconf/main.c b/conf/dconf/main.c
|
||||
index 1b69baa..bffe983 100644
|
||||
--- a/conf/dconf/main.c
|
||||
+++ b/conf/dconf/main.c
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ibus.h>
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
-#include "config.h"
|
||||
+#include "config-private.h"
|
||||
|
||||
static IBusBus *bus = NULL;
|
||||
static IBusConfigDConf *config = NULL;
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 8498efe..cc7d0e0 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -327,6 +327,9 @@ if test x"$enable_dconf" = x"yes"; then
|
||||
[dconf >= 0.7.5], ,
|
||||
enable_dconf=no
|
||||
)
|
||||
+ PKG_CHECK_EXISTS([dconf >= 0.13.4],
|
||||
+ [AC_DEFINE(DCONF_0_13_4, TRUE, [dconf is 0.13.4 or later])],
|
||||
+ [])
|
||||
# check glib-compile-schemas
|
||||
GLIB_GSETTINGS
|
||||
fi
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
From 52fbf82dd1babc0d8de7be0f5bb6de622c069b4d Mon Sep 17 00:00:00 2001
|
||||
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||
Date: Tue, 12 Jun 2012 11:53:29 +0900
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
Name: ibus
|
||||
Version: 1.4.99.20120712
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Intelligent Input Bus for Linux OS
|
||||
License: LGPLv2+
|
||||
Group: System Environment/Libraries
|
||||
@ -473,6 +473,10 @@ dconf update
|
||||
%{_datadir}/gtk-doc/html/*
|
||||
|
||||
%changelog
|
||||
* Thu Jul 19 2012 Takao Fujiwara <tfujiwar@redhat.com> - 1.4.99.20120712-2
|
||||
- Updated ibus-HEAD.patch
|
||||
Support dconf 0.13.4
|
||||
|
||||
* Tue Jul 17 2012 Takao Fujiwara <tfujiwar@redhat.com> - 1.4.99.20120712-1
|
||||
- Bumped to 1.4.99.20120712
|
||||
- Removed ibus-xx-branding-switcher-ui.patch as upstreamed.
|
||||
|
Loading…
Reference in New Issue
Block a user