gwget r616 - in trunk: . src



Author: davidsf
Date: Sat Feb  7 12:38:07 2009
New Revision: 616
URL: http://svn.gnome.org/viewvc/gwget?rev=616&view=rev

Log:
2009-02-07  David SedeÃo <david alderia com>

        * src/gwget-application{.c, .h}, src/gwget-application-service.xml,
          main.c: Add destination directory parameter to OpenURI method.
          Fixes: #562993



Modified:
   trunk/ChangeLog
   trunk/src/gwget-application-service.xml
   trunk/src/gwget-application.c
   trunk/src/gwget-application.h
   trunk/src/main.c

Modified: trunk/src/gwget-application-service.xml
==============================================================================
--- trunk/src/gwget-application-service.xml	(original)
+++ trunk/src/gwget-application-service.xml	Sat Feb  7 12:38:07 2009
@@ -13,6 +13,7 @@
     <method name="OpenURI">
       <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="gwget_application_open_uri"/>
       <arg type="s" name="uri" direction="in"/>
+      <arg type="s" name="destination_dir" direction="in"/>
       <arg type="u" name="timestamp" direction="in"/>
     </method>
 

Modified: trunk/src/gwget-application.c
==============================================================================
--- trunk/src/gwget-application.c	(original)
+++ trunk/src/gwget-application.c	Sat Feb  7 12:38:07 2009
@@ -145,13 +145,20 @@
 gboolean
 gwget_application_open_uri (GwgetApplication  *application,
 			 const char     *url,
+			 const char	*destination_dir,
 			 guint32         timestamp,
 			 GError        **error)
 {
 	GwgetData *gwgetdata;
 	
-	
 	gwgetdata = gwget_data_new ((gchar *)url);
+	
+	if (strlen(destination_dir)!=0) {
+		gwgetdata->dir = (gchar *)destination_dir;
+        } else {
+        	gwgetdata->dir = gwget_pref.download_dir;
+        }
+	
 	gwget_data_add_download(gwgetdata);
 	gwget_data_start_download(gwgetdata);
 

Modified: trunk/src/gwget-application.h
==============================================================================
--- trunk/src/gwget-application.h	(original)
+++ trunk/src/gwget-application.h	Sat Feb  7 12:38:07 2009
@@ -58,6 +58,7 @@
 						      GError         **error);
 gboolean          gwget_application_open_uri            (GwgetApplication   *application,
 		                      const char      *uri,
+		                      const char      *destination_dir,
 						      guint32         timestamp,
 						      GError         **error);
 

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Sat Feb  7 12:38:07 2009
@@ -163,11 +163,17 @@
 
 	for (i = 0; files[i]; i++) {
 		char *uri;
+		char *dest_dir;
 
 		uri = gnome_vfs_make_uri_from_shell_arg (files[i]);
+		
+		if (destination_dir) {
+        		dest_dir = destination_dir;
+        	} 
 #if DBUS_VERSION <= 33
 		call = dbus_g_proxy_begin_call (remote_object, "OpenURI",
 						DBUS_TYPE_STRING, &uri,
+						DBUS_TYPE_STRING, &dest_dir,
 						DBUS_TYPE_UINT32, &timestamp,
 						DBUS_TYPE_INVALID);
 
@@ -180,6 +186,7 @@
 #elif DBUS_VERSION == 34
 		call = dbus_g_proxy_begin_call (remote_object, "OpenURI",
 						G_TYPE_STRING, uri,
+						G_TYPE_STRING, dest_dir,
 						G_TYPE_UINT, timestamp,
 						G_TYPE_INVALID);
 
@@ -192,6 +199,7 @@
 #else
 		if (!dbus_g_proxy_call (remote_object, "OpenURI", &error,
 					G_TYPE_STRING, uri,
+					G_TYPE_STRING, dest_dir,
 					G_TYPE_UINT, timestamp,
 					G_TYPE_INVALID,
 					G_TYPE_INVALID)) {
@@ -258,10 +266,10 @@
 
 	gwget_init_pref(&gwget_pref);
 	program = gnome_program_init(PACKAGE, VERSION, 
-								LIBGNOMEUI_MODULE, argc, argv,
-					            GNOME_PARAM_GOPTION_CONTEXT, context, 
-								GNOME_PARAM_HUMAN_READABLE_NAME, _("Gwget"),
-				      			GNOME_PARAM_APP_DATADIR, GNOME_GWGET_LOCALEDIR,
+				LIBGNOMEUI_MODULE, argc, argv,
+			        GNOME_PARAM_GOPTION_CONTEXT, context, 
+				GNOME_PARAM_HUMAN_READABLE_NAME, _("Gwget"),
+				GNOME_PARAM_APP_DATADIR, GNOME_GWGET_LOCALEDIR,
                               	NULL);
 	
 #ifdef ENABLE_DBUS



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