? .pass-diff.swp
? pass-diff
? pass-diff2
? patch-chmod
Index: file-data.h
===================================================================
RCS file: /cvs/gnome/file-roller/src/file-data.h,v
retrieving revision 1.4
diff -u -p -r1.4 file-data.h
--- file-data.h	24 Oct 2005 18:32:00 -0000	1.4
+++ file-data.h	11 Apr 2006 21:50:08 -0000
@@ -44,6 +44,8 @@ typedef struct {
 				       * a directory. */
 	char       *list_name;        /* The string visualized in the list
 				       * view. */
+	gboolean	encrypted;        /* Wether this file is password 
+					   * encrypted */
 } FileData;
 
 #define FR_TYPE_FILE_DATA (file_data_get_type ())
Index: fr-command-7z.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-7z.c,v
retrieving revision 1.13
diff -u -p -r1.13 fr-command-7z.c
--- fr-command-7z.c	4 Apr 2006 17:35:17 -0000	1.13
+++ fr-command-7z.c	11 Apr 2006 21:50:09 -0000
@@ -168,6 +168,7 @@ list__process_line (char     *line, 
 	g_free (name_field);
 
 	fdata->link = NULL;
+	fdata->encrypted = FALSE;
 		
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
Index: fr-command-ar.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-ar.c,v
retrieving revision 1.5
diff -u -p -r1.5 fr-command-ar.c
--- fr-command-ar.c	27 Nov 2005 16:54:08 -0000	1.5
+++ fr-command-ar.c	11 Apr 2006 21:50:09 -0000
@@ -181,6 +181,7 @@ process_line (char     *line, 
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
 	fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
+	fdata->encrypted = FALSE;
 
 	if (*fdata->name == 0)
 		file_data_free (fdata);
Index: fr-command-arj.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-arj.c,v
retrieving revision 1.13
diff -u -p -r1.13 fr-command-arj.c
--- fr-command-arj.c	9 Apr 2006 12:42:05 -0000	1.13
+++ fr-command-arj.c	11 Apr 2006 21:50:10 -0000
@@ -141,9 +141,10 @@ list__process_line (char     *line, 
 
 		/* read file info. */
 		
-		fields = split_line (line, 7);
+		fields = split_line (line, 10);
 		fdata->size = g_ascii_strtoull (fields[2], NULL, 10);
 		fdata->modified = mktime_from_string (fields[5], fields[6]); 
+		fdata->encrypted = (g_ascii_strcasecmp (fields[9], "11") == 0);
 		g_strfreev (fields);
 		
 		if (*fdata->name == 0)
Index: fr-command-cfile.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-cfile.c,v
retrieving revision 1.19
diff -u -p -r1.19 fr-command-cfile.c
--- fr-command-cfile.c	14 Jan 2006 13:55:22 -0000	1.19
+++ fr-command-cfile.c	11 Apr 2006 21:50:10 -0000
@@ -138,6 +138,7 @@ list__process_line (char     *line, 
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
 	fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
+	fdata->encrypted = FALSE;
 	
 	if (*fdata->name == 0)
 		file_data_free (fdata);
Index: fr-command-iso.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-iso.c,v
retrieving revision 1.11
diff -u -p -r1.11 fr-command-iso.c
--- fr-command-iso.c	9 Dec 2005 23:18:15 -0000	1.11
+++ fr-command-iso.c	11 Apr 2006 21:50:11 -0000
@@ -120,6 +120,7 @@ list__process_line (char     *line, 
 		fdata->path = remove_level_from_path (fdata->full_path);
 		fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
 		comm->file_list = g_list_prepend (comm->file_list, fdata);
+		fdata->encrypted = FALSE;
 	}
 }
 
Index: fr-command-lha.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-lha.c,v
retrieving revision 1.14
diff -u -p -r1.14 fr-command-lha.c
--- fr-command-lha.c	9 Dec 2005 23:18:15 -0000	1.14
+++ fr-command-lha.c	11 Apr 2006 21:50:12 -0000
@@ -185,6 +185,7 @@ process_line (char     *line, 
 	}
 
 	fdata->link = NULL;
+	fdata->encrypted = FALSE;
 
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
Index: fr-command-rar.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-rar.c,v
retrieving revision 1.24
diff -u -p -r1.24 fr-command-rar.c
--- fr-command-rar.c	3 Apr 2006 09:47:17 -0000	1.24
+++ fr-command-rar.c	11 Apr 2006 21:50:12 -0000
@@ -94,7 +94,7 @@ process_line (char     *line, 
 	FRCommandRar  *rar_comm = FR_COMMAND_RAR (comm);
 	char         **fields;
 	const char    *name_field;
-	gboolean       encrypted;      /* unused */
+	gboolean       encrypted;
 
 	g_return_if_fail (line != NULL);
 
@@ -135,6 +135,7 @@ process_line (char     *line, 
 		fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 		fdata->path = remove_level_from_path (fdata->full_path);
 		fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
+		fdata->encrypted = encrypted;
 
 	} else {
 		FileData *fdata;
Index: fr-command-rpm.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-rpm.c,v
retrieving revision 1.10
diff -u -p -r1.10 fr-command-rpm.c
--- fr-command-rpm.c	9 Dec 2005 23:18:15 -0000	1.10
+++ fr-command-rpm.c	11 Apr 2006 21:50:12 -0000
@@ -116,6 +116,7 @@ list__process_line (char     *line, 
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
 	fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
+	fdata->encrypted = FALSE;
 
 	if (*fdata->name == 0)
 		file_data_free (fdata);
Index: fr-command-tar.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-tar.c,v
retrieving revision 1.39
diff -u -p -r1.39 fr-command-tar.c
--- fr-command-tar.c	9 Apr 2006 08:28:20 -0000	1.39
+++ fr-command-tar.c	11 Apr 2006 21:50:13 -0000
@@ -175,6 +175,7 @@ process_line (char     *line, 
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
 	fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
+	fdata->encrypted = FALSE;
 
 	if (*fdata->name == 0)
 		file_data_free (fdata);
Index: fr-command-unstuff.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-unstuff.c,v
retrieving revision 1.12
diff -u -p -r1.12 fr-command-unstuff.c
--- fr-command-unstuff.c	27 Nov 2005 16:54:08 -0000	1.12
+++ fr-command-unstuff.c	11 Apr 2006 21:50:13 -0000
@@ -171,6 +171,7 @@ process_line (char     *line, 
 	fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
 	fdata->size = 0;
 	fdata->modified = time (NULL);
+	fdata->encrypted = FALSE;
 
 	comm->file_list = g_list_prepend (comm->file_list, fdata);
 
Index: fr-command-zip.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-zip.c,v
retrieving revision 1.30
diff -u -p -r1.30 fr-command-zip.c
--- fr-command-zip.c	9 Apr 2006 08:28:20 -0000	1.30
+++ fr-command-zip.c	11 Apr 2006 21:50:14 -0000
@@ -35,8 +35,7 @@
 #include "fr-command.h"
 #include "fr-command-zip.h"
 
-#define EMPTY_ARCHIVE_WARNING        "zipfile is empty"
-#define EMPTY_ARCHIVE_WARNING_LENGTH 16
+#define EMPTY_ARCHIVE_WARNING        "Empty zipfile."
 
 static void fr_command_zip_class_init  (FRCommandZipClass *class);
 static void fr_command_zip_init        (FRCommand         *afile);
@@ -50,43 +49,36 @@ static FRCommandClass *parent_class = NU
 /* -- list -- */
 
 static time_t
-mktime_from_string (char *date_s, 
-		    char *time_s)
+mktime_from_string (char *datetime_s)
 {
 	struct tm   tm = {0, };
-	char      **fields;
+
+	char *date = datetime_s;
+	char *time = datetime_s + 9;
 
 	/* date */
 
-	fields = g_strsplit (date_s, "-", 3);
-	if (fields[0] != NULL) {
-		tm.tm_mon = atoi (fields[0]) - 1;
-		if (fields[1] != NULL) {
-			tm.tm_mday = atoi (fields[1]);
-			if (fields[2] != NULL) { 
-				/* warning : this will work until 2075 ;) */
-				int y = atoi (fields[2]);
-				if (y >= 75)
-					tm.tm_year = atoi (fields[2]);
-				else
-					tm.tm_year = 100 + atoi (fields[2]);
-			}
-		}
-	}
-	g_strfreev (fields);
+	gchar *year = g_strndup (date, 4);
+	gchar *month = g_strndup (date+4, 2);
+	gchar *day = g_strndup (date+6, 2);
+	tm.tm_year = atoi (year) - 1900;
+	tm.tm_mon = atoi (month) - 1;
+	tm.tm_mday = atoi (day);
+	g_free (year);
+	g_free (month);
+	g_free (day);
 
 	/* time */
 
-	fields = g_strsplit (time_s, ":", 3);
-	if (fields[0] != NULL) {
-		tm.tm_hour = atoi (fields[0]);
-		if (fields[1] != NULL) {
-			tm.tm_min = atoi (fields[1]);
-			if (fields[2] != NULL)
-				tm.tm_sec = atoi (fields[2]);
-		}
-	}
-	g_strfreev (fields);
+	gchar *hour = g_strndup (time, 2);
+	gchar *min = g_strndup (time+2, 2);
+	gchar *sec = g_strndup (time+4, 2);
+	tm.tm_hour = atoi (hour) - 1;
+	tm.tm_min = atoi (min);
+	tm.tm_sec = atoi (sec);
+	g_free(hour);
+	g_free(min);
+	g_free(sec);
 
 	return mktime (&tm);
 }
@@ -161,20 +153,25 @@ list__process_line (char     *line, 
 	if (line_l == 0)
 		return;
 
-	if (line_l > EMPTY_ARCHIVE_WARNING_LENGTH) 
-		if (strcmp (line + line_l - EMPTY_ARCHIVE_WARNING_LENGTH, 
-			    EMPTY_ARCHIVE_WARNING) == 0) {
-			FR_COMMAND_ZIP (comm)->is_empty = TRUE;
-			return;
-		}
+	if (strcmp (line,
+		    EMPTY_ARCHIVE_WARNING) == 0) {
+		FR_COMMAND_ZIP (comm)->is_empty = TRUE;
+		return;
+	}
+
+	/* check whether this is the first or last line zipinfo
+	   * gave. */
+	if ((line[0] == 'A') || (line[2] == 'f'))
+		return;
 
 	/**/
 
 	fdata = file_data_new ();
 
 	fields = split_line (line, 7);
-	fdata->size = g_ascii_strtoull (fields[0], NULL, 10);
-	fdata->modified = mktime_from_string (fields[4], fields[5]);
+	fdata->size = g_ascii_strtoull (fields[3], NULL, 10);
+	fdata->modified = mktime_from_string (fields[6]);
+	fdata->encrypted = (*fields[4] == 'B') || (*fields[4] == 'T');
 	g_strfreev (fields);
 
 	/* Full path */
@@ -245,9 +242,9 @@ fr_command_zip_list (FRCommand *comm)
 				      comm);
 
 	fr_process_begin_command (comm->process, "unzip");
-	fr_process_add_arg (comm->process, "-qq");
-	fr_process_add_arg (comm->process, "-v");
-	fr_process_add_arg (comm->process, "-l");
+	fr_process_add_arg (comm->process, "-Z");
+	fr_process_add_arg (comm->process, "-T");
+	fr_process_add_arg (comm->process, "-s");
 	add_filename_arg (comm);
 	fr_process_end_command (comm->process);
 	fr_process_start (comm->process);
Index: fr-command-zoo.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/fr-command-zoo.c,v
retrieving revision 1.11
diff -u -p -r1.11 fr-command-zoo.c
--- fr-command-zoo.c	9 Dec 2005 23:18:15 -0000	1.11
+++ fr-command-zoo.c	11 Apr 2006 21:50:15 -0000
@@ -212,6 +212,7 @@ process_zoo_line (char     *line, 
 	fdata->name = g_strdup (file_name_from_path (fdata->full_path));
 	fdata->path = remove_level_from_path (fdata->full_path);
 	fdata->type = gnome_vfs_mime_type_from_name_or_default (fdata->name, GNOME_VFS_MIME_TYPE_UNKNOWN);
+	fdata->encrypted = FALSE;
 
 	if (*fdata->name == 0)
 		file_data_free (fdata);
Index: window.c
===================================================================
RCS file: /cvs/gnome/file-roller/src/window.c,v
retrieving revision 1.162
diff -u -p -r1.162 window.c
--- window.c	8 Apr 2006 21:10:27 -0000	1.162
+++ window.c	11 Apr 2006 21:50:25 -0000
@@ -488,6 +488,24 @@ get_icon (GtkWidget *widget,
 	char        *icon_path = NULL;
 	const char  *mime_type;
        
+	/* If the file is encrypted, we show a proper emblem */
+	   
+	if (fdata->encrypted) {
+		const GnomeIconData *icon_data;
+		int base_size;
+		char *emblem_path;
+		GdkPixbuf *emblem;
+
+		emblem_path = gnome_icon_theme_lookup_icon (icon_theme, 
+							  "emblem-nowrite",
+							  icon_size,
+							  &icon_data,
+							  &base_size);
+		if (emblem_path != NULL)
+			pixbuf = load_icon_file (emblem_path, icon_size);
+		return pixbuf;
+	}
+
 	if (fdata->is_dir)
 		mime_type = MIME_TYPE_DIRECTORY;
 	else
@@ -563,6 +581,7 @@ get_icon (GtkWidget *widget,
 
 	g_free (icon_path);
 	g_free (icon_name);
+	
 
 	return pixbuf;
 }
