[Xfce4-commits] r25141 - in squeeze/trunk: . icons/48x48 icons/scalable libsqueeze

Stephan Arts stephan at xfce.org
Fri Mar 9 20:34:42 CET 2007


Author: stephan
Date: 2007-03-09 19:34:41 +0000 (Fri, 09 Mar 2007)
New Revision: 25141

Added:
   squeeze/trunk/icons/48x48/squeeze.png
   squeeze/trunk/icons/scalable/squeeze.svg
Modified:
   squeeze/trunk/Makefile.am
   squeeze/trunk/configure.in.in
   squeeze/trunk/icons/scalable/Makefile.am
   squeeze/trunk/libsqueeze/Makefile.am
   squeeze/trunk/libsqueeze/archive-command.c
   squeeze/trunk/libsqueeze/archive-command.h
   squeeze/trunk/libsqueeze/archive-support-compr.c
   squeeze/trunk/libsqueeze/archive-support-gnu-tar.c
   squeeze/trunk/libsqueeze/archive-support-rar.c
   squeeze/trunk/libsqueeze/archive-support-zip.c
   squeeze/trunk/libsqueeze/archive.c
   squeeze/trunk/libsqueeze/libsqueeze.c
Log:
Moved some code
Added Temporary icon
Fixed compr support object



Modified: squeeze/trunk/Makefile.am
===================================================================
--- squeeze/trunk/Makefile.am	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/Makefile.am	2007-03-09 19:34:41 UTC (rev 25141)
@@ -4,7 +4,7 @@
 	1.8								\
 	dist-bzip2
 
-SUBDIRS = pixmaps libsqueeze tests po docs src
+SUBDIRS = pixmaps libsqueeze tests po docs src icons
 
 wrapperdir = $(libexecdir)/thunar-archive-plugin/
 wrapper_SCRIPTS = squeeze.tap

Modified: squeeze/trunk/configure.in.in
===================================================================
--- squeeze/trunk/configure.in.in	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/configure.in.in	2007-03-09 19:34:41 UTC (rev 25141)
@@ -9,7 +9,7 @@
 dnl ***************************
 dnl *** Version information ***
 dnl ***************************
-m4_define([squeeze_verinfo], [0:1:0])
+m4_define([squeeze_verinfo], [0:2:0])
 m4_define([squeeze_version_branch], [])
 m4_define([squeeze_version_major], [0])
 m4_define([squeeze_version_minor], [1])

Added: squeeze/trunk/icons/48x48/squeeze.png
===================================================================
(Binary files differ)


Property changes on: squeeze/trunk/icons/48x48/squeeze.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: squeeze/trunk/icons/scalable/Makefile.am
===================================================================
--- squeeze/trunk/icons/scalable/Makefile.am	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/icons/scalable/Makefile.am	2007-03-09 19:34:41 UTC (rev 25141)
@@ -1,11 +1,11 @@
 
 # Inspired by Makefile.am from the Thunar file-manager
 
-appiconsdir = $(datadir)/icons/hicolor/scalable/apps/squeeze
-appicons_DATA = add-archive.svg extract-archive.svg
+# appiconsdir = $(datadir)/icons/hicolor/scalable/apps/squeeze
+# appicons_DATA = add-archive.svg extract-archive.svg
 
 iconsdir = $(datadir)/icons/hicolor/scalable/apps
 icons_DATA = squeeze.svg
 	
 
-EXTRA_DIST = $(appicons_DATA)
+# EXTRA_DIST = $(appicons_DATA)

