[Xfce4-commits] r23336 - in xarchiver/trunk: po src

Giuseppe Torelli colossus at xfce.org
Tue Oct 10 11:55:13 UTC 2006


Author: colossus
Date: 2006-10-10 11:55:11 +0000 (Tue, 10 Oct 2006)
New Revision: 23336

Modified:
   xarchiver/trunk/po/de.po
   xarchiver/trunk/src/7zip.c
   xarchiver/trunk/src/arj.c
   xarchiver/trunk/src/arj.h
   xarchiver/trunk/src/extract_dialog.c
   xarchiver/trunk/src/rpm.h
   xarchiver/trunk/src/tar.c
Log:
Fixed wrong extraction of all files in a deb package with "Extract with full path" when only a single file was selected; thanks to baze.
Fixed wrong output of Original and Compressed columns in a 7zip archive.
Fixed missing 'status =' in tar.c.
Begin removal of GValue in arj.c; to be fixed...
Updated de.po.


Modified: xarchiver/trunk/po/de.po
===================================================================
--- xarchiver/trunk/po/de.po	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/po/de.po	2006-10-10 11:55:11 UTC (rev 23336)
@@ -8,7 +8,7 @@
 "Project-Id-Version: xarchiver 0.4\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2006-10-09 14:32+0200\n"
-"PO-Revision-Date: 2006-09-14 10:42+0100\n"
+"PO-Revision-Date: 2006-10-09 15:30+0100\n"
 "Last-Translator: Enrico Tröger <enrico.troeger at uvena.de>\n"
 "Language-Team: German <de at li.org>\n"
 "MIME-Version: 1.0\n"
@@ -130,9 +130,8 @@
 msgstr "Vorgang fehlgeschlagen."
 
 #: ../src/callbacks.c:164
-#, fuzzy
 msgid "The sfx archive was saved as:"
-msgstr "Entpacke Archiv nach %s"
+msgstr "Das selbst-extrahierendes Archiv wurde gespeichert als:"
 
 #: ../src/callbacks.c:175 ../src/callbacks.c:224 ../src/callbacks.c:1347
 #: ../src/extract_dialog.c:568 ../src/extract_dialog.c:791 ../src/iso.c:794
@@ -204,19 +203,16 @@
 msgstr "Lösche Dateien aus dem Archiv, bitte warten..."
 
 #: ../src/callbacks.c:626
-#, fuzzy
 msgid "Converting archive to self-extracting, please wait..."
-msgstr "Archiv-Integrität wird geprüft, bitte warten..."
+msgstr "Umwandlung in ein selbst-extrahierendes Archiv, bitte warten..."
 
 #: ../src/callbacks.c:688
-#, fuzzy
 msgid "Can't convert the archive to self-extracting:"
-msgstr "Kann das Archivierungsprogramm nicht starten:"
+msgstr "Kann das Archiv nicht in ein selbst-extrahierendes Archiv umwandeln:"
 
 #: ../src/callbacks.c:701
-#, fuzzy
 msgid "Can't write the unzipsfx module to the archive:"
-msgstr "Kann Dateien nicht zum Archiv hinzufügen:"
+msgstr "Konnte das unzipsfx-Modul nicht an das Archiv anhängen:"
 
 #: ../src/callbacks.c:768
 msgid "translator-credits"
@@ -289,11 +285,11 @@
 
 #: ../src/callbacks.c:1885
 msgid "You can't add content to deb packages!"
-msgstr ""
+msgstr "Sie können nicht Dateien zu einem DEB-Archiv hinzufügen."
 
 #: ../src/callbacks.c:1887
 msgid "You can't add content to rpm packages!"
-msgstr ""
+msgstr "Sie können nicht Dateien zu einem RPM-Archiv hinzufügen."
 
 #: ../src/callbacks.c:2038
 msgid "Failed to open link."
@@ -326,7 +322,6 @@
 msgstr "Unterverzeichnisse einbeziehen"
 
 #: ../src/add_dialog.c:162
-#, fuzzy
 msgid ""
 "Include everything in the directory recursively \tstarting from the current "
 "directory."
