Fix split_properties usage
This commit is contained in:
parent
58a8cfc795
commit
e432cc91ca
@ -63,7 +63,7 @@ class Activity(DBusGObject):
|
|||||||
gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT_ONLY)
|
gobject.PARAM_READWRITE | gobject.PARAM_CONSTRUCT_ONLY)
|
||||||
}
|
}
|
||||||
|
|
||||||
_RESERVED_PROPNAMES = self.__gproperties__.keys()
|
_RESERVED_PROPNAMES = __gproperties__.keys()
|
||||||
|
|
||||||
def __init__(self, bus_name, object_id, tp, **kwargs):
|
def __init__(self, bus_name, object_id, tp, **kwargs):
|
||||||
"""Initializes the activity and sets its properties to default values.
|
"""Initializes the activity and sets its properties to default values.
|
||||||
@ -169,9 +169,11 @@ class Activity(DBusGObject):
|
|||||||
elif pspec.name == _PROP_LOCAL:
|
elif pspec.name == _PROP_LOCAL:
|
||||||
self._local = value
|
self._local = value
|
||||||
elif pspec.name == _PROP_CUSTOM_PROPS:
|
elif pspec.name == _PROP_CUSTOM_PROPS:
|
||||||
|
if not value:
|
||||||
|
value = {}
|
||||||
(rprops, cprops) = self._split_properties(value)
|
(rprops, cprops) = self._split_properties(value)
|
||||||
self._custom_props = {}
|
self._custom_props = {}
|
||||||
for (key, dvalue) in cprops:
|
for (key, dvalue) in cprops.items():
|
||||||
self._custom_props[str(key)] = str(dvalue)
|
self._custom_props[str(key)] = str(dvalue)
|
||||||
|
|
||||||
self._update_validity()
|
self._update_validity()
|
||||||
@ -487,7 +489,7 @@ class Activity(DBusGObject):
|
|||||||
"""
|
"""
|
||||||
changed = False
|
changed = False
|
||||||
# split reserved properties from activity-custom properties
|
# split reserved properties from activity-custom properties
|
||||||
(rprops, cprops) = self._split_properties()
|
(rprops, cprops) = self._split_properties(properties)
|
||||||
if _PROP_NAME in rprops.keys():
|
if _PROP_NAME in rprops.keys():
|
||||||
name = rprops[_PROP_NAME]
|
name = rprops[_PROP_NAME]
|
||||||
if name != self._name:
|
if name != self._name:
|
||||||
@ -526,7 +528,7 @@ class Activity(DBusGObject):
|
|||||||
"""
|
"""
|
||||||
rprops = {}
|
rprops = {}
|
||||||
cprops = {}
|
cprops = {}
|
||||||
for (key, value) in properties:
|
for (key, value) in properties.items():
|
||||||
if key in self._RESERVED_PROPNAMES:
|
if key in self._RESERVED_PROPNAMES:
|
||||||
rprops[key] = value
|
rprops[key] = value
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user