Author: stephan
Date: 2008-03-19 22:31:29 +0000 (Wed, 19 Mar 2008)
New Revision: 26688

Modified:
   squeeze/trunk/data/unzip.squeeze
   squeeze/trunk/libsqueeze/archive-iter.c
   squeeze/trunk/libsqueeze/archive.c
   squeeze/trunk/libsqueeze/command-queue.c
   squeeze/trunk/libsqueeze/parser-context.c
   squeeze/trunk/libsqueeze/scanf-parser.c
   squeeze/trunk/libsqueeze/support-reader.c
   squeeze/trunk/libsqueeze/support-template.c
Log:
Did some cleanup



Modified: squeeze/trunk/data/unzip.squeeze
===================================================================
--- squeeze/trunk/data/unzip.squeeze    2008-03-18 20:57:45 UTC (rev 26687)
+++ squeeze/trunk/data/unzip.squeeze    2008-03-19 22:31:29 UTC (rev 26688)
@@ -7,8 +7,8 @@
 
 [application/x-zip]
 X-Squeeze-Requires=unzip
-X-Squeeze-Refresh=unzip
-X-Squeeze-Extract=unzip
+X-Squeeze-Refresh=unzip %a
+X-Squeeze-Extract=unzip %a %F
 
 [Squeeze-Extract]
 X-Squeeze-Options=Password;Overwrite

Modified: squeeze/trunk/libsqueeze/archive-iter.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-iter.c     2008-03-18 20:57:45 UTC (rev 
26687)
+++ squeeze/trunk/libsqueeze/archive-iter.c     2008-03-19 22:31:29 UTC (rev 
26688)
@@ -1439,6 +1439,7 @@
 
        for(i=0; i < (lsq_archive_n_entry_properties(archive) - 
LSQ_ARCHIVE_PROP_USER); ++i)
        {
+        g_debug("i: %d", i);
                switch(lsq_archive_get_entry_property_type(archive, 
i+LSQ_ARCHIVE_PROP_USER))
                {
                        case G_TYPE_STRING:

Modified: squeeze/trunk/libsqueeze/archive.c
===================================================================
--- squeeze/trunk/libsqueeze/archive.c  2008-03-18 20:57:45 UTC (rev 26687)
+++ squeeze/trunk/libsqueeze/archive.c  2008-03-19 22:31:29 UTC (rev 26688)
@@ -411,12 +411,15 @@
 gboolean
 lsq_archive_operate(LSQArchive *archive, LSQCommandType type, const gchar 
**files)
 {
-    g_debug("%s", __FUNCTION__);
+    g_return_val_if_fail(archive, FALSE);
+
     LSQSupportTemplate *s_template = archive->priv->s_template;
 
     switch (type)
     {
         case LSQ_COMMAND_TYPE_ADD:
+            lsq_command_queue_execute(s_template->add_cmd_queue, archive, 
files, s_template->parser);
+            break;
         case LSQ_COMMAND_TYPE_REMOVE:
         case LSQ_COMMAND_TYPE_EXTRACT:
         case LSQ_COMMAND_TYPE_OPEN:
@@ -424,11 +427,12 @@
                return FALSE;
             break;
         case LSQ_COMMAND_TYPE_REFRESH:
-            return FALSE;
+            lsq_command_queue_execute(s_template->refresh_cmd_queue, archive, 
files, s_template->parser);
             break;
         default:
             return FALSE;
             break;
     }
+    return TRUE;
 }
 

Modified: squeeze/trunk/libsqueeze/command-queue.c
===================================================================
--- squeeze/trunk/libsqueeze/command-queue.c    2008-03-18 20:57:45 UTC (rev 
26687)
+++ squeeze/trunk/libsqueeze/command-queue.c    2008-03-19 22:31:29 UTC (rev 
26688)
@@ -64,7 +64,7 @@
   } state;
 };
 
-static void build_queue(LSQCommandQueue *queue, const gchar *commant_string);
+static void build_queue(LSQCommandQueue *queue, const gchar *command_string);
 
 G_DEFINE_TYPE(LSQCommandQueue, lsq_command_queue, G_TYPE_OBJECT);
 

Modified: squeeze/trunk/libsqueeze/parser-context.c
===================================================================
--- squeeze/trunk/libsqueeze/parser-context.c   2008-03-18 20:57:45 UTC (rev 
26687)
+++ squeeze/trunk/libsqueeze/parser-context.c   2008-03-19 22:31:29 UTC (rev 
26688)
@@ -51,7 +51,7 @@
        object_class->set_property = lsq_parser_context_set_property;
        object_class->get_property = lsq_parser_context_get_property;
 
