[Xfce4-commits] <midori:master> Adblock: Check if file is up to date before parsing it

Christian Dywan noreply at xfce.org
Sat Sep 1 18:14:04 CEST 2012


Updating branch refs/heads/master
         to be61f96bc28d6056b2f36a042b8b6cf9c638cbc3 (commit)
       from c49fb82e87660b7d357b44336cc5a115cb66cd7f (commit)

commit be61f96bc28d6056b2f36a042b8b6cf9c638cbc3
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Sat Sep 1 17:54:30 2012 +0200

    Adblock: Check if file is up to date before parsing it

 extensions/adblock.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/extensions/adblock.c b/extensions/adblock.c
index 8939c68..f38aa2a 100644
--- a/extensions/adblock.c
+++ b/extensions/adblock.c
@@ -43,7 +43,7 @@ static GHashTable* blockcssprivate = NULL;
 static GHashTable* navigationwhitelist = NULL;
 static GString* blockcss = NULL;
 
-static gboolean
+static void
 adblock_parse_file (gchar* path);
 
 static gboolean
@@ -226,8 +226,7 @@ adblock_reload_rules (MidoriExtension* extension,
                 continue;
             }
 
-            if (!adblock_parse_file (path)
-            ||  !adblock_file_is_up_to_date (path))
+            if (!adblock_file_is_up_to_date (path))
             {
                 WebKitNetworkRequest* request;
                 WebKitDownload* download;
@@ -242,6 +241,8 @@ adblock_reload_rules (MidoriExtension* extension,
                     G_CALLBACK (adblock_download_notify_status_cb), extension);
                 webkit_download_start (download);
             }
+            else
+                adblock_parse_file (path);
             g_free (path);
             i++;
         }
@@ -1596,7 +1597,7 @@ adblock_file_is_up_to_date (gchar* path)
     return FALSE;
 }
 
-static gboolean
+static void
 adblock_parse_file (gchar* path)
 {
     FILE* file;
@@ -1607,9 +1608,7 @@ adblock_parse_file (gchar* path)
         while (fgets (line, 2000, file))
             adblock_parse_line (line);
         fclose (file);
-        return TRUE;
     }
-    return FALSE;
 }
 
 static void


More information about the Xfce4-commits mailing list