Added: squeeze/trunk/icons/scalable/squeeze.svg
===================================================================
--- squeeze/trunk/icons/scalable/squeeze.svg	                        (rev 0)
+++ squeeze/trunk/icons/scalable/squeeze.svg	2007-03-09 19:34:41 UTC (rev 25141)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45"
+   width="48"
+   height="48"
+   version="1.0"
+   inkscape:export-filename="/home/stephan/squeeze/trunk/icons/48x48/squeeze.png"
+   inkscape:export-xdpi="30"
+   inkscape:export-ydpi="30"
+   sodipodi:docname="squeeze.svg"
+   sodipodi:docbase="/home/stephan/squeeze/trunk/icons/scalable"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   sodipodi:modified="TRUE">
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs5" />
+  <sodipodi:namedview
+     inkscape:window-height="608"
+     inkscape:window-width="924"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     guidetolerance="10.0"
+     gridtolerance="10.0"
+     objecttolerance="10.0"
+     borderopacity="1.0"
+     bordercolor="#666666"
+     pagecolor="#ffffff"
+     id="base"
+     width="48px"
+     height="48px"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:zoom="7.9166667"
+     inkscape:cx="24"
+     inkscape:cy="23.561432"
+     inkscape:window-x="344"
+     inkscape:window-y="116"
+     inkscape:current-layer="svg2" />
+  <g
+     id="g14823"
+     transform="matrix(1.2166758,0,0,1.2166758,-1.0254851,2.0669842)">
+    <g
+       transform="matrix(0.7988403,-0.6015431,-0.6015423,-0.7988393,16.52294,53.190378)"
+       id="g8951">
+      <path
+         sodipodi:type="arc"
+         style="fill:#afcf00;fill-opacity:0.94117647;stroke:#000000;stroke-width:0.65872216;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         id="path2161"
+         sodipodi:cx="32.71579"
+         sodipodi:cy="27.28421"
+         sodipodi:rx="13.263158"
+         sodipodi:ry="11.873684"
+         d="M 45.978948,27.28421 A 13.263158,11.873684 0 1 1 19.452632,27.28421 L 32.71579,27.28421 z"
+         transform="matrix(1.4698621,0,0,1.5993372,-24.606256,-22.064132)"
+         sodipodi:start="0"
+         sodipodi:end="3.1415927" />
+      <path
+         sodipodi:type="arc"
+         style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:1.5973413;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         id="path7980"
+         sodipodi:cx="7.9578948"
+         sodipodi:cy="28.610527"
+         sodipodi:rx="21.473684"
+         sodipodi:ry="5.1157894"
+         d="M 29.431579 28.610527 A 21.473684 5.1157894 0 1 1  -13.51579,28.610527 A 21.473684 5.1157894 0 1 1  29.431579 28.610527 z"
+         transform="matrix(0.9090817,0,0,0.3951169,16.247065,9.893001)" />
+    </g>
+    <path
+       sodipodi:nodetypes="cccc"
+       id="path12859"
+       d="M 12.884211,6.8392732 C 26.438867,-1.905292 36.126316,9.7815462 36.126316,9.7815462 L 30.479584,12.505262 C 30.479584,12.505262 20.629728,4.2589096 12.884211,6.8392732 z "
+       style="fill:#ffffff;fill-opacity:0.39215686;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    <path
+       id="path14803"
+       d="M 7.4526316,33.6 C 7.4526316,33.557895 7.4526316,33.515789 7.4526316,33.6 z "
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    <path
+       id="path14805"
+       d="M 38.021053,10.231579 C 38.021053,10.189474 38.021053,10.147368 38.021053,10.231579 z "
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+  </g>
+</svg>

Modified: squeeze/trunk/libsqueeze/Makefile.am
===================================================================
--- squeeze/trunk/libsqueeze/Makefile.am	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/Makefile.am	2007-03-09 19:34:41 UTC (rev 25141)
@@ -15,8 +15,8 @@
 	archive-support.c archive-support.h \
 	archive-support-zip.c archive-support-zip.h \
 	archive-support-rar.c archive-support-rar.h \
-	archive-support-gnu-tar.c archive-support-gnu-tar.h
-#	archive-support-compr.c archive-support-compr.h
+	archive-support-gnu-tar.c archive-support-gnu-tar.h \
+	archive-support-compr.c archive-support-compr.h
 
 libsqueeze_1_la_CFLAGS = \
 	$(GLIB_CFLAGS)  \

