[gwget] 2009-06-18 David Sedeño <david alderia com>



commit ce01430fae81e69d1543357de4af7bc176949535
Author: David Sedeño <david alderia com>
Date:   Thu Jun 18 20:06:53 2009 +0200

    2009-06-18  David Sedeño <david alderia com>
    
            * src/main.c, src/gnome-application.c: Remove old dbus code.

 ChangeLog               |    2 +
 src/gwget-application.c |   15 +----------
 src/main.c              |   61 +++-------------------------------------------
 3 files changed, 7 insertions(+), 71 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 088b747..1464858 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2009-06-18  David Sedeño <david alderia com>
 
+        * src/main.c, src/gnome-application.c: Remove old dbus code. 
+
         * src/main_window_cb.c (on_md5ok_button_clicked): 
         Make the markup work again. Remove from the traduction str.
         
diff --git a/src/gwget-application.c b/src/gwget-application.c
index 690a4ee..111e962 100644
--- a/src/gwget-application.c
+++ b/src/gwget-application.c
@@ -29,6 +29,7 @@
 #endif
 
 #include <gtk/gtk.h>
+#include <string.h>
 #include "gwget_data.h"
 
 G_DEFINE_TYPE (GwgetApplication, gwget_application, G_TYPE_OBJECT);
@@ -61,7 +62,6 @@ gwget_application_register_service (GwgetApplication *application)
 						  DBUS_PATH_DBUS,
 						  DBUS_INTERFACE_DBUS);
 
-#if DBUS_VERSION >= 60	
 	if (!org_freedesktop_DBus_request_name (driver_proxy,
                                         	APPLICATION_SERVICE_NAME,
 						DBUS_NAME_FLAG_DO_NOT_QUEUE,
@@ -69,26 +69,13 @@ gwget_application_register_service (GwgetApplication *application)
 		g_warning ("Service registration failed.");
 		g_clear_error (&err);
 	}
-#else
-	if (!org_freedesktop_DBus_request_name (driver_proxy,
-						APPLICATION_SERVICE_NAME,
-						0, &request_name_result, &err)) {
-		g_warning ("Service registration failed.");
-		g_clear_error (&err);
-	}
-#endif	
 
 	if (request_name_result == DBUS_REQUEST_NAME_REPLY_EXISTS) {
 		return FALSE;
 	}
 
-#if DBUS_VERSION == 33
-	dbus_g_object_class_install_info (G_OBJECT_GET_CLASS (application),
-					  &dbus_glib_gwget_application_object_info);
-#else
 	dbus_g_object_type_install_info (GWGET_TYPE_APPLICATION,
 					 &dbus_glib_gwget_application_object_info);
-#endif
 
 	dbus_g_connection_register_g_object (connection,
 					     "/org/gnome/gwget/Gwget",
diff --git a/src/main.c b/src/main.c
index 314f56b..7ed7764 100644
--- a/src/main.c
+++ b/src/main.c
@@ -98,9 +98,6 @@ load_files_remote (const char **files)
 	GError *error = NULL;
 	DBusGConnection *connection;
 	gboolean result = FALSE;
-#if DBUS_VERSION < 35
-	DBusGPendingCall *call;
-#endif
 	DBusGProxy *remote_object;
 #ifdef HAVE_GTK_WINDOW_PRESENT_WITH_TIME
 	GdkDisplay *display;
@@ -117,7 +114,7 @@ load_files_remote (const char **files)
 
 connection = dbus_g_bus_get (DBUS_BUS_STARTER, &error);
 	if (connection == NULL) {
-		g_warning (error->message);
+		g_warning ("%s", error->message);
 		g_error_free (error);	
 
 		return FALSE;
@@ -128,36 +125,14 @@ connection = dbus_g_bus_get (DBUS_BUS_STARTER, &error);
                                                    "/org/gnome/gwget/Gwget",
                                                    "org.gnome.gwget.Application");
 	if (!files) {
-#if DBUS_VERSION <= 33
-		call = dbus_g_proxy_begin_call (remote_object, "OpenWindow",
-						DBUS_TYPE_UINT32, &timestamp,
-						DBUS_TYPE_INVALID);
-
-		if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) {
-			g_warning (error->message);
-			g_clear_error (&error);
-			return FALSE;
-		}
-#elif DBUS_VERSION == 34
-		call = dbus_g_proxy_begin_call (remote_object, "OpenWindow",
-						G_TYPE_UINT, timestamp,
-						G_TYPE_INVALID);
-
-		if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) {
-			g_warning (error->message);
-			g_clear_error (&error);
-			return FALSE;
-		}
-#else
-		if (!dbus_g_proxy_call (remote_object, "OpenWindow", &error,
+        	if (!dbus_g_proxy_call (remote_object, "OpenWindow", &error,
 					G_TYPE_UINT, timestamp,
 					G_TYPE_INVALID,
 					G_TYPE_INVALID)) {
-			g_warning (error->message);
+			g_warning ("%s", error->message);
 			g_clear_error (&error);
 			return FALSE;
 		}
-#endif
 		return TRUE;
 	}
 
@@ -172,45 +147,17 @@ connection = dbus_g_bus_get (DBUS_BUS_STARTER, &error);
 		if (destination_dir) {
         		dest_dir = destination_dir;
         	} 
-#if DBUS_VERSION <= 33
-		call = dbus_g_proxy_begin_call (remote_object, "OpenURIDest",
-						DBUS_TYPE_STRING, &uri,
-						DBUS_TYPE_STRING, &dest_dir,
-						DBUS_TYPE_UINT32, &timestamp,
-						DBUS_TYPE_INVALID);
-
-		if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) {
-			g_warning (error->message);
-			g_clear_error (&error);
-			g_free (uri);
-			continue;
-		}
-#elif DBUS_VERSION == 34
-		call = dbus_g_proxy_begin_call (remote_object, "OpenURIDest",
-						G_TYPE_STRING, uri,
-						G_TYPE_STRING, dest_dir,
-						G_TYPE_UINT, timestamp,
-						G_TYPE_INVALID);
-
-		if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) {
-			g_warning (error->message);
-			g_clear_error (&error);
-			g_free (uri);
-			continue;
-		}
-#else
 		if (!dbus_g_proxy_call (remote_object, "OpenURIDest", &error,
 					G_TYPE_STRING, uri,
 					G_TYPE_STRING, dest_dir,
 					G_TYPE_UINT, timestamp,
 					G_TYPE_INVALID,
 					G_TYPE_INVALID)) {
-			g_warning (error->message);
+			g_warning ("%s", error->message);
 			g_clear_error (&error);
 			g_free (uri);
 			continue;
 		}
-#endif
 		g_free (uri);
 		g_object_unref (file);
 		result = TRUE;



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