Hello community, here is the log from the commit of package ibus-pinyin for openSUSE:Factory checked in at Thu Oct 13 19:41:51 CEST 2011. -------- --- openSUSE:Factory/ibus-pinyin/ibus-pinyin.changes 2011-09-23 02:03:07.000000000 +0200 +++ /mounts/work_src_done/STABLE/ibus-pinyin/ibus-pinyin.changes 2011-10-12 14:29:45.000000000 +0200 @@ -1,0 +2,5 @@ +Wed Oct 12 12:38:49 CEST 2011 - tiwai@suse.de + +- Fix build with ibus-1.4 (bnc#723591) + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- ibus-pinyin-ibus-1.4-build.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ibus-pinyin.spec ++++++ --- /var/tmp/diff_new_pack.rTiFQa/_old 2011-10-13 19:41:47.000000000 +0200 +++ /var/tmp/diff_new_pack.rTiFQa/_new 2011-10-13 19:41:47.000000000 +0200 @@ -27,6 +27,7 @@ Url: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz Source1: http://scim-python.googlecode.com/files/pinyin-database-1.2.99.tar.bz2 +Patch: ibus-pinyin-ibus-1.4-build.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -44,6 +45,7 @@ %prep %setup -q +%patch -p1 cp %{SOURCE1} data/db/open-phrase %build ++++++ ibus-pinyin-ibus-1.4-build.diff ++++++ --- src/PYConfig.cc | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/PYConfig.h | 16 ++++++++--- 2 files changed, 85 insertions(+), 8 deletions(-) --- a/src/PYConfig.cc +++ b/src/PYConfig.cc @@ -153,6 +153,18 @@ Config::read (const gchar * name, bool defval) { +#if IBUS_CHECK_VERSION(1,3,99) + GVariant *value = NULL; + value = ibus_config_get_value (get<IBusConfig> (), m_section.c_str (), name); + if (value) { + if (g_variant_classify (value) == G_VARIANT_CLASS_BOOLEAN) + return g_variant_get_boolean (value); + } + + // write default value to config + value = g_variant_new ("b", defval); + ibus_config_set_value (get<IBusConfig> (), m_section.c_str (), name, value); +#else GValue value = {0}; if (ibus_config_get_value (get<IBusConfig> (), m_section.c_str (), name, &value)) { if (G_VALUE_TYPE (&value) == G_TYPE_BOOLEAN) @@ -163,6 +175,7 @@ g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, defval); ibus_config_set_value (get<IBusConfig> (), m_section.c_str (), name, &value); +#endif return defval; } @@ -171,6 +184,18 @@ Config::read (const gchar * name, gint defval) { +#if IBUS_CHECK_VERSION(1,3,99) + GVariant *value = NULL; + value = ibus_config_get_value (get<IBusConfig> (), m_section.c_str (), name); + if (value) { + if (g_variant_classify (value) == G_VARIANT_CLASS_INT32) + return g_variant_get_int32 (value); + } + + // write default value to config + value = g_variant_new ("i", defval); + ibus_config_set_value (get<IBusConfig> (), m_section.c_str (), name, value); +#else GValue value = {0}; if (ibus_config_get_value (get<IBusConfig> (), m_section.c_str (), name, &value)) { if (G_VALUE_TYPE (&value) == G_TYPE_INT) @@ -181,6 +206,7 @@ g_value_init (&value, G_TYPE_INT); g_value_set_int (&value, defval); ibus_config_set_value (get<IBusConfig> (), m_section.c_str (), name, &value); +#endif return defval; } @@ -189,6 +215,18 @@ Config::read (const gchar * name, const gchar * defval) { +#if IBUS_CHECK_VERSION(1,3,99) + GVariant *value = NULL; + value = ibus_config_get_value (get<IBusConfig> (), m_section.c_str (), name); + if (value) { + if (g_variant_classify (value) == G_VARIANT_CLASS_STRING) + return g_variant_get_string (value, NULL); + } + + // write default value to config + value = g_variant_new ("s", defval); + ibus_config_set_value (get<IBusConfig> (), m_section.c_str (), name, value); +#else GValue value = {0}; if (ibus_config_get_value (get<IBusConfig> (), m_section.c_str (), name, &value)) { if (G_VALUE_TYPE (&value) == G_TYPE_STRING) @@ -199,10 +237,20 @@ g_value_init (&value, G_TYPE_STRING); g_value_set_static_string (&value, defval); ibus_config_set_value (get<IBusConfig> (), m_section.c_str (), name, &value); +#endif return defval; } +#if IBUS_CHECK_VERSION(1,3,99) +static inline bool +normalizeGValue (GVariant *value, bool defval) +{ + if (value == NULL || g_variant_classify (value) != G_VARIANT_CLASS_BOOLEAN) + return defval; + return g_variant_get_boolean (value); +} +#else static inline bool normalizeGValue (const GValue *value, bool defval) { @@ -210,7 +258,17 @@ return defval; return g_value_get_boolean (value); } +#endif +#if IBUS_CHECK_VERSION(1,3,99) +static inline gint +normalizeGValue (GVariant *value, gint defval) +{ + if (value == NULL || g_variant_classify (value) != G_VARIANT_CLASS_INT32) + return defval; + return g_variant_get_int32 (value); +} +#else static inline gint normalizeGValue (const GValue *value, gint defval) { @@ -218,7 +276,17 @@ return defval; return g_value_get_int (value); } +#endif +#if IBUS_CHECK_VERSION(1,3,99) +static inline const gchar * +normalizeGValue (GVariant *value, const gchar * defval) +{ + if (value == NULL || g_variant_classify (value) != G_VARIANT_CLASS_STRING) + return defval; + return g_variant_get_string (value, NULL); +} +#else static inline const gchar * normalizeGValue (const GValue *value, const gchar * defval) { @@ -226,11 +294,12 @@ return defval; return g_value_get_string (value); } +#endif gboolean Config::valueChanged (const std::string & section, const std::string & name, - const GValue *value) + ibus_valref_t value) { if (m_section != section) return FALSE; @@ -278,7 +347,7 @@ Config::valueChangedCallback (IBusConfig *config, const gchar *section, const gchar *name, - const GValue *value, + ibus_valref_t value, Config *self) { self->valueChanged (section, name, value); @@ -363,7 +432,7 @@ gboolean PinyinConfig::valueChanged (const std::string & section, const std::string & name, - const GValue *value) + ibus_valref_t value) { if (m_section != section) return FALSE; @@ -465,7 +534,7 @@ gboolean BopomofoConfig::valueChanged (const std::string & section, const std::string & name, - const GValue *value) + ibus_valref_t value) { if (m_section != section) return FALSE; --- a/src/PYConfig.h +++ b/src/PYConfig.h @@ -26,6 +26,14 @@ #include <ibus.h> #include "PYObject.h" +#if IBUS_CHECK_VERSION(1,3,99) +typedef GVariant *ibus_valref_t; +typedef GVariant ibus_val_t; +#else +typedef const GValue *ibus_valref_t; +typedef GValue ibus_val_t; +#endif + namespace PY { class Bus; @@ -66,12 +74,12 @@ virtual gboolean valueChanged (const std::string & section, const std::string & name, - const GValue *value); + ibus_valref_t value); private: static void valueChangedCallback (IBusConfig *config, const gchar *section, const gchar *name, - const GValue *value, + ibus_valref_t value, Config *self); protected: @@ -115,7 +123,7 @@ virtual gboolean valueChanged (const std::string & section, const std::string & name, - const GValue *value); + ibus_valref_t value); private: static boost::scoped_ptr<PinyinConfig> m_instance; @@ -133,7 +141,7 @@ virtual gboolean valueChanged (const std::string & section, const std::string & name, - const GValue *value); + ibus_valref_t value); private: static boost::scoped_ptr<BopomofoConfig> m_instance; continue with "q"... Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org