[Xfce4-commits] r26689 - squeeze/trunk/libsqueeze

Stephan Arts stephan at xfce.org
Thu Mar 20 00:11:25 CET 2008


Author: stephan
Date: 2008-03-19 23:11:25 +0000 (Wed, 19 Mar 2008)
New Revision: 26689

Modified:
   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
Log:
Make it do some refresh


Modified: squeeze/trunk/libsqueeze/archive-iter.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-iter.c	2008-03-19 22:31:29 UTC (rev 26688)
+++ squeeze/trunk/libsqueeze/archive-iter.c	2008-03-19 23:11:25 UTC (rev 26689)
@@ -1439,7 +1439,6 @@
 
 	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:
@@ -1449,11 +1448,11 @@
 				props_iter += sizeof(gchar *);
 				break;
 			case G_TYPE_UINT:
-				(*((guint *)props_iter)) = *((const guint*)props[i]);
+				(*((guint *)props_iter)) = ((const guint)props[i]);
 				props_iter += sizeof(guint);
 				break;
 			case G_TYPE_UINT64:
-				(*((guint64 *)props_iter)) = *((const guint64*)props[i]);
+				(*((guint64 *)props_iter)) = (*(const guint64 *)props[i]);
 				props_iter += sizeof(guint64);
 				break;
 		}

Modified: squeeze/trunk/libsqueeze/archive.c
===================================================================
--- squeeze/trunk/libsqueeze/archive.c	2008-03-19 22:31:29 UTC (rev 26688)
+++ squeeze/trunk/libsqueeze/archive.c	2008-03-19 23:11:25 UTC (rev 26689)
@@ -321,6 +321,7 @@
 void
 lsq_archive_refreshed(const LSQArchive *archive)
 {
+    g_debug("%s", __FUNCTION__);
 	g_signal_emit(G_OBJECT(archive), lsq_archive_signals[LSQ_ARCHIVE_SIGNAL_REFRESHED], 0, NULL);
 }
 

Modified: squeeze/trunk/libsqueeze/command-queue.c
===================================================================
--- squeeze/trunk/libsqueeze/command-queue.c	2008-03-19 22:31:29 UTC (rev 26688)
+++ squeeze/trunk/libsqueeze/command-queue.c	2008-03-19 23:11:25 UTC (rev 26689)
@@ -184,9 +184,17 @@
   {
     if((ctx->queue = ctx->queue->next))
       lsq_command_entry_start(ctx->queue, ctx);
-    //else
-      //...//done
+    else
+    {
+        /* HACK */
+      lsq_archive_refreshed(ctx->archive);
+    }
   }
+  else
+  {
+        /* HACK */
+      lsq_archive_refreshed(ctx->archive);
+  }
 }
 
 static void in_channel(GIOChannel *source, GIOCondition condition, GIOChannel *dest)
@@ -239,7 +247,8 @@
   }
 }
 
-static void parse_channel(GIOChannel *source, GIOCondition condition, LSQExecuteContext *ctx)
+static gboolean
+parse_channel(GIOChannel *source, GIOCondition condition, LSQExecuteContext *ctx)
 {
   if(condition & G_IO_IN)
     lsq_parser_parse(ctx->parser, ctx->ctx);
@@ -255,7 +264,9 @@
       //else
         //...//done
     }
+    return FALSE;
   }
+  return TRUE;
 }
 
 static void lsq_command_entry_start(LSQCommandEntry *entry, LSQExecuteContext *ctx)

Modified: squeeze/trunk/libsqueeze/parser-context.c
===================================================================
--- squeeze/trunk/libsqueeze/parser-context.c	2008-03-19 22:31:29 UTC (rev 26688)
+++ squeeze/trunk/libsqueeze/parser-context.c	2008-03-19 23:11:25 UTC (rev 26689)
@@ -101,6 +101,8 @@
 {
 	GIOStatus stat;
 
+    g_return_val_if_fail(ctx->channel, FALSE);
+
 	stat = g_io_channel_read_line(ctx->channel, line, length, NULL, NULL);
 
   ctx->last_stat = stat;

Modified: squeeze/trunk/libsqueeze/scanf-parser.c
===================================================================
--- squeeze/trunk/libsqueeze/scanf-parser.c	2008-03-19 22:31:29 UTC (rev 26688)
+++ squeeze/trunk/libsqueeze/scanf-parser.c	2008-03-19 23:11:25 UTC (rev 26689)
@@ -174,7 +174,7 @@
   if(!lng)
     return 0;
 
-  if(!part->delimiter[0])
+  if(!part->delimiter)
     return 1;
 
   //for(ptr = str; g_ascii_isspace(*ptr); ptr++);
@@ -502,8 +502,8 @@
   if(!lng)
     return 0;
 
-  if(!part->delimiter[0])
-    return 0;
+  if(!part->delimiter)
+    return 1;
 
   ptr = g_strstr_len(str, lng, part->delimiter);
 
@@ -1064,33 +1064,39 @@
       lng -= size;
     }
 
-    if(!g_str_has_prefix(ptr, part->delimiter))
+    if(part->delimiter)
     {
-      //no match
-      if(line_nr)
-      {
-        ptr = line;
-        lng = line_length;
-        part = parser->parser;
-        line_nr = 0;
-        continue;
-      }
-      ctx->parse_loc = parser->parser;
-      ctx->parse_line = 0;
-      g_free(line);
-      return;
+        if(!g_str_has_prefix(ptr, part->delimiter))
+        {
+          //no match
+          if(line_nr)
+          {
+            ptr = line;
+            lng = line_length;
+            part = parser->parser;
+            line_nr = 0;
+            continue;
+          }
+          ctx->parse_loc = parser->parser;
+          ctx->parse_line = 0;
+          g_free(line);
+          return;
+        }
     }
 
-    if(g_str_has_suffix(part->delimiter, "\n"))
+    if(part->delimiter)
     {
-      //next line
-      if(part->next)
-      {
-        ctx->parse_loc = part->next;
-        ctx->parse_line = line_nr+1;
-        g_free(line);
-        return;
-      }
+        if(g_str_has_suffix(part->delimiter, "\n"))
+        {
+          //next line
+          if(part->next)
+          {
+            ctx->parse_loc = part->next;
+            ctx->parse_line = line_nr+1;
+            g_free(line);
+            return;
+          }
+        }
     }
     
     part = part->next;



More information about the Xfce4-commits mailing list