seahorse r2271 - in trunk: . daemon libseahorse pgp src



Author: nnielsen
Date: Tue Jul 15 23:07:49 2008
New Revision: 2271
URL: http://svn.gnome.org/viewvc/seahorse?rev=2271&view=rev

Log:
	* daemon/seahorse-dbus-server.c:
	* libseahorse/seahorse-context.c:
	* libseahorse/seahorse-dns-sd.c:
	* pgp/seahorse-pgp-source.c:
	* src/main.c:
	* configure.in: Complete decoupling from GPGME. Seahorse
	should now be buildable without GPGME or GnuPG.


Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/daemon/seahorse-dbus-server.c
   trunk/libseahorse/seahorse-context.c
   trunk/libseahorse/seahorse-dns-sd.c
   trunk/pgp/seahorse-pgp-source.c
   trunk/src/main.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Jul 15 23:07:49 2008
@@ -336,7 +336,7 @@
         AC_HELP_STRING([--disable-sharing],
         [Don't compile in DNS-SD key sharing]))
 
-if test "$enable_pgp" != "no"; then
+if test "$enable_pgp" != "yes"; then
 	echo "DNS-SD key sharing requires PGP support"
 	enable_sharing=no
 fi

Modified: trunk/daemon/seahorse-dbus-server.c
==============================================================================
--- trunk/daemon/seahorse-dbus-server.c	(original)
+++ trunk/daemon/seahorse-dbus-server.c	Tue Jul 15 23:07:49 2008
@@ -24,7 +24,9 @@
 
 #include "seahorse-service-bindings.h"
 #include "seahorse-service-keyset-bindings.h"
+#ifdef WITH_PGP
 #include "seahorse-service-crypto-bindings.h"
+#endif
 
 #define DBUS_API_SUBJECT_TO_CHANGE
 #include <dbus/dbus.h>
@@ -35,7 +37,9 @@
 
 /* The main service objects */
 SeahorseService *the_service = NULL;
+#ifdef WITH_PGP
 SeahorseServiceCrypto *the_crypto = NULL;
+#endif
 DBusGConnection *connection = NULL;
 
 void 
@@ -77,17 +81,19 @@
     
     dbus_g_object_type_install_info (SEAHORSE_TYPE_SERVICE_KEYSET, 
                                      &dbus_glib_seahorse_service_keyset_object_info);
-    
-    dbus_g_object_type_install_info (SEAHORSE_TYPE_SERVICE_CRYPTO,
-                                     &dbus_glib_seahorse_service_crypto_object_info);
-    
+
     the_service = g_object_new (SEAHORSE_TYPE_SERVICE, NULL);
     dbus_g_connection_register_g_object (connection, "/org/gnome/seahorse/keys",
                                          G_OBJECT (the_service));
+
+#ifdef WITH_PGP
+    dbus_g_object_type_install_info (SEAHORSE_TYPE_SERVICE_CRYPTO,
+                                     &dbus_glib_seahorse_service_crypto_object_info);
     
     the_crypto = g_object_new (SEAHORSE_TYPE_SERVICE_CRYPTO, NULL);
     dbus_g_connection_register_g_object (connection, "/org/gnome/seahorse/crypto",
                                          G_OBJECT (the_crypto));
+#endif 
 }
 
 DBusGConnection*    
@@ -105,9 +111,11 @@
         g_object_unref (the_service);
     the_service = NULL;
     
+#ifdef WITH_PGP
     if (the_crypto)
         g_object_unref (the_crypto);
     the_crypto = NULL;
+#endif
     
     if (connection)
         dbus_g_connection_unref (connection);

Modified: trunk/libseahorse/seahorse-context.c
==============================================================================
--- trunk/libseahorse/seahorse-context.c	(original)
+++ trunk/libseahorse/seahorse-context.c	Tue Jul 15 23:07:49 2008
@@ -391,7 +391,9 @@
             return ks;
     }
     
+    /* TODO: We need to decouple this properly */
 #ifdef WITH_KEYSERVER
+#ifdef WITH_PGP
     /* Auto generate one if possible */
     if (sctx->pv->auto_sources) {
         ks = SEAHORSE_KEY_SOURCE (seahorse_server_source_new (uri));
@@ -400,6 +402,7 @@
             g_hash_table_replace (sctx->pv->auto_sources, g_strdup (uri), ks);
         }
     }
+#endif /* WITH_PGP */
 #endif /* WITH_KEYSERVER */	
     
     return ks;
@@ -805,6 +808,8 @@
     return mop ? SEAHORSE_OPERATION (mop) : op;  
 }
 
+#ifdef WITH_KEYSERVER
+#ifdef WITH_PGP
 /* For copying the keys */
 static void 
 auto_source_to_hash (const gchar *uri, SeahorseKeySource *sksrc, GHashTable *ht)
@@ -818,6 +823,8 @@
     seahorse_context_remove_key_source (sctx, sksrc);
     g_hash_table_remove (sctx->pv->auto_sources, uri);
 }