Modified: squeeze/trunk/libsqueeze/archive-command.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-command.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive-command.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -153,19 +153,16 @@
  * Returns: a new LSQArchiveCommand object
  */
 LSQArchiveCommand *
-lsq_archive_command_new(const gchar *comment, LSQArchive *archive, const gchar *command, gboolean safe, gboolean refresh)
+lsq_archive_command_new(const gchar *comment, const gchar *command, gboolean safe, gboolean refresh)
 {
 	LSQArchiveCommand *archive_command;
 
 	archive_command = g_object_new(lsq_archive_command_get_type(), NULL);
 
 	archive_command->command = g_strdup(command);
-	archive_command->archive = archive;
 	archive_command->safe = safe;
 	archive_command->refresh = refresh;
 
-	lsq_archive_enqueue_command(archive, archive_command);
-
 	return archive_command;
 }
 

Modified: squeeze/trunk/libsqueeze/archive-command.h
===================================================================
--- squeeze/trunk/libsqueeze/archive-command.h	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive-command.h	2007-03-09 19:34:41 UTC (rev 25141)
@@ -65,10 +65,10 @@
 
 GType               lsq_archive_command_get_type(void) G_GNUC_INTERNAL;
 LSQArchiveCommand  *lsq_archive_command_new(const gchar *comment, 
-                                            LSQArchive *archive,
                                             const gchar *command,
-																						gboolean safe,
-																						gboolean change) G_GNUC_INTERNAL;
+                                            gboolean safe,
+                                            gboolean change)
+                                            G_GNUC_INTERNAL;
 
 gboolean            lsq_archive_command_run(LSQArchiveCommand *archive_command) G_GNUC_INTERNAL;
 

Modified: squeeze/trunk/libsqueeze/archive-support-compr.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support-compr.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive-support-compr.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -21,6 +21,10 @@
 #include <glib-object.h>
 #include <thunar-vfs/thunar-vfs.h>
 
+#include "libsqueeze.h"
+#include "libsqueeze-module.h"
+#include "archive-iter.h"
+#include "archive-command.h"
 #include "archive.h"
 #include "archive-support.h"
 #include "archive-support-compr.h"
@@ -37,9 +41,6 @@
 void
 lsq_archive_support_compr_passive_watch(GPid pid, gint status, gpointer data);
 
-gboolean
-lsq_archive_support_compr_refresh_parse_output(GIOChannel *ioc, GIOCondition cond, gpointer data);
-
 static void
 lsq_archive_support_compr_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
 static void
@@ -49,7 +50,7 @@
 static gint lsq_archive_support_compr_refresh(LSQArchive *);
 
 static gboolean
-lsq_archive_support_compr_decompress_parse_output(GIOChannel *ioc, GIOCondition cond, gpointer data);
+lsq_archive_support_compr_decompress_parse_output(LSQArchiveCommand *archive_command);
 
 GType
 lsq_archive_support_compr_get_type ()
@@ -108,7 +109,7 @@
 	LSQArchiveSupportCompr *support;
 
 	support = g_object_new(LSQ_TYPE_ARCHIVE_SUPPORT_COMPR,
-												 NULL);
+	                       NULL);
 	
 	return LSQ_ARCHIVE_SUPPORT(support);
 }
