mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2025-01-05 03:28:54 +00:00
Fix collection creation bugs in mock service
* Guarantee that collections have unique paths * Set the alias of new collections correctly https://bugzilla.gnome.org/show_bug.cgi?id=688165
This commit is contained in:
parent
446648da52
commit
4eb3c4577e
@ -315,7 +315,7 @@ class SecretCollection(dbus.service.Object):
|
|||||||
def __init__(self, service, identifier=None, label="Collection", locked=False,
|
def __init__(self, service, identifier=None, label="Collection", locked=False,
|
||||||
confirm=False, master=None):
|
confirm=False, master=None):
|
||||||
if identifier is None:
|
if identifier is None:
|
||||||
identifier = label
|
identifier = next_identifier(label)
|
||||||
identifier = encode_identifier(identifier)
|
identifier = encode_identifier(identifier)
|
||||||
self.service = service
|
self.service = service
|
||||||
self.identifier = identifier
|
self.identifier = identifier
|
||||||
@ -627,6 +627,8 @@ class SecretService(dbus.service.Object):
|
|||||||
service = self
|
service = self
|
||||||
def prompt_callback():
|
def prompt_callback():
|
||||||
collection = SecretCollection(service, None, label, locked=False, confirm=True)
|
collection = SecretCollection(service, None, label, locked=False, confirm=True)
|
||||||
|
if alias:
|
||||||
|
collection.add_alias(alias)
|
||||||
return dbus.ObjectPath(collection.path, variant_level=1)
|
return dbus.ObjectPath(collection.path, variant_level=1)
|
||||||
prompt = SecretPrompt(self, sender, dismiss=False, action=prompt_callback)
|
prompt = SecretPrompt(self, sender, dismiss=False, action=prompt_callback)
|
||||||
return (dbus.ObjectPath("/"), dbus.ObjectPath(prompt.path))
|
return (dbus.ObjectPath("/"), dbus.ObjectPath(prompt.path))
|
||||||
|
Loading…
Reference in New Issue
Block a user