+#endif 
+#endif
 
 static void
 refresh_keyservers (GConfClient *client, guint id, GConfEntry *entry, 

Modified: trunk/libseahorse/seahorse-dns-sd.c
==============================================================================
--- trunk/libseahorse/seahorse-dns-sd.c	(original)
+++ trunk/libseahorse/seahorse-dns-sd.c	Tue Jul 15 23:07:49 2008
@@ -82,7 +82,6 @@
  */
 
 #ifdef WITH_SHARING
-#ifdef WITH_PGP
 
 static void
 disconnect (SeahorseServiceDiscovery *ssd)
@@ -224,7 +223,6 @@
     }
 }
 
-#endif /* WITH_PGP */
 #endif /* WITH_SHARING */
 
 static void
@@ -242,30 +240,28 @@
 static void
 seahorse_service_discovery_init (SeahorseServiceDiscovery *ssd)
 {
-#ifdef WITH_SHARING
-    int aerr;
-#endif
-    
     ssd->priv = g_new0 (SeahorseServiceDiscoveryPriv, 1);
     ssd->services = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
     
 #ifdef WITH_SHARING
-    ssd->priv->client = avahi_client_new (seahorse_util_dns_sd_get_poll (), 
-                                          0, client_callback, ssd, &aerr);
-    if (!ssd->priv->client) {
-        g_warning ("DNS-SD initialization failed: %s", avahi_strerror (aerr));
-        return;
-    }
-    
-    ssd->priv->browser = avahi_service_browser_new (ssd->priv->client, AVAHI_IF_UNSPEC, 
-                                AVAHI_PROTO_UNSPEC, HKP_SERVICE_TYPE, NULL, 0, 
-                                browse_callback, ssd);
-    if (!ssd->priv->browser) {
-        g_warning ("Browsing for DNS-SD services failed: %s", 
-                   avahi_strerror (avahi_client_errno (ssd->priv->client)));
-        return;
-    }
-    
+	{
+		int aerr;
+		ssd->priv->client = avahi_client_new (seahorse_util_dns_sd_get_poll (), 
+		                                      0, client_callback, ssd, &aerr);
+		if (!ssd->priv->client) {
+			g_warning ("DNS-SD initialization failed: %s", avahi_strerror (aerr));
+			return;
+		}
+    
+		ssd->priv->browser = avahi_service_browser_new (ssd->priv->client, AVAHI_IF_UNSPEC, 
+		                                                AVAHI_PROTO_UNSPEC, HKP_SERVICE_TYPE, NULL, 0, 
+		                                                browse_callback, ssd);
+		if (!ssd->priv->browser) {
+			g_warning ("Browsing for DNS-SD services failed: %s", 
+			           avahi_strerror (avahi_client_errno (ssd->priv->client)));
+			return;
+		}
+	}
 #endif /* WITH_SHARING */
 }
 
@@ -286,10 +282,10 @@
 {
     SeahorseServiceDiscovery *ssd = SEAHORSE_SERVICE_DISCOVERY (gobject);
   
-#ifdef WITH_SHARING    
+#ifdef WITH_SHARING
     g_assert (ssd->priv->browser == NULL);
     g_assert (ssd->priv->client == NULL);
-#endif /* WITH_SHARING */    
+#endif     
 
     if (ssd->services)    
         g_hash_table_destroy (ssd->services);

Modified: trunk/pgp/seahorse-pgp-source.c
==============================================================================
--- trunk/pgp/seahorse-pgp-source.c	(original)
+++ trunk/pgp/seahorse-pgp-source.c	Tue Jul 15 23:07:49 2008
@@ -290,6 +290,13 @@
 {
     GObjectClass *gobject_class;
     SeahorseKeySourceClass *key_class;
+    
+    g_message ("init gpgme version %s", gpgme_check_version (NULL));
+    
+#ifdef ENABLE_NLS
+    gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
+    gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
+#endif
    
     parent_class = g_type_class_peek_parent (klass);
     gobject_class = G_OBJECT_CLASS (klass);

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Tue Jul 15 23:07:49 2008
@@ -35,8 +35,6 @@
 
 #ifdef WITH_PGP
 #include "pgp/seahorse-pgp-module.h"
-#include "pgp/seahorse-pgp-key.h"
-#include "pgp/seahorse-pgp-source.h"
 #endif
 
 #ifdef WITH_SSH
@@ -65,13 +63,6 @@
     textdomain (GETTEXT_PACKAGE);
 #endif
 
-    g_message("init gpgme version %s", gpgme_check_version(NULL));
-
-#ifdef ENABLE_NLS
-    gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL));
-    gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL));
-#endif
-
     gtk_init_with_args (&argc, &argv, _("Encryption Key Manager"), NULL, GETTEXT_PACKAGE, NULL);
 
     /* Insert Icons into Stock */ 



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