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

Giuseppe Torelli colossus at xfce.org
Wed Aug 15 15:53:38 CEST 2007


Author: colossus
Date: 2007-08-15 13:53:38 +0000 (Wed, 15 Aug 2007)
New Revision: 25986

Modified:
   xarchiver/trunk/src/deb.c
   xarchiver/trunk/src/main.c
   xarchiver/trunk/src/new_dialog.c
   xarchiver/trunk/src/new_dialog.h
   xarchiver/trunk/src/rar.c
   xarchiver/trunk/src/window.c
Log:
Archive navigaton work for deb too.
Fixed bugs #2045 , #2627.


Modified: xarchiver/trunk/src/deb.c
===================================================================
--- xarchiver/trunk/src/deb.c	2007-08-15 10:20:42 UTC (rev 25985)
+++ xarchiver/trunk/src/deb.c	2007-08-15 13:53:38 UTC (rev 25986)
@@ -26,6 +26,7 @@
 	gchar *command = NULL;
 	gchar *archive_no_path = NULL;
 	gboolean result;
+	unsigned short int i;
 	gchar tmp_dir[14] = "";
 
 	/* Create a unique tmp dir in /tmp */
@@ -76,6 +77,7 @@
 	archive->dummy_size = 0;
 	archive->nr_of_files = 0;
 	archive->nr_of_dirs = 0;
+	archive->nc = 6;
 	archive->format = "DEB";
 	archive->parse_output = xa_get_tar_line_content;
 	xa_spawn_async_process (archive,command,0);
@@ -84,7 +86,10 @@
 	if (archive->child_pid == 0)
 		return;
 
-	char *names[]= {(_("Filename")),(_("Permissions")),(_("Symbolic Link")),(_("Owner/Group")),(_("Size")),(_("Date")),(_("Time"))};
-	GType types[]= {G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_UINT64,G_TYPE_STRING,G_TYPE_STRING};
-	xa_create_liststore ( 7, names , (GType *)types, archive );
+	char *names[]= {(_("Points to")),(_("Permissions")),(_("Owner/Group")),(_("Size")),(_("Date")),(_("Time"))};
+	GType types[]= {G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_UINT64,G_TYPE_STRING,G_TYPE_STRING};
+	archive->column_types = g_malloc0(sizeof(types));
+	for (i = 0; i < 8; i++)
+		archive->column_types[i] = types[i];
+	xa_create_liststore (archive,names);
 }