@@ -149,7 +150,7 @@
 static gint
 lsq_archive_support_compr_extract(LSQArchive *archive, const gchar *extract_path, GSList *filenames)
 {
-	gchar *command = NULL;
+	gchar *command_skeleton = NULL;
 
 	if(!LSQ_IS_ARCHIVE_SUPPORT_COMPR(archive->support))
 	{
@@ -169,7 +170,7 @@
 			file_path = g_strconcat(extract_path, "/", filenames->data, NULL);
 		else
 		{
-			gchar *filename = g_strdup(lsq_archive_get_filename(archive));
+			gchar *filename = g_path_get_basename(lsq_archive_get_filename(archive));
 			gint len = strlen(filename);
 			if(g_str_has_suffix(lsq_archive_get_filename(archive), ".gz"))
 			{
@@ -183,31 +184,36 @@
 			{
 				filename[len-4] = '\0';
 			}
-			if(g_str_has_suffix(lsq_archive_get_filename(archive), ".Z"))
-			{
-				filename[len-2] = '\0';
-			}
 			if(g_str_has_suffix(lsq_archive_get_filename(archive), ".lzo"))
 			{
 				filename[len-4] = '\0';
 			}
+			if(g_str_has_suffix(lsq_archive_get_filename(archive), ".Z"))
+			{
+				filename[len-2] = '\0';
+			}
 			file_path = g_strconcat(extract_path, "/", filename, NULL);
 			g_free(filename);
 		}
 
 		if(!g_strcasecmp(thunar_vfs_mime_info_get_name(archive->mime_info), "application/x-gzip"))
-			command = g_strconcat("gunzip -c ", archive_path, NULL);
+			command_skeleton = g_strdup("gunzip -c %1$s");
 		if(!g_strcasecmp(thunar_vfs_mime_info_get_name(archive->mime_info), "application/x-bzip"))
-			command = g_strconcat("bunzip2 -c ", archive_path, NULL);
+			command_skeleton = g_strdup("bunzip2 -c %1$s");
 		if(!g_strcasecmp(thunar_vfs_mime_info_get_name(archive->mime_info), "application/x-compress"))
-			command = g_strconcat("uncompress -c ", archive_path, NULL);
+			command_skeleton = g_strdup("uncompress -c %1$s");
 		if(!g_strcasecmp(thunar_vfs_mime_info_get_name(archive->mime_info), "application/x-lzop"))
-			command = g_strconcat("lzop -dc ", archive_path, NULL);
+			command_skeleton = g_strdup("lzop -dc  %1$s");
 
 		g_unlink(file_path);
-		g_object_set_data(G_OBJECT(archive), LSQ_ARCHIVE_DEST_FILE, file_path);
-		lsq_execute(command, archive, lsq_archive_support_compr_passive_watch, NULL, lsq_archive_support_compr_decompress_parse_output, NULL);
+		LSQArchiveCommand *archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
+		lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_compr_decompress_parse_output);
+		g_object_set_data(G_OBJECT(archive_command), LSQ_ARCHIVE_DEST_FILE, file_path);
+		lsq_archive_enqueue_command(archive, archive_command);
+		
+		g_object_unref(archive_command);
 
+		g_free(command_skeleton);
 		g_free(archive_path);
 	}
 	return 0;
@@ -228,7 +234,7 @@
 	}
 	else
 	{
-		gchar *filename = g_strdup(lsq_archive_get_filename(archive));
+		gchar *filename = g_path_get_basename(lsq_archive_get_filename(archive));
 		gint len = strlen(filename);
 		if(g_str_has_suffix(lsq_archive_get_filename(archive), ".gz"))
 		{
@@ -243,49 +249,41 @@
 			filename[len-4] = '\0';
 		}
 		lsq_archive_add_file(archive, filename);
+		lsq_archive_refreshed(archive);
 		g_free(filename);
-		lsq_archive_set_status(archive, LSQ_ARCHIVESTATUS_IDLE);
 	}
 	return 0;
 }
 
 static gboolean