@@ -401,7 +396,6 @@
 "0 = keine Kompression, 3 Standard, 5 = beste Kompression, aber am langsamsten"
 
 #: ../src/add_dialog.c:232
-#, fuzzy
 msgid "0 = no compression, 1 is default, 4 = fastest but least compression"
 msgstr ""
 "0 = keine Kompression, 1 = Standard, 4 = schnellste, aber schlechteste "
@@ -612,20 +606,18 @@
 msgstr "_Eigenschaften"
 
 #: ../src/interface.c:119
-#, fuzzy
 msgid "_Action"
 msgstr "A_ktion"
 
 #: ../src/interface.c:146
 msgid "Make SF_X"
-msgstr ""
+msgstr "_SFX erstellen"
 
 #: ../src/interface.c:167
 msgid "_View"
 msgstr "_Ansehen"
 
 #: ../src/interface.c:182
-#, fuzzy
 msgid "Sele_ct All"
 msgstr "Alle a_uswählen"
 
@@ -679,11 +671,11 @@
 
 #: ../src/interface.c:280
 msgid "SFX"
-msgstr ""
+msgstr "SFX"
 
 #: ../src/interface.c:285
 msgid "Make the current archive self-extracting"
-msgstr ""
+msgstr "Das aktuelle Archiv in ein selbst-extrahierendes Archiv umwandeln"
 
 #: ../src/interface.c:292
 msgid "Delete"
@@ -854,40 +846,34 @@
 msgstr "Effektivdatum:"
 
 #: ../src/main.c:37
-#, fuzzy
 msgid ""
 "Extract archive to the directory specified by destination_path and quits."
 msgstr "Entpackt das Archiv in das angegebene Verzeichnis."
 
 #: ../src/main.c:38
-#, fuzzy
 msgid "destination_path archive"
-msgstr "[Zielpfad]"
+msgstr "Zielarchiv"
 
 #: ../src/main.c:41
-#, fuzzy
 msgid "Extract archive by asking the destination directory and quits."
 msgstr "Fragt nach dem Zielverzeichnis und entpackt das Archiv."
 
 #: ../src/main.c:42 ../src/main.c:50
-#, fuzzy
 msgid "archive"
-msgstr "Xarchiver"
+msgstr "Archive"
 
 #: ../src/main.c:45
-#, fuzzy
 msgid "Add the given files by asking the name of the archive and quits."
 msgstr "Fragt nach dem Archivnamen und fügt die Dateien hinzu."
 
 #: ../src/main.c:46
-#, fuzzy
 msgid "file1 file2 file3 ... fileN"
-msgstr "[Datei1] [Datei2] [Datei3] ... [DateiN]"
+msgstr "Datei1 Datei2 Datei3 ... DateiN"
 
 #: ../src/main.c:49
-#, fuzzy
 msgid "Add files to archive by asking their filenames and quits."
-msgstr "Fügt dem gewählten Archiv Dateien hinzu."
+msgstr ""
+"Fügt dem Archiv Dateien hinzu, nachdem nach den Dateinamen gefragt wurde."
 
 #: ../src/main.c:62
 msgid "[archive name]"

Modified: xarchiver/trunk/src/7zip.c
===================================================================
--- xarchiver/trunk/src/7zip.c	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/src/7zip.c	2006-10-10 11:55:11 UTC (rev 23336)
@@ -84,8 +84,10 @@
 				archive->nr_of_dirs++;
 			for ( x = 0; x < 5; x++)
 			{
-				if ( x == 3 || x == 4)
-					gtk_list_store_set (liststore, &iter,(5-x),atoll(fields[x]),-1);
+				if (x == 3)
+					gtk_list_store_set (liststore, &iter,1,atoll(fields[3]),-1);
+				else if (x == 4)
+					gtk_list_store_set (liststore, &iter,2,atoll(fields[4]),-1);
 				else
 					gtk_list_store_set (liststore, &iter,(5-x),fields[x],-1);
 			}

Modified: xarchiver/trunk/src/arj.c
===================================================================
--- xarchiver/trunk/src/arj.c	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/src/arj.c	2006-10-10 11:55:11 UTC (rev 23336)
@@ -15,15 +15,20 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
  */
