[libgnome-keyring] Add method for hinting at what kind of object returned NoSuchObject.
- From: Stefan Walter <stefw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgnome-keyring] Add method for hinting at what kind of object returned NoSuchObject.
- Date: Fri, 11 Dec 2009 01:36:08 +0000 (UTC)
commit 636a88ece471a61cbd7ade3bac4868c0cd21b16c
Author: Stef Walter <stef memberwebs com>
Date: Thu Dec 10 23:24:40 2009 +0000
Add method for hinting at what kind of object returned NoSuchObject.
library/gkr-operation.c | 9 ++++++++-
library/gkr-operation.h | 2 ++
library/gnome-keyring.c | 5 +++--
3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/library/gkr-operation.c b/library/gkr-operation.c
index 7e03e0d..29f006e 100644
--- a/library/gkr-operation.c
+++ b/library/gkr-operation.c
@@ -308,7 +308,8 @@ gkr_operation_request (GkrOperation *op, DBusMessage *req)
}
if (op->pending) {
- op->was_keyring = gkr_decode_is_keyring (dbus_message_get_path (req));
+ if (gkr_decode_is_keyring (dbus_message_get_path (req)))
+ gkr_operation_set_keyring_hint (op);
dbus_pending_call_set_notify (op->pending, on_pending_call_notify,
gkr_operation_ref (op), gkr_operation_unref);
} else {
@@ -344,6 +345,12 @@ gkr_operation_block (GkrOperation *op)
return gkr_operation_unref_get_result (op);
}
+void
+gkr_operation_set_keyring_hint (GkrOperation *op)
+{
+ op->was_keyring = TRUE;
+}
+
gboolean
gkr_operation_handle_errors (GkrOperation *op, DBusMessage *reply)
{
diff --git a/library/gkr-operation.h b/library/gkr-operation.h
index 80d6d71..e3245a9 100644
--- a/library/gkr-operation.h
+++ b/library/gkr-operation.h
@@ -69,6 +69,8 @@ GnomeKeyringResult gkr_operation_block (GkrOperation *op);
void gkr_operation_request (GkrOperation *op,
DBusMessage *request);
+void gkr_operation_set_keyring_hint (GkrOperation *op);
+
gboolean gkr_operation_handle_errors (GkrOperation *op,
DBusMessage *reply);
diff --git a/library/gnome-keyring.c b/library/gnome-keyring.c
index 38da616..3050011 100644
--- a/library/gnome-keyring.c
+++ b/library/gnome-keyring.c
@@ -564,6 +564,7 @@ gnome_keyring_set_default_keyring (const gchar *keyr
DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
op = gkr_operation_new (callback, GKR_CALLBACK_RES, data, destroy_data);
+ gkr_operation_set_keyring_hint (op);
gkr_operation_request (op, req);
gkr_operation_unref (op);
@@ -609,7 +610,7 @@ get_default_keyring_reply (GkrOperation *op, DBusMessage *reply, gpointer user_d
const char *path;
gchar *name;
- if (!gkr_operation_handle_errors (op, reply))
+ if (gkr_operation_handle_errors (op, reply))
return;
if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path,
@@ -4091,7 +4092,7 @@ find_password_3_reply (GkrOperation *op, DBusMessage *reply, gpointer user_data)
GkrCallback *cb;
gchar *secret;
- if (!gkr_operation_handle_errors (op, reply))
+ if (gkr_operation_handle_errors (op, reply))
return;
if (!dbus_message_iter_init (reply, &iter) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]