-lsq_archive_support_compr_decompress_parse_output(GIOChannel *ioc, GIOCondition cond, gpointer data)
+lsq_archive_support_compr_decompress_parse_output(LSQArchiveCommand *archive_command)
 {
-	FILE *out_file = NULL;
-	LSQArchive *archive = data;
+	GIOStatus status = G_IO_STATUS_NORMAL;
 	gchar *buf = g_new0(gchar, 1024);
 	guint read = 0;
 	GError *error = NULL;
+	FILE *out_file;
 
-	if(cond & (G_IO_PRI | G_IO_IN))
-	{
-		out_file = fopen(g_object_get_data(G_OBJECT(archive), LSQ_ARCHIVE_DEST_FILE), "ab");
-		if(!out_file)
-			g_critical("Could not open file");
+	const gchar *out_filename = g_object_get_data(G_OBJECT(archive_command), LSQ_ARCHIVE_DEST_FILE);
 
-		while(g_io_channel_read_chars(ioc, buf, 1024, (gsize *)&read, &error) == G_IO_STATUS_NORMAL)
-		{
-			if(read)
-			{
-				fwrite(buf, 1, read, out_file);
-			}
-			read = 0;
-		}
+	out_file = fopen(out_filename, "ab");
+	if(!out_file)
+		return FALSE; 
+	
+	status = lsq_archive_command_read_bytes(archive_command, 1, buf, 1024, (gsize *)&read, &error);
+	if(status == G_IO_STATUS_EOF)
+	{
 		fclose(out_file);
+		return TRUE;
 	}
-	g_free(buf);
-	if(cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL) )
-	{
-		g_io_channel_shutdown ( ioc,TRUE,NULL );
-		g_io_channel_unref (ioc);
 
-		if(!(cond & G_IO_ERR))
-			lsq_archive_set_status(archive, LSQ_ARCHIVESTATUS_IDLE);
-		else
-			lsq_archive_set_status(archive, LSQ_ARCHIVESTATUS_ERROR);
-		return FALSE; 
+	if(read)
+	{
+		fwrite(buf, 1, read, out_file);
 	}
+	fclose(out_file);
+	g_free(buf);
+
 	return TRUE;
 }
 

Modified: squeeze/trunk/libsqueeze/archive-support-gnu-tar.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support-gnu-tar.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive-support-gnu-tar.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -64,11 +64,11 @@
 void
 lsq_archive_support_gnu_tar_class_init(LSQArchiveSupportGnuTarClass *supportclass);
 
-gboolean
+static gboolean
 lsq_archive_support_gnu_tar_refresh_parse_output(LSQArchiveCommand *archive_command);
-gboolean
+static gboolean
 lsq_archive_support_gnu_tar_compress_parse_output(LSQArchiveCommand *archive_command);
-gboolean
+static gboolean
 lsq_archive_support_gnu_tar_decompress_parse_output(LSQArchiveCommand *archive_command);
 
 void
@@ -291,9 +291,10 @@
 			if(!g_strcasecmp(thunar_vfs_mime_info_get_name(archive->mime_info), "application/x-tzo"))
 				options = "--use-compress-program=lzop";
 
-			archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 			g_object_set_data(G_OBJECT(archive_command), "files", g_strdup(files));
 			g_object_set_data(G_OBJECT(archive_command), "options", g_strdup(options));
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_free(command_skeleton);
 		}
 		else
@@ -308,20 +309,22 @@
 				command_skeleton = g_strdup("lzop -dc %1$s");
 			if(command_skeleton)
 			{
-				archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+				archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 				lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_gnu_tar_decompress_parse_output);
 				tmp_file = g_strconcat(lsq_tmp_dir, "/squeeze-XXXXXX.tar" , NULL);
 				g_mkstemp(tmp_file);
 				g_object_set_data(G_OBJECT(archive_command), LSQ_ARCHIVE_TEMP_FILE, tmp_file);
+				lsq_archive_enqueue_command(archive, archive_command);
 				g_free(command_skeleton);
 			}
 
 			command_skeleton = g_strconcat(GNU_TAR_APP_NAME, " %3$s -r -f %1$s %2$s", NULL);
