[Xfce4-commits] <midori:master> Try matching URI by extension first in script/ style infobar

Christian Dywan noreply at xfce.org
Wed Feb 9 00:32:02 CET 2011


Updating branch refs/heads/master
         to 7939dc1bf1fe0ba752667a0b05db52e50184d3c4 (commit)
       from 6b48f9c639c8ede508aa546d1b5043ba2d316fe5 (commit)

commit 7939dc1bf1fe0ba752667a0b05db52e50184d3c4
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Fri Feb 4 19:43:05 2011 +0100

    Try matching URI by extension first in script/ style infobar
    
    Fallback to hostname if that fails

 extensions/addons.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/extensions/addons.c b/extensions/addons.c
index 50cff0e..a08983e 100644
--- a/extensions/addons.c
+++ b/extensions/addons.c
@@ -119,7 +119,11 @@ addons_install_response (GtkWidget*  infobar,
             filename = NULL;
             folder = NULL;
 
-            if (!g_strcmp0 (hostname, "userscripts.org"))
+            if (g_str_has_suffix (uri, ".user.js"))
+                folder = "scripts";
+            else if (g_str_has_suffix (uri, ".user.css"))
+                folder = "styles";
+            else if (!g_strcmp0 (hostname, "userscripts.org"))
             {
                 gchar* script_id;
                 const gchar* js_script;
@@ -182,10 +186,6 @@ addons_install_response (GtkWidget*  infobar,
                 }
             }
 
-            if (g_str_has_suffix (uri, ".user.js"))
-                folder = "scripts";
-            else if (g_str_has_suffix (uri, ".user.css"))
-                folder = "styles";
             if (!filename)
                 filename = g_path_get_basename (uri);
             path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),



More information about the Xfce4-commits mailing list