[Xfce4-commits] r26085 - xarchiver/trunk/src

Giuseppe Torelli colossus at xfce.org
Mon Sep 17 11:05:23 CEST 2007


Author: colossus
Date: 2007-09-17 09:05:23 +0000 (Mon, 17 Sep 2007)
New Revision: 26085

Modified:
   xarchiver/trunk/src/archive.c
   xarchiver/trunk/src/deb.c
   xarchiver/trunk/src/extract_dialog.c
   xarchiver/trunk/src/pref_dialog.c
Log:
Fixed bug introduced with r26076.
Fixed absolute path for the behaviour icon in the prefs-dialog.
Fixed missed deletion of tmp dir when opening deb packages.


Modified: xarchiver/trunk/src/archive.c
===================================================================
--- xarchiver/trunk/src/archive.c	2007-09-17 03:31:26 UTC (rev 26084)
+++ xarchiver/trunk/src/archive.c	2007-09-17 09:05:23 UTC (rev 26085)
@@ -233,9 +233,7 @@
 	gboolean result;
 		
 	chdir (archive->tmp);
-
 	command = g_strconcat ("rm -rf ",archive->tmp,NULL);
-
 	result = xa_run_command (archive,command,flag );
 	g_free (command);
 	return result;

Modified: xarchiver/trunk/src/deb.c
===================================================================
--- xarchiver/trunk/src/deb.c	2007-09-17 03:31:26 UTC (rev 26084)
+++ xarchiver/trunk/src/deb.c	2007-09-17 09:05:23 UTC (rev 26085)
@@ -59,7 +59,7 @@
 	g_free (command);
 	g_free (archive->tmp);
 
-	archive->tmp = g_strconcat (tmp_dir,"/data.tar.gz",NULL);
+	archive->tmp = g_strdup(tmp_dir);
 	chdir (tmp_dir);
 	unlink ("control.tar.gz");
 	unlink ("debian-binary");

Modified: xarchiver/trunk/src/extract_dialog.c
===================================================================
--- xarchiver/trunk/src/extract_dialog.c	2007-09-17 03:31:26 UTC (rev 26084)
+++ xarchiver/trunk/src/extract_dialog.c	2007-09-17 09:05:23 UTC (rev 26085)
@@ -68,12 +68,18 @@
 	gtk_widget_set_size_request (dialog_data->destination_path_entry, 385, -1);
 	gtk_entry_set_activates_default (GTK_ENTRY (dialog_data->destination_path_entry), TRUE);
 
-	gchar *dummy = strstr(archive->path, ".");
+	gchar *dummy = g_strrstr(archive->path, ".");
 	if (dummy != NULL)
 	{
 		dummy++;
 		unsigned short int x = strlen (archive->path) - strlen ( dummy );
-		gchar *extraction_string = g_strndup(archive->path,x-1);
+		gchar *extraction_string = g_strndup(archive->path, x-1);
+		if (strstr (extraction_string,".tar"))
+		{
+			gchar *extraction_string_no_tar = g_strndup(extraction_string, x-5);
+			g_free (extraction_string);
+			extraction_string = extraction_string_no_tar;
+		}
 		gtk_entry_set_text (GTK_ENTRY(dialog_data->destination_path_entry), extraction_string);
 		g_free (extraction_string);
 	}
@@ -486,7 +492,7 @@
 					}
 					else
 					{
-						xa_extract_tar_without_directories ( "tar -xvzf ",archive,archive->tmp,FALSE );
+						xa_extract_tar_without_directories ( "tar -xvzf ",archive,archive->extraction_path,FALSE );
 						command = NULL;
 					}
 					break;
@@ -802,6 +808,7 @@
 
 			if (strstr (permission ,"d") == NULL)
 			{
+				//concatena il percorso nella barra degli indirizzi col nome dei files selezionato e mettilo in name
 				ConcatenateFileNames2 ( name , names );
 				filenames = g_slist_append ( filenames,name );
 			}
@@ -812,10 +819,10 @@
 	}
 	else
 	{
-		/* *Here we have to fill a GSList with all the entries in the archive so that we can use mv on all of them */
+		/* *Here we need to fill a GSList with all the entries in the archive so that we can use mv on all of them */
 		XEntry *entry;
 		GSList *s = archive->entries;
-		//g_print ("%s\n",gtk_entry_get_text(GTK_ENTRY(location_entry)));
+
 		for (; s; s = s->next)
 		{
 			entry = s->data;
@@ -828,9 +835,10 @@
 	if (result == 0)
 		return FALSE;
 
+	archive->tmp = strdup(tmp_dir);
 	if (cpio_flag)
 	{
-		chdir (tmp_dir);
+		chdir (archive->tmp);
 		command = g_strconcat ( "cpio --make-directories -F " , archive->tmp , " -i" , NULL );
 	}
 	else
@@ -838,6 +846,7 @@
 										archive->overwrite ? " --overwrite" : " --keep-old-files",
 										archive->tar_touch ? " --touch" : "",
 										" -C " , tmp_dir , names->str, NULL );
+	g_print ("%s\n",command);
 	result = xa_run_command (archive,command,0);
 	g_string_free (names, TRUE);
 	g_free (command);
@@ -849,7 +858,7 @@
 		Update_StatusBar (_("Operation canceled."));
 		return FALSE;
 	}
-	chdir (tmp_dir);
+	chdir (archive->tmp);
 	while (filenames)
 	{
 		gchar *unescaped = EscapeBadChars ( (gchar*)filenames->data , "$\'`\"\\!?* ()[]&|@#:;");

Modified: xarchiver/trunk/src/pref_dialog.c
===================================================================
--- xarchiver/trunk/src/pref_dialog.c	2007-09-17 03:31:26 UTC (rev 26084)
+++ xarchiver/trunk/src/pref_dialog.c	2007-09-17 09:05:23 UTC (rev 26085)
@@ -51,8 +51,9 @@
 	
 	prefs_data->prefs_liststore = gtk_list_store_new ( 3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT);
 	gtk_list_store_append (prefs_data->prefs_liststore, &iter);
-	//TODO: fix the absolute path
-	icon_pixbuf = gdk_pixbuf_new_from_file ("./pixmaps/xarchiver-behaviour.svg", NULL);
+	gchar *pixbuf_file = g_strconcat(DATADIR,"/pixmaps/xarchiver-behaviour.svg",NULL);
+	icon_pixbuf = gdk_pixbuf_new_from_file (pixbuf_file,NULL);
+	g_free (pixbuf_file);
 	gtk_list_store_set (prefs_data->prefs_liststore, &iter, 0, icon_pixbuf, 1, _("Behaviour"),2,0,-1);
 	if(icon_pixbuf != NULL)
 		g_object_unref (icon_pixbuf);



More information about the Xfce4-commits mailing list