-			archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 			if(tmp_file)
 				g_object_set_data(G_OBJECT(archive_command), "archive", g_strdup(tmp_file));
 			g_object_set_data(G_OBJECT(archive_command), "files", g_strdup(files));
 			g_object_set_data(G_OBJECT(archive_command), "options", g_strdup(options));
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_free(command_skeleton);
 			command_skeleton = NULL;
 
@@ -335,23 +338,16 @@
 				command_skeleton = g_strdup("lzop -c %1$s");
 			if(command_skeleton)
 			{
-				archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+				archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 				lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_gnu_tar_compress_parse_output);
 				if(tmp_file)
 					g_object_set_data(G_OBJECT(archive_command), "archive", g_strdup(tmp_file));
 				g_object_set_data(G_OBJECT(archive_command), LSQ_ARCHIVE_TEMP_FILE, g_strdup(tmp_file));
+				lsq_archive_enqueue_command(archive, archive_command);
 				g_free(command_skeleton);
 			}
 		}
 		g_free(files);
-		archive_command = lsq_archive_get_front_command(archive);
-		if(archive_command)
-		{
-			lsq_archive_command_run(archive_command);
-			g_object_unref(archive_command);
-		}
-		else
-			return 1;
 	}
 	return 0;
 }
@@ -389,10 +385,10 @@
 			options = g_strconcat(options, " -C ", extract_path, NULL);
 
 
-		archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+		archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 		g_object_set_data(G_OBJECT(archive_command), "files", g_strdup(files));
 		g_object_set_data(G_OBJECT(archive_command), "options", g_strdup(options));
-		lsq_archive_command_run(archive_command);
+		lsq_archive_enqueue_command(archive, archive_command);
 		g_object_unref(archive_command);
 		g_free(command_skeleton);
 		g_free(files);
@@ -439,20 +435,22 @@
 			command_skeleton = g_strdup("lzop -dc %1$s");
 		if(command_skeleton)
 		{
-			archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 			lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_gnu_tar_decompress_parse_output);
 			tmp_file = g_strconcat(lsq_tmp_dir, "/squeeze-XXXXXX.tar" , NULL);
 			g_mkstemp(tmp_file);
 			g_object_set_data(G_OBJECT(archive_command), LSQ_ARCHIVE_TEMP_FILE, tmp_file);
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_free(command_skeleton);
 		}
 
 		command_skeleton = g_strconcat(GNU_TAR_APP_NAME, " %3$s -f %1$s --delete %2$s", NULL);
-		archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+		archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 		if(tmp_file)
 			g_object_set_data(G_OBJECT(archive_command), "archive", g_strdup(tmp_file));
 		g_object_set_data(G_OBJECT(archive_command), "files", g_strdup(files));
 		g_object_set_data(G_OBJECT(archive_command), "options", g_strdup(options));
+		lsq_archive_enqueue_command(archive, archive_command);
 		g_free(command_skeleton);
 		command_skeleton = NULL;
 
@@ -466,22 +464,15 @@
 			command_skeleton = g_strdup("lzop -c %1$s");
 		if(command_skeleton)
 		{
-			archive_command = lsq_archive_command_new("", archive, command_skeleton, FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", command_skeleton, FALSE, TRUE);
 			lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_gnu_tar_compress_parse_output);
 			if(tmp_file)
 				g_object_set_data(G_OBJECT(archive_command), "archive", g_strdup(tmp_file));
 			g_object_set_data(G_OBJECT(archive_command), LSQ_ARCHIVE_TEMP_FILE, g_strdup(tmp_file));
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_free(command_skeleton);
 		}
 		g_free(files);
-		archive_command = lsq_archive_get_front_command(archive);
-		if(archive_command)
-		{
-			lsq_archive_command_run(archive_command);
-			g_object_unref(archive_command);
-		}
-		else
-			return 1;
 	}
 	return 0;
 }
@@ -532,16 +523,16 @@
 		}
 
 		gchar *command_skeleton = g_strconcat(GNU_TAR_APP_NAME, " -tvvf %1$s", NULL);