-       pspec = g_param_spec_object("archive", NULL, NULL, LSQ_TYPE_ARCHIVE, 
G_PARAM_READABLE|G_PARAM_CONSTRUCT_ONLY);
+       pspec = g_param_spec_object("archive", NULL, NULL, LSQ_TYPE_ARCHIVE, 
G_PARAM_READABLE|G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY);
        g_object_class_install_property(object_class, 
LSQ_PARSER_CONTEXT_PROPERTY_ARCHIVE, pspec);
 }
 
@@ -84,8 +84,8 @@
        
        g_return_val_if_fail(LSQ_IS_ARCHIVE(archive), NULL);
 
-       ctx = g_object_new(LSQ_TYPE_PARSER_CONTEXT, "archive", archive);
-
+       ctx = g_object_new(LSQ_TYPE_PARSER_CONTEXT, "archive", archive, NULL);
+    
        return ctx;
 }
 

Modified: squeeze/trunk/libsqueeze/scanf-parser.c
===================================================================
--- squeeze/trunk/libsqueeze/scanf-parser.c     2008-03-18 20:57:45 UTC (rev 
26687)
+++ squeeze/trunk/libsqueeze/scanf-parser.c     2008-03-19 22:31:29 UTC (rev 
26688)
@@ -96,8 +96,7 @@
 {
   LSQScanfParserContext *ctx;
 
-       ctx = g_object_new(lsq_scanf_parser_context_get_type(), "archive", 
archive);
-
+       ctx = g_object_new(lsq_scanf_parser_context_get_type(), "archive", 
archive, NULL);
   guint n_props = lsq_parser_n_properties(LSQ_PARSER(parser));
   ctx->data_store = g_new0(union _data_store, n_props);
   ctx->props_store = g_new0(gpointer, n_props);

Modified: squeeze/trunk/libsqueeze/support-reader.c
===================================================================
--- squeeze/trunk/libsqueeze/support-reader.c   2008-03-18 20:57:45 UTC (rev 
26687)
+++ squeeze/trunk/libsqueeze/support-reader.c   2008-03-19 22:31:29 UTC (rev 
26688)
@@ -183,12 +183,24 @@
                s_template->mime_info = 
thunar_vfs_mime_database_get_info(lsq_mime_database, _mime_types[i]);
                s_template->id = (const gchar *)factory->id;
 
-               s_template->new_cmd_queue        = 
lsq_command_queue_new(xfce_rc_read_entry(rc, "X-Squeeze-New", NULL));
-               s_template->add_cmd_queue        = 
lsq_command_queue_new(xfce_rc_read_entry(rc, "X-Squeeze-Add", NULL));
-               s_template->remove_cmd_queue  = 
lsq_command_queue_new(xfce_rc_read_entry(rc, "X-Squeeze-Remove", NULL));
-               s_template->extract_cmd_queue = 
lsq_command_queue_new(xfce_rc_read_entry(rc, "X-Squeeze-Extract", NULL));
-               s_template->refresh_cmd_queue = 
lsq_command_queue_new(xfce_rc_read_entry(rc, "X-Squeeze-Refresh", NULL));
+        const gchar *new_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-New", 
NULL);
+        const gchar *add_str_queue = xfce_rc_read_entry(rc, "X-Squeeze-Add", 
NULL);
+        const gchar *remove_str_queue = xfce_rc_read_entry(rc, 
"X-Squeeze-Remove", NULL);
+        const gchar *extract_str_queue = xfce_rc_read_entry(rc, 
"X-Squeeze-Extract", NULL);
+        const gchar *refresh_str_queue = xfce_rc_read_entry(rc, 
"X-Squeeze-Refresh", NULL);
 
+       
+        if (new_str_queue)    
+            s_template->new_cmd_queue     = 
lsq_command_queue_new(new_str_queue);
+        if (add_str_queue)
+                   s_template->add_cmd_queue     = 
lsq_command_queue_new(add_str_queue);
+        if (remove_str_queue)
+                   s_template->remove_cmd_queue  = 
lsq_command_queue_new(remove_str_queue);
+        if (extract_str_queue)
+                   s_template->extract_cmd_queue = 
lsq_command_queue_new(extract_str_queue);
+        if (refresh_str_queue)
+                   s_template->refresh_cmd_queue = 
lsq_command_queue_new(refresh_str_queue);
+
     s_template->n_properties = g_strv_length(column_names);
     s_template->property_names = column_names;
     s_template->parser = parser;

Modified: squeeze/trunk/libsqueeze/support-template.c
===================================================================
--- squeeze/trunk/libsqueeze/support-template.c 2008-03-18 20:57:45 UTC (rev 
26687)
+++ squeeze/trunk/libsqueeze/support-template.c 2008-03-19 22:31:29 UTC (rev 
26688)
@@ -50,4 +50,3 @@
     n_props = templ->n_properties;
        return n_props;
 }
-

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to