Modified: xarchiver/trunk/src/main.c
===================================================================
--- xarchiver/trunk/src/main.c	2007-08-15 10:20:42 UTC (rev 25985)
+++ xarchiver/trunk/src/main.c	2007-08-15 13:53:38 UTC (rev 25986)
@@ -61,6 +61,7 @@
 
 int main (int argc, char **argv)
 {
+	gboolean no_bzip2_gzip;
 	unsigned short int x;
 	#ifdef ENABLE_NLS
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -156,7 +157,11 @@
 		else if (archive_name != NULL)
 		{
 			XArchive *archive_cmd = NULL;
-			archive_cmd = xa_new_archive_dialog (archive_name, NULL );
+			if (argc > 1 || g_file_test ( archive_name,G_FILE_TEST_IS_DIR) )
+				no_bzip2_gzip = TRUE;
+			else
+				no_bzip2_gzip = FALSE;
+			archive_cmd = xa_new_archive_dialog (archive_name, NULL, no_bzip2_gzip);
 			if (archive_cmd == NULL)
 				return 0;
 
@@ -180,6 +185,7 @@
 					ConcatenateFileNames2 ( _current_dir, string );
 					g_free (_current_dir);
 				}
+
 				if ( archive_cmd->type == XARCHIVETYPE_7ZIP)
 					archive_cmd->add_recurse = FALSE;
 				else

Modified: xarchiver/trunk/src/new_dialog.c
===================================================================
--- xarchiver/trunk/src/new_dialog.c	2007-08-15 10:20:42 UTC (rev 25985)
+++ xarchiver/trunk/src/new_dialog.c	2007-08-15 13:53:38 UTC (rev 25986)
@@ -30,7 +30,7 @@
 gint new_combo_box = -1;
 gchar *ComboArchiveType;
 
-XArchive *xa_new_archive_dialog (gchar *path, XArchive *archive_open[])
+XArchive *xa_new_archive_dialog (gchar *path, XArchive *archive_open[], gboolean flag)
 {
 	XArchive *archive = NULL;
 	GtkWidget *xa_file_chooser;
@@ -95,15 +95,18 @@
 
 	filter_tooltip = gtk_tooltips_new();
 	gtk_tooltips_set_tip (filter_tooltip,combo_box, _("Choose the archive type to create") , NULL);
-	Name = g_list_first ( ArchiveType );
-	while ( Name != NULL )
+	Name = g_list_first (ArchiveType);
+	while (Name)
 	{
-		if (!strcmp(Name->data, "tgz") || !strcmp(Name->data, "rpm") || !strcmp(Name->data, "iso") || !strcmp(Name->data, "gz") || !strcmp(Name->data, "lzma") || !strcmp(Name->data, "deb") || !strcmp(Name->data, "bz2") || (!strcmp(Name->data, "rar") && unrar) )
-			goto Next;
+		if (!strcmp(Name->data, "tgz") || !strcmp(Name->data, "rpm") || !strcmp(Name->data, "iso") || (!strcmp(Name->data, "gz") && flag)
+		|| !strcmp(Name->data, "lzma") || !strcmp(Name->data, "deb") || (!strcmp(Name->data, "bz2") && flag)
+		|| (!strcmp(Name->data, "rar") && unrar) )
+			goto there;
 		else
 			gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), Name->data );
-		Next:
-			Name = g_list_next ( Name );
+
+	there:
+		Name = g_list_next ( Name );
 	}
 	if (new_combo_box == -1)
 		gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box) , 0 );

Modified: xarchiver/trunk/src/new_dialog.h
===================================================================
--- xarchiver/trunk/src/new_dialog.h	2007-08-15 10:20:42 UTC (rev 25985)
+++ xarchiver/trunk/src/new_dialog.h	2007-08-15 13:53:38 UTC (rev 25986)
@@ -20,6 +20,6 @@
 #define __NEW_DIALOG_H
 
 #include "archive.h"
-XArchive *xa_new_archive_dialog (gchar *path, XArchive *archive_open[]);
+XArchive *xa_new_archive_dialog (gchar *path, XArchive *archive_open[], gboolean flag);
 #endif
 

Modified: xarchiver/trunk/src/rar.c
===================================================================
--- xarchiver/trunk/src/rar.c	2007-08-15 10:20:42 UTC (rev 25985)
+++ xarchiver/trunk/src/rar.c	2007-08-15 13:53:38 UTC (rev 25986)
@@ -95,9 +95,8 @@
 			last_line = TRUE;
 			return;
 		}
-		line++;
 		line[linesize - 2] = '\0';
-		filename = g_strdup(line);
+		filename = g_strdup(line+1);
 		read_filename = TRUE;
 	}
 	else

Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c	2007-08-15 10:20:42 UTC (rev 25985)
+++ xarchiver/trunk/src/window.c	2007-08-15 13:53:38 UTC (rev 25986)
@@ -193,7 +193,7 @@
 	if (current_page == -1)
 		return;
 
-	archive[current_page] = xa_new_archive_dialog ( NULL , archive );
+	archive[current_page] = xa_new_archive_dialog (NULL,archive,FALSE);
 
 	if (archive[current_page]  == NULL)
 		return;
@@ -1997,7 +1997,7 @@
 		idx = xa_get_new_archive_idx();
 		if (idx == -1)
 			return;
-		archive[idx] = xa_new_archive_dialog ( filename , archive );
+		archive[idx] = xa_new_archive_dialog (filename,archive,TRUE);
 		if (archive[idx] == NULL)
 			return;
 		xa_add_page (archive[idx]);



More information about the Xfce4-commits mailing list