ibus-anthy/ibus-anthy-HEAD.patch

80 lines
2.9 KiB
Diff
Raw Normal View History

From aaa2f6ad0ff5da7915b33b5d30ded25def187e7c Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
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