diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-01 23:00:36 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-01 23:00:36 +0800 |
commit | 65ebed064c3c5ed83b9d4cd3feee0273a7a0fe20 (patch) | |
tree | ccf0150b234b06ab955142b10a1bb0e6f610b7c8 /gconf | |
parent | db891751d98c86b2ca8a996b4b8d2a9dafc840cd (diff) | |
download | ibus-65ebed064c3c5ed83b9d4cd3feee0273a7a0fe20.tar.gz ibus-65ebed064c3c5ed83b9d4cd3feee0273a7a0fe20.tar.xz ibus-65ebed064c3c5ed83b9d4cd3feee0273a7a0fe20.zip |
Fix bug when set an empty list.
Diffstat (limited to 'gconf')
-rw-r--r-- | gconf/config.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gconf/config.py b/gconf/config.py index 69d5c0a..4b0a514 100644 --- a/gconf/config.py +++ b/gconf/config.py @@ -25,6 +25,7 @@ __all__ = ( import gobject import gconf +import dbus import ibus from ibus import interface @@ -113,6 +114,17 @@ class Config(ibus.Object): raise ibus.IBusException("Items of a list must be in same type") ret.set_list_type(_type) ret.set_list(value) + elif len(value) == 0 and isinstance(value, dbus.Array): + if value.signature == "i": + ret.set_list_type(gconf.VALUE_INT) + elif value.signature == "s": + ret.set_list_type(gconf.VALUE_STRING) + elif value.signature == "d": + ret.set_list_type(gconf.VALUE_FLOAT) + elif value.signature == "b": + ret.set_list_type(gconf.VALUE_BOOL) + else: + pass else: raise ibus.IBusException("Do not support type of %s." % type(value)) return ret |