From 01b288672ddfefa668a8666521c1486082b7e40d Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Mon, 15 Nov 2010 14:06:04 +0900 Subject: [PATCH] Fixed Bug 652881 - SEGV when key tables are customized in new gconf. --- ibus-anthy-HEAD.patch | 78 +++++++++++++++++++++++++++++++++++++++++++ ibus-anthy.spec | 12 ++++--- 2 files changed, 86 insertions(+), 4 deletions(-) diff --git a/ibus-anthy-HEAD.patch b/ibus-anthy-HEAD.patch index 8b13789..3cd25bc 100644 --- a/ibus-anthy-HEAD.patch +++ b/ibus-anthy-HEAD.patch @@ -1 +1,79 @@ +From aaa2f6ad0ff5da7915b33b5d30ded25def187e7c Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Mon, 15 Nov 2010 13:25:11 +0900 +Subject: [PATCH] Fixed SEGV when key tables are customized in new gconf. + +--- + setup/main.py | 18 ------------------ + setup/prefs.py | 4 ++++ + 2 files changed, 4 insertions(+), 18 deletions(-) + +diff --git a/setup/main.py b/setup/main.py +index f341cc1..6093d43 100644 +--- a/setup/main.py ++++ b/setup/main.py +@@ -695,24 +695,14 @@ class AnthySetup(object): + l[i] = [id, short_label, long_label, embed, single, reverse] + + key = 'short_label' +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + prefs.set_value(section, key, short_label) + key = 'long_label' +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + prefs.set_value(section, key, long_label) + key = 'embed' +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + prefs.set_value(section, key, embed) + key = 'single' +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + prefs.set_value(section, key, single) + key = 'reverse' +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + prefs.set_value(section, key, reverse) + + def __text_cell_data_cb(self, layout, renderer, model, iter, id): +@@ -887,10 +877,6 @@ class AnthySetup(object): + if section == None: + self.__run_message_dialog(_("Your custom key is not assigned in any sections. Maybe a bug.")) + return +- if section not in prefs.sections(): +- prefs.set_new_section(section) +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + if type != 'thumb': + prefs.set_value(section, key, value) + else: +@@ -921,10 +907,6 @@ class AnthySetup(object): + if section == None: + self.__run_message_dialog(_("Your custom key is not assigned in any sections. Maybe a bug.")) + return +- if section not in prefs.sections(): +- prefs.set_new_section(section) +- if key not in prefs.keys(section): +- prefs.set_new_key(section, key) + # config.set_value(key, None) is not supported. + if type != 'thumb': + prefs.set_value(section, key, '') +diff --git a/setup/prefs.py b/setup/prefs.py +index f3f0781..66f2cd6 100644 +--- a/setup/prefs.py ++++ b/setup/prefs.py +@@ -57,6 +57,10 @@ class Prefs(object): + return self.default[section][key] + + def set_value(self, section, key, value): ++ if section not in self.sections(): ++ self.set_new_section(section) ++ if key not in self.keys(section): ++ self.set_new_key(section, key) + self.default[section][key] + self.new.setdefault(section, {})[key] = value + +-- +1.7.2.1 diff --git a/ibus-anthy.spec b/ibus-anthy.spec index fefdd7b..4716978 100644 --- a/ibus-anthy.spec +++ b/ibus-anthy.spec @@ -3,13 +3,13 @@ %define require_pygtk2_version 2.15.2 Name: ibus-anthy Version: 1.2.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Anthy engine for IBus input platform License: GPLv2+ Group: System Environment/Libraries URL: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz -# Patch0: ibus-anthy-HEAD.patch +Patch0: ibus-anthy-HEAD.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -32,7 +32,7 @@ libanthy. %prep %setup -q -# %patch0 -p1 +%patch0 -p1 %build %configure --disable-static @@ -60,7 +60,11 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/ibus/component/* %changelog -* Tue Oct 26 2010 Takao Fujiwara - 1.2.4-2 +* Mon Nov 15 2010 Takao Fujiwara - 1.2.4-3 +- Added ibus-anthy-HEAD.patch +- Fixed Bug 652881 - SEGV when key tables are customized in new gconf. + +* Tue Oct 26 2010 Takao Fujiwara - 1.2.4-1 - Updated to 1.2.4 - Resolves #644771 ibus-anthy [F7] key cannot work with SEGV