- 
+
 #include "config.h"
 #include "arj.h"
 #include "string_utils.h"
 
+GtkTreeIter iter;
+gboolean jump_header = FALSE;
+unsigned short int arj_line = 0;
+
+static gboolean ArjOpen (GIOChannel *ioc, GIOCondition cond, gpointer data);
+
 void OpenArj ( XArchive *archive )
 {
     jump_header = FALSE;
-	odd_line = FALSE;
 	gchar *command = g_strconcat ( "arj v -he " , archive->escaped_path, NULL );
 	archive->dummy_size = 0;
     archive->nr_of_files = 0;
@@ -34,203 +39,112 @@
 	g_free ( command );
 	if ( archive->child_pid == 0 )
 		return;
-	    
+
 	char *names[]= {(_("Filename")),(_("Original")),(_("Compressed")),(_("Ratio")),(_("Date")),(_("Time")),(_("Attributes")),(_("GUA")),(_("BPMGS"))};
 	GType types[]= {G_TYPE_STRING,G_TYPE_UINT64,G_TYPE_UINT64,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING};
 	xa_create_liststore ( 9, names , (GType *)types );
 }
 
-gboolean ArjOpen (GIOChannel *ioc, GIOCondition cond, gpointer data)
+static gboolean ArjOpen (GIOChannel *ioc, GIOCondition cond, gpointer data)
 {
 	XArchive *archive = data;
+	gchar **fields = NULL;
 	gchar *line = NULL;
-	gchar *start = NULL;
-	gchar *end = NULL;
-	GValue *filename = NULL;
-	GValue *original = NULL;
-	gchar *_original = NULL;
-	GValue *compressed = NULL;
-	gchar *_compressed = NULL;
-	GValue *ratio = NULL;
-	GValue *date = NULL;
-	GValue *time = NULL;
-	GValue *attr = NULL;
-	GValue *gua = NULL;
-	GValue *bpmgs = NULL;	
-	
-if (cond & (G_IO_IN | G_IO_PRI) )
+    gchar *filename = NULL;
+	GIOStatus status = G_IO_STATUS_NORMAL;
+
+	if (cond & (G_IO_IN | G_IO_PRI) )
 	{
-		/* This to avoid inserting in the liststore arj copyright message */
-		if (jump_header == FALSE )
+		do
 		{
-			g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
-			if (line == NULL)
-				return TRUE;
-			if  (strncmp (line , "------------" , 12) == 0)
+			/* This to avoid inserting in the liststore arj copyright message */
+			if (jump_header == FALSE )
 			{
-				jump_header = TRUE;
-				arj_line = 1;
-			}
-			return TRUE;
-		}
-		if (arj_line == 4)
-		{
-			arj_line = 1;
-			return TRUE;
-		}
-		if (arj_line == 1)
-		{
-			/* This to avoid reading the last line of arj output */
-			g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
-			if (line == NULL)
-				return TRUE;
-			if (strncmp (line, "------------", 12) == 0 || strncmp (line, "\x0a",1) == 0)
-			{
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				if (line == NULL)
+					break;
+				if (strncmp (line , "----------" , 10) == 0)
+				{
+					jump_header = TRUE;
+					arj_line = 1;
+				}
 				g_free (line);
-				g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
-				if (line != NULL) 
-					g_free (line);
-				return TRUE;
+				break;
 			}
-			start = eat_spaces (line);
-			end = strchr (start, ' ');
-			
-			start = eat_spaces (end);
-			end = strchr (start, '\n');
-
-			filename = g_new0(GValue, 1);
-			filename = g_value_init(filename, G_TYPE_STRING);
-			g_value_set_string (filename , g_strndup ( start , end - start));
-			archive->row = g_list_prepend (archive->row ,  filename);
-			g_free (line);
-		}
-		else if (arj_line == 2)
-		{
-			g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
-			if ( line == NULL)
-				return TRUE;
-			//g_message (line);
-			original    = g_new0(GValue, 1);
-			compressed  = g_new0(GValue, 1);
-			ratio       = g_new0(GValue, 1);
-			date        = g_new0(GValue, 1);
-			time        = g_new0(GValue, 1);
-			attr        = g_new0(GValue, 1);
-			gua         = g_new0(GValue, 1);
-			bpmgs       = g_new0(GValue, 1);
-			archive->row_cnt++;
-			
-			/* The following to avoid the first and second field of the second line of arj output */
-			start = eat_spaces (line);
-			end = strchr (start, ' ');
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			original = g_new0(GValue, 1);
-			original = g_value_init(original, G_TYPE_UINT64);
-			_original = g_strndup ( start , end - start);
-			g_value_set_uint64 ( original , atoll ( _original ) );
-			g_free (_original);
-			
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			compressed = g_new0 (GValue, 1);
-			compressed = g_value_init(compressed, G_TYPE_UINT64);
-			_compressed = g_strndup ( start , end - start);
-			g_value_set_uint64 ( compressed , atoll ( _compressed ) );
-			g_free (_compressed);
-
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			ratio = g_new0(GValue, 1);
-			ratio = g_value_init(ratio, G_TYPE_STRING);
-			g_value_set_string (ratio , g_strndup ( start , end - start));	
-			
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			date = g_new0(GValue, 1);
-			date = g_value_init(date, G_TYPE_STRING);
-			g_value_set_string (date , g_strndup ( start , end - start));
-
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			time = g_new0(GValue, 1);
-			time = g_value_init(time, G_TYPE_STRING);
-			g_value_set_string (time , g_strndup ( start , end - start));
-			
-			start = eat_spaces (end);
-			end = strchr (start, ' ');
-			attr = g_new0(GValue, 1);
-			attr = g_value_init(attr, G_TYPE_STRING);
-			g_value_set_string (attr , g_strndup ( start , end - start));
-
-			gua = g_new0(GValue, 1);
-			gua = g_value_init(gua, G_TYPE_STRING);
-			start = eat_spaces (end);
-			if (*start == '\n')
+			if (arj_line == 4)
 			{
-				no_attr = TRUE;
-				g_value_set_string (gua , g_strdup (" ") );
-				
+				arj_line = 1;
+				break;
 			}
-			else
+			else if (arj_line == 1)
 			{
-				end = strchr (start, ' ');
-				g_value_set_string (gua , g_strndup ( start , end - start));
+				/* This to avoid reading the last line of arj output */
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				if (line == NULL)
+					break;
+				if (strncmp (line, "----------", 10) == 0 || strncmp (line, "\x0a",1) == 0)
+				{
+					g_free (line);
+					status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+					if (line != NULL)
+						g_free (line);
+					break;
+				}
+				filename = get_last_field ( line , 2 );
+				gtk_list_store_append (liststore, &iter);
+				gtk_list_store_set (liststore, &iter,0,filename,-1);
+				g_free (line);
+				break;
 			}
-
-			start = eat_spaces (end);
-			end = strchr (start, '\n');
-			bpmgs = g_new0(GValue, 1);
-			bpmgs = g_value_init(bpmgs, G_TYPE_STRING);
-			if ( ! no_attr)
-				g_value_set_string (bpmgs , g_strndup ( start , end - start));
-			else
+			else if (arj_line == 2)
 			{
-				g_value_set_string (bpmgs , g_value_get_string(attr) );
-				g_value_set_string (attr , g_strdup (" ") );
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				if ( line == NULL)
+					break;
+				fields = split_line ( line , 10 );
+				if ( g_str_has_prefix(fields[7] , "d") == FALSE)
+					archive->nr_of_files++;
+
+				for ( x = 2; x < 10; x++)
+				{
+					if ( x == 2 || x == 3)
+						gtk_list_store_set (liststore, &iter,x-1,atoll(fields[x]),-1);
+					else
+						gtk_list_store_set (liststore, &iter,x-1,fields[x],-1);
+				}
+				archive->dummy_size += atoll(fields[2]);
+				g_free (line);
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				g_free (line);
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				g_free (line);
+				g_strfreev ( fields );
 			}
-			
-			archive->row = g_list_prepend (archive->row , original) ;
-			archive->row = g_list_prepend (archive->row , compressed );
-			archive->row = g_list_prepend (archive->row , ratio );
-			archive->row = g_list_prepend (archive->row , date );
-			archive->row = g_list_prepend (archive->row , time );
-			archive->row = g_list_prepend (archive->row , attr );
-			archive->row = g_list_prepend (archive->row , gua );
-			archive->row = g_list_prepend (archive->row , bpmgs );
-			no_attr = FALSE;
-			if (  g_str_has_suffix (g_value_get_string (attr) , "d") == FALSE)
-				archive->nr_of_files++;
-			archive->dummy_size += g_value_get_uint64 (original );
-			g_free (line);
-			if (archive->row_cnt > 99)
+			else if (arj_line == 3)
 			{
-				xa_append_rows ( archive , 9 );
-				archive->row_cnt = 0;
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				if (line != NULL)
+					g_free (line);
+				status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+				if (line != NULL)
+				{
+					arj_line++;
+					g_free (line);
+				}
 			}
 		}
-		else if (arj_line == 3)
-		{	
-			/* Let's discard the third and forth line of arj output */
-			g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
-			g_free (line);
-			g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
-			g_free (line);
-			//arj_line = 4;
-			//return TRUE;
-		}
+		while (status == G_IO_STATUS_NORMAL);
+		if (status == G_IO_STATUS_ERROR || status == G_IO_STATUS_EOF)
+			goto done;
 	}
 	else if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL) )
 	{
-		g_io_channel_shutdown ( ioc,TRUE,NULL );
+done:	g_io_channel_shutdown ( ioc,TRUE,NULL );
 		g_io_channel_unref (ioc);
-		xa_append_rows ( archive , 9 );
+		gtk_tree_view_set_model (GTK_TREE_VIEW(treeview1), model);
+		g_object_unref (model);
 		return FALSE;
 	}
