[Xfce4-commits] <midori:master> JS backend compilation fix + warnings fixes

Christian Dywan noreply at xfce.org
Tue Jan 10 02:08:01 CET 2012


Updating branch refs/heads/master
         to 43952508ebd93008a08db4a7aa0dea86a541cf14 (commit)
       from bf4ddd3358df1d6bfbedeed7ef0697fa745b9adf (commit)

commit 43952508ebd93008a08db4a7aa0dea86a541cf14
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Sat Jan 7 19:58:52 2012 -0400

    JS backend compilation fix + warnings fixes

 extensions/formhistory/formhistory-js-frontend.c |    7 +++++--
 extensions/formhistory/formhistory.c             |   18 +++++++-----------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/extensions/formhistory/formhistory-js-frontend.c b/extensions/formhistory/formhistory-js-frontend.c
index 067f1e3..c1c85ea 100644
--- a/extensions/formhistory/formhistory-js-frontend.c
+++ b/extensions/formhistory/formhistory-js-frontend.c
@@ -84,6 +84,9 @@ formhistory_setup_suggestions (WebKitWebView*   web_view,
     FormHistoryPriv* priv;
     static sqlite3_stmt* stmt;
     const char* sqlcmd;
+    const unsigned char* key;
+    const unsigned char* value;
+
     gint result, pos;
 
     priv = g_object_get_data (G_OBJECT (extension), "priv");
@@ -111,8 +114,8 @@ formhistory_setup_suggestions (WebKitWebView*   web_view,
     while (result == SQLITE_ROW)
     {
         pos++;
-        const unsigned char* value = sqlite3_column_text (stmt, 0);
-        const unsigned char* key = sqlite3_column_text (stmt, 1);
+        value = sqlite3_column_text (stmt, 0);
+        key = sqlite3_column_text (stmt, 1);
         if (value)
         {
             g_string_append_printf (suggestions, " arr[\"%s\"] = [\"%s\"]; ",
diff --git a/extensions/formhistory/formhistory.c b/extensions/formhistory/formhistory.c
index b1f71cb..b0f165d 100644
--- a/extensions/formhistory/formhistory.c
+++ b/extensions/formhistory/formhistory.c
@@ -52,6 +52,10 @@ formhistory_navigation_decision_cb (WebKitWebView*             web_view,
                                     WebKitWebPolicyDecision*   decision,
                                     MidoriExtension*           extension)
 {
+    FormHistoryPriv* priv;
+    JSContextRef js_context;
+    gchar* value;
+
     /* The script returns form data in the form "field_name|,|value|,|field_type".
        We are handling only input fields with 'text' or 'password' type.
        The field separator is "|||" */
@@ -75,9 +79,9 @@ formhistory_navigation_decision_cb (WebKitWebView*             web_view,
     if (webkit_web_navigation_action_get_reason (action) != WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED)
         return FALSE;
 
-    FormHistoryPriv* priv = g_object_get_data (G_OBJECT (extension), "priv");
-    JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
-    gchar* value = sokoke_js_script_eval (js_context, script, NULL);
+    priv = g_object_get_data (G_OBJECT (extension), "priv");
+    js_context = webkit_web_frame_get_global_context (web_frame);
+    value = sokoke_js_script_eval (js_context, script, NULL);
 
     formhistory_suggestions_hide_cb (NULL, NULL, priv);
     if (value && *value)
@@ -130,8 +134,6 @@ formhistory_add_tab_cb (MidoriBrowser*   browser,
                         MidoriView*      view,
                         MidoriExtension* extension)
 {
-    g_return_if_fail (MIDORI_IS_VIEW (view));
-    g_return_if_fail (MIDORI_IS_EXTENSION (extension));
     GtkWidget* web_view = midori_view_get_web_view (view);
 
     g_signal_connect (web_view, "window-object-cleared",
@@ -144,7 +146,6 @@ static void
 formhistory_add_tab_foreach_cb (MidoriView*      view,
                                 MidoriExtension* extension)
 {
-    g_return_if_fail (MIDORI_IS_VIEW (view));
     formhistory_add_tab_cb (NULL, view, extension);
 }
 
@@ -153,9 +154,6 @@ formhistory_app_add_browser_cb (MidoriApp*       app,
                                 MidoriBrowser*   browser,
                                 MidoriExtension* extension)
 {
-    g_return_if_fail (MIDORI_IS_APP (app));
-    g_return_if_fail (MIDORI_IS_BROWSER (browser));
-    g_return_if_fail (MIDORI_IS_EXTENSION (extension));
 
     GtkAccelGroup* acg = gtk_accel_group_new ();
     GtkActionGroup* action_group = midori_browser_get_action_group (browser);
@@ -188,8 +186,6 @@ static void
 formhistory_deactivate_tab (MidoriView*      view,
                             MidoriExtension* extension)
 {
-    g_return_if_fail (MIDORI_IS_VIEW (view));
-    g_return_if_fail (MIDORI_IS_EXTENSION (extension));
     GtkWidget* web_view = midori_view_get_web_view (view);
 
     g_signal_handlers_disconnect_by_func (


More information about the Xfce4-commits mailing list