[seahorse] pgp: Fix build when --without-ldap or --without-hkp



commit e5d56fa6aaff6d1c3a8ebd84587c518aac855a99
Author: Stef Walter <stefw gnome org>
Date:   Wed Mar 6 20:41:22 2013 +0100

    pgp: Fix build when --without-ldap or --without-hkp
    
    Having so many optional dependencies is rather dubious. Let's not
    add more carelessly. But fixing the build in the interim makes sense.

 pgp/seahorse-ldap-source.c |    6 +++---
 pgp/seahorse-pgp-actions.c |    8 ++++++++
 pgp/seahorse-pgp-backend.c |    6 ++++++
 pgp/seahorse-pgp-backend.h |    4 ++++
 4 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/pgp/seahorse-ldap-source.c b/pgp/seahorse-ldap-source.c
index 5e2601f..fdbbd98 100644
--- a/pgp/seahorse-ldap-source.c
+++ b/pgp/seahorse-ldap-source.c
@@ -677,10 +677,10 @@ seahorse_ldap_source_connect_async (SeahorseLDAPSource *source,
 {
        GSimpleAsyncResult *res;
        source_connect_closure *closure;
-#ifdef WITH_SOUP
-       SoupAddress *address;
        gchar *server = NULL;
        gchar *pos;
+#ifdef WITH_SOUP
+       SoupAddress *address;
 #endif
 
        res = g_simple_async_result_new (G_OBJECT (source), callback, user_data,
@@ -708,7 +708,7 @@ seahorse_ldap_source_connect_async (SeahorseLDAPSource *source,
 
 #else /* !WITH_SOUP */
 
-       once_resolved_start_connect (self, res, server);
+       once_resolved_start_connect (source, res, server);
 
 #endif
 
diff --git a/pgp/seahorse-pgp-actions.c b/pgp/seahorse-pgp-actions.c
index 64565ad..e0223fe 100644
--- a/pgp/seahorse-pgp-actions.c
+++ b/pgp/seahorse-pgp-actions.c
@@ -60,6 +60,8 @@ typedef struct {
 
 G_DEFINE_TYPE (SeahorsePgpBackendActions, seahorse_pgp_backend_actions, SEAHORSE_TYPE_ACTIONS);
 
+#ifdef WITH_KEYSERVER
+
 static const gchar* BACKEND_DEFINITION = ""\
 "<ui>"\
 "      <menubar>"\
@@ -119,9 +121,12 @@ static const GtkActionEntry SYNC_ACTIONS[] = {
          N_("Publish and/or synchronize your keys with those online."), G_CALLBACK (on_remote_sync) }
 };
 
+#endif /* WITH_KEYSERVER */
+
 static void
 seahorse_pgp_backend_actions_init (SeahorsePgpBackendActions *self)
 {
+#ifdef WITH_KEYSERVER
        GtkActionGroup *actions = GTK_ACTION_GROUP (self);
        gtk_action_group_set_translation_domain (actions, GETTEXT_PACKAGE);
        gtk_action_group_add_actions (actions, FIND_ACTIONS,
@@ -129,6 +134,7 @@ seahorse_pgp_backend_actions_init (SeahorsePgpBackendActions *self)
        gtk_action_group_add_actions (actions, SYNC_ACTIONS,
                                      G_N_ELEMENTS (SYNC_ACTIONS), self);
        seahorse_actions_register_definition (SEAHORSE_ACTIONS (self), BACKEND_DEFINITION);
+#endif
 }
 
 static void
@@ -176,10 +182,12 @@ G_DEFINE_TYPE (SeahorseGpgmeKeyActions, seahorse_gpgme_key_actions, SEAHORSE_TYP
 static void
 seahorse_gpgme_key_actions_init (SeahorseGpgmeKeyActions *self)
 {
+#ifdef WITH_KEYSERVER
        GtkActionGroup *actions = GTK_ACTION_GROUP (self);
        gtk_action_group_set_translation_domain (actions, GETTEXT_PACKAGE);
        gtk_action_group_add_actions (actions, SYNC_ACTIONS,
                                      G_N_ELEMENTS (SYNC_ACTIONS), NULL);
+#endif
 }
 
 static void
diff --git a/pgp/seahorse-pgp-backend.c b/pgp/seahorse-pgp-backend.c
index 448824e..bb26aed 100644
--- a/pgp/seahorse-pgp-backend.c
+++ b/pgp/seahorse-pgp-backend.c
@@ -320,6 +320,8 @@ seahorse_pgp_backend_get_default_key (SeahorsePgpBackend *self)
        return key;
 }
 
+#ifdef WITH_KEYSERVER
+
 SeahorseDiscovery *
 seahorse_pgp_backend_get_discovery (SeahorsePgpBackend *self)
 {
@@ -665,6 +667,8 @@ seahorse_pgp_backend_retrieve_finish (SeahorsePgpBackend *self,
        return TRUE;
 }
 
+#endif /* WITH_KEYSERVER */
+
 GList *
 seahorse_pgp_backend_discover_keys (SeahorsePgpBackend *self,
                                     const gchar **keyids,
@@ -703,10 +707,12 @@ seahorse_pgp_backend_discover_keys (SeahorsePgpBackend *self,
                g_ptr_array_add (todiscover, NULL);
                keyids = (const gchar **)todiscover->pdata;
 
+#ifdef WITH_KEYSERVER
                /* Start a discover process on all todiscover */
                if (g_settings_get_boolean (seahorse_application_settings (NULL), "server-auto-retrieve"))
                        seahorse_pgp_backend_retrieve_async (self, keyids, SEAHORSE_PLACE (self->keyring),
                                                             cancellable, NULL, NULL);
+#endif
 
                /* Add unknown objects for all these */
                for (i = 0; keyids[i] != NULL; i++) {
diff --git a/pgp/seahorse-pgp-backend.h b/pgp/seahorse-pgp-backend.h
index 8fc3aab..28ba768 100644
--- a/pgp/seahorse-pgp-backend.h
+++ b/pgp/seahorse-pgp-backend.h
@@ -55,6 +55,8 @@ SeahorseGpgmeKeyring * seahorse_pgp_backend_get_default_keyring  (SeahorsePgpBac
 
 SeahorsePgpKey *       seahorse_pgp_backend_get_default_key      (SeahorsePgpBackend *self);
 
+#ifdef WITH_KEYSERVER
+
 SeahorseDiscovery *    seahorse_pgp_backend_get_discovery        (SeahorsePgpBackend *self);
 
 SeahorseServerSource * seahorse_pgp_backend_lookup_remote        (SeahorsePgpBackend *self,
@@ -99,11 +101,13 @@ void                   seahorse_pgp_backend_retrieve_async       (SeahorsePgpBac
 gboolean               seahorse_pgp_backend_retrieve_finish      (SeahorsePgpBackend *self,
                                                                   GAsyncResult *result,
                                                                   GError **error);
+#endif /* WITH_KEYSERVER */
 
 GList*                 seahorse_pgp_backend_discover_keys        (SeahorsePgpBackend *self,
                                                                   const gchar **keyids,
                                                                   GCancellable *cancellable);
 
+
 G_END_DECLS
 
 #endif /*SEAHORSE_PGP_BACKEND_H_*/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]