-		archive_command = lsq_archive_command_new("", archive, command_skeleton, TRUE, TRUE);
+		archive_command = lsq_archive_command_new("", command_skeleton, TRUE, TRUE);
 		g_free(command_skeleton);
 		lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_gnu_tar_refresh_parse_output);
-		lsq_archive_command_run(archive_command);
+		lsq_archive_enqueue_command(archive, archive_command);
 		g_object_unref(archive_command);
 	}
 	return 0;
 }
 
-gboolean
+static gboolean
 lsq_archive_support_gnu_tar_refresh_parse_output(LSQArchiveCommand *archive_command)
 {
 	gchar *line = NULL;
@@ -658,7 +649,7 @@
 	return TRUE;
 }
 
-gboolean
+static gboolean
 lsq_archive_support_gnu_tar_decompress_parse_output(LSQArchiveCommand *archive_command)
 {
 	GIOStatus status = G_IO_STATUS_NORMAL;
@@ -690,7 +681,7 @@
 	return TRUE;
 }
 
-gboolean
+static gboolean
 lsq_archive_support_gnu_tar_compress_parse_output(LSQArchiveCommand *archive_command)
 {
 	GIOStatus status = G_IO_STATUS_NORMAL;

Modified: squeeze/trunk/libsqueeze/archive-support-rar.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support-rar.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive-support-rar.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -259,10 +259,10 @@
 		{
 			gchar *files = lsq_concat_filenames(filenames);
 
-			archive_command = lsq_archive_command_new("", archive, "rar %3$s a %1$s %2$s", FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", "rar %3$s a %1$s %2$s", FALSE, TRUE);
 			g_object_set_data(G_OBJECT(archive_command), "files", g_strdup(files));
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_free(files);
-			lsq_archive_command_run(archive_command);
 			g_object_unref(archive_command);
 		}
 	}
@@ -292,10 +292,10 @@
 			if(extract_path)
 				dest_path = g_shell_quote(extract_path);
 
-			archive_command = lsq_archive_command_new("", archive, "unrar x -y %1$s %2$s %3$s", TRUE, FALSE);
+			archive_command = lsq_archive_command_new("", "unrar x -y %1$s %2$s %3$s", TRUE, FALSE);
 			g_object_set_data(G_OBJECT(archive_command), "files", files);
 			g_object_set_data(G_OBJECT(archive_command), "options", dest_path);
-			lsq_archive_command_run(archive_command);
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_object_unref(archive_command);
 			g_free(dest_path);
 			g_free(files);
@@ -324,9 +324,9 @@
 		{
 			gchar *files = lsq_concat_filenames(filenames);
 
-			archive_command = lsq_archive_command_new("", archive, "rar d %3$s %1$s %2$s", TRUE, FALSE);
+			archive_command = lsq_archive_command_new("", "rar d %3$s %1$s %2$s", TRUE, FALSE);
 			g_object_set_data(G_OBJECT(archive_command), "files", files);
-			lsq_archive_command_run(archive_command);
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_object_unref(archive_command);
 			g_free(files);
 		}	
@@ -390,9 +390,9 @@
 			i++;
 		}
 		g_object_set_data(G_OBJECT(archive), LSQ_ARCHIVE_RAR_STATUS, GINT_TO_POINTER(REFRESH_STATUS_INIT));
-		archive_command = lsq_archive_command_new("", archive, "unrar v %1$s", TRUE, TRUE);
+		archive_command = lsq_archive_command_new("", "unrar v %1$s", TRUE, TRUE);
 		lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_rar_refresh_parse_output);
-		lsq_archive_command_run(archive_command);
+		lsq_archive_enqueue_command(archive, archive_command);
 		g_object_unref(archive_command);
 	}
 	return 0;

Modified: squeeze/trunk/libsqueeze/archive-support-zip.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support-zip.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive-support-zip.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -219,11 +219,11 @@
 			gchar *files = lsq_concat_filenames(filenames);
 			gchar *options = NULL;
 