-	arj_line++;
 	return TRUE;
 }
 

Modified: xarchiver/trunk/src/arj.h
===================================================================
--- xarchiver/trunk/src/arj.h	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/src/arj.h	2006-10-10 11:55:11 UTC (rev 23336)
@@ -15,19 +15,16 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
  */
- 
+
 #ifndef ARJ_H
 #define ARJ_H
 
 #include <gtk/gtk.h>
 #include "callbacks.h"
 #include "interface.h"
-#include "support.h"
 #include "main.h"
 #include "archive.h"
 
 void OpenArj ( XArchive *archive );
-gboolean ArjOpen (GIOChannel *ioc, GIOCondition cond, gpointer data);
-unsigned short int arj_line;
 gboolean no_attr;
 #endif

Modified: xarchiver/trunk/src/extract_dialog.c
===================================================================
--- xarchiver/trunk/src/extract_dialog.c	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/src/extract_dialog.c	2006-10-10 11:55:11 UTC (rev 23336)
@@ -682,7 +682,7 @@
 			command = g_strconcat (tar, " -xvzf " , archive->tmp,
 					archive->overwrite ? " --overwrite" : " --keep-old-files",
 					archive->tar_touch ? " --touch" : "",
-					" -C " , archive->extraction_path , NULL );
+					" -C " , archive->extraction_path , files->str, NULL );
 		}
 		else
 		{

Modified: xarchiver/trunk/src/rpm.h
===================================================================
--- xarchiver/trunk/src/rpm.h	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/src/rpm.h	2006-10-10 11:55:11 UTC (rev 23336)
@@ -15,14 +15,13 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
  */
- 
+
 #ifndef RPM_H
 #define RPM_H
 
 #include <gtk/gtk.h>
 #include "callbacks.h"
 #include "interface.h"
-#include "support.h"
 #include "archive.h"
 
 void OpenRPM ( XArchive *archive );

Modified: xarchiver/trunk/src/tar.c
===================================================================
--- xarchiver/trunk/src/tar.c	2006-10-10 06:56:11 UTC (rev 23335)
+++ xarchiver/trunk/src/tar.c	2006-10-10 11:55:11 UTC (rev 23336)
@@ -64,7 +64,7 @@
 	{
 		do
 		{
-			g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
+			status = g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
 			if ( line == NULL )
 				break;
 



More information about the Xfce4-commits mailing list