1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
diff --git a/src/common/pwstorage/backend_gkeyring.c b/src/common/pwstorage/backend_gkeyring.c
index e5fb43f..2dd0d56 100644
--- a/src/common/pwstorage/backend_gkeyring.c
+++ b/src/common/pwstorage/backend_gkeyring.c
@@ -20,7 +20,9 @@
#include "backend_gkeyring.h"
#include "control/conf.h"
+#ifdef HAVE_GNOME_KEYRING
#include <gnome-keyring.h>
+#endif
#include <glib.h>
#define DARKTABLE_KEYRING PACKAGE_NAME
#undef DARKTABLE_KEYRING
@@ -29,6 +31,7 @@ const backend_gkeyring_context_t*
dt_pwstorage_gkeyring_new()
{
backend_gkeyring_context_t *context = (backend_gkeyring_context_t*)g_malloc(sizeof(backend_gkeyring_context_t));
+#ifdef HAVE_GNOME_KEYRING
#ifdef DARKTABLE_KEYRING
/* Check if darktable keyring exists, if not create it */
gboolean keyring_exists = FALSE;
@@ -56,13 +59,14 @@ dt_pwstorage_gkeyring_new()
/* unlock darktable keyring */
// Keep this locked until accessed..
//gnome_keyring_lock_sync(DARKTABLE_KEYRING);
-
+#endif
return context;
}
gboolean
dt_pwstorage_gkeyring_set(const gchar* slot, GHashTable* table)
{
+#ifdef HAVE_GNOME_KEYRING
GnomeKeyringResult result=0;
GnomeKeyringAttributeList * attributes;
gchar name[256]="Darktable account information for ";
@@ -104,6 +108,9 @@ dt_pwstorage_gkeyring_set(const gchar* slot, GHashTable* table)
gnome_keyring_attribute_list_free(attributes);
return (result == GNOME_KEYRING_RESULT_OK);
+#else
+ return FALSE;
+#endif
}
GHashTable*
@@ -111,7 +118,7 @@ dt_pwstorage_gkeyring_get(const gchar* slot)
{
GHashTable* table = g_hash_table_new (g_str_hash,g_str_equal);
-
+#ifdef HAVE_GNOME_KEYRING
/* find item for slot */
GList *items=NULL;
GnomeKeyringAttributeList *attributes;
@@ -144,5 +151,6 @@ dt_pwstorage_gkeyring_get(const gchar* slot)
gnome_keyring_attribute_list_free(attributes);
gnome_keyring_found_free (items->data);
}
+#endif
return table;
}
--
1.7.1
|