-			archive_command = lsq_archive_command_new("", archive, "zip %3$s -r %1$s %2$s", FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", "zip %3$s -r %1$s %2$s", FALSE, TRUE);
 			g_object_set_data(G_OBJECT(archive_command), "files", g_strdup(files));
 			g_object_set_data(G_OBJECT(archive_command), "options", options);
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_free(files);
-			lsq_archive_command_run(archive_command);
 			g_object_unref(archive_command);
 		}
 	}
@@ -256,10 +256,10 @@
 
 			gchar *options = g_strconcat(" -d ", dest_path, NULL);
 
-			archive_command = lsq_archive_command_new("", archive, "unzip -o %1$s %2$s %3$s", TRUE, FALSE);
+			archive_command = lsq_archive_command_new("", "unzip -o %1$s %2$s %3$s", TRUE, FALSE);
 			g_object_set_data(G_OBJECT(archive_command), "files", files);
 			g_object_set_data(G_OBJECT(archive_command), "options", options);
-			lsq_archive_command_run(archive_command);
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_object_unref(archive_command);
 			g_free(dest_path);
 			g_free(options);
@@ -297,9 +297,9 @@
 				file_iters = g_slist_next(file_iters);
 			}
 
-			archive_command = lsq_archive_command_new("", archive, "zip -d %1$s %2$s", FALSE, TRUE);
+			archive_command = lsq_archive_command_new("", "zip -d %1$s %2$s", FALSE, TRUE);
 			g_object_set_data(G_OBJECT(archive_command), "files", files);
-			lsq_archive_command_run(archive_command);
+			lsq_archive_enqueue_command(archive, archive_command);
 			g_object_unref(archive_command);
 			g_free(files);
 		}
@@ -354,9 +354,9 @@
 			lsq_archive_set_entry_property_type(archive, i, G_TYPE_STRING, _("Checksum"));
 			i++;
 		}
-		archive_command = lsq_archive_command_new("", archive, "unzip -lv -qq %1$s", TRUE, TRUE);
+		archive_command = lsq_archive_command_new("", "unzip -lv -qq %1$s", TRUE, TRUE);
 		lsq_archive_command_set_parse_func(archive_command, 1, lsq_archive_support_zip_refresh_parse_output);
-		lsq_archive_command_run(archive_command);
+		lsq_archive_enqueue_command(archive, archive_command);
 		g_object_unref(archive_command);
 	}
 	return 0;

Modified: squeeze/trunk/libsqueeze/archive.c
===================================================================
--- squeeze/trunk/libsqueeze/archive.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/archive.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -441,6 +441,9 @@
 lsq_archive_enqueue_command(LSQArchive *archive, LSQArchiveCommand *command)
 {
 	archive->command_queue = g_slist_append(archive->command_queue, command);
+	command->archive = archive;
+	if(archive->command_queue->data == command)
+		lsq_archive_command_run(command);
 }
 
 void

Modified: squeeze/trunk/libsqueeze/libsqueeze.c
===================================================================
--- squeeze/trunk/libsqueeze/libsqueeze.c	2007-03-09 10:10:34 UTC (rev 25140)
+++ squeeze/trunk/libsqueeze/libsqueeze.c	2007-03-09 19:34:41 UTC (rev 25141)
@@ -42,10 +42,10 @@
 	lsq_mime_database = thunar_vfs_mime_database_get_default();
 	lsq_register_support(lsq_archive_support_zip_new());
 	lsq_register_support(lsq_archive_support_gnu_tar_new());
+	lsq_register_support(lsq_archive_support_compr_new());
 
 /*
 	lsq_register_support(lsq_archive_support_rar_new());
-	lsq_register_support(lsq_archive_support_compr_new());
 	*/
 
 	lsq_relative_base_path = thunar_vfs_path_new(current_dir, NULL);



More information about the Xfce4-commits mailing list