JS backend compilation fix + warnings fixes
This commit is contained in:
parent
bf4ddd3358
commit
43952508eb
2 changed files with 12 additions and 13 deletions
|
@ -84,6 +84,9 @@ formhistory_setup_suggestions (WebKitWebView* web_view,
|
||||||
FormHistoryPriv* priv;
|
FormHistoryPriv* priv;
|
||||||
static sqlite3_stmt* stmt;
|
static sqlite3_stmt* stmt;
|
||||||
const char* sqlcmd;
|
const char* sqlcmd;
|
||||||
|
const unsigned char* key;
|
||||||
|
const unsigned char* value;
|
||||||
|
|
||||||
gint result, pos;
|
gint result, pos;
|
||||||
|
|
||||||
priv = g_object_get_data (G_OBJECT (extension), "priv");
|
priv = g_object_get_data (G_OBJECT (extension), "priv");
|
||||||
|
@ -111,8 +114,8 @@ formhistory_setup_suggestions (WebKitWebView* web_view,
|
||||||
while (result == SQLITE_ROW)
|
while (result == SQLITE_ROW)
|
||||||
{
|
{
|
||||||
pos++;
|
pos++;
|
||||||
const unsigned char* value = sqlite3_column_text (stmt, 0);
|
value = sqlite3_column_text (stmt, 0);
|
||||||
const unsigned char* key = sqlite3_column_text (stmt, 1);
|
key = sqlite3_column_text (stmt, 1);
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
g_string_append_printf (suggestions, " arr[\"%s\"] = [\"%s\"]; ",
|
g_string_append_printf (suggestions, " arr[\"%s\"] = [\"%s\"]; ",
|
||||||
|
|
|
@ -52,6 +52,10 @@ formhistory_navigation_decision_cb (WebKitWebView* web_view,
|
||||||
WebKitWebPolicyDecision* decision,
|
WebKitWebPolicyDecision* decision,
|
||||||
MidoriExtension* extension)
|
MidoriExtension* extension)
|
||||||
{
|
{
|
||||||
|
FormHistoryPriv* priv;
|
||||||
|
JSContextRef js_context;
|
||||||
|
gchar* value;
|
||||||
|
|
||||||
/* The script returns form data in the form "field_name|,|value|,|field_type".
|
/* The script returns form data in the form "field_name|,|value|,|field_type".
|
||||||
We are handling only input fields with 'text' or 'password' type.
|
We are handling only input fields with 'text' or 'password' type.
|
||||||
The field separator is "|||" */
|
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)
|
if (webkit_web_navigation_action_get_reason (action) != WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
FormHistoryPriv* priv = g_object_get_data (G_OBJECT (extension), "priv");
|
priv = g_object_get_data (G_OBJECT (extension), "priv");
|
||||||
JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
|
js_context = webkit_web_frame_get_global_context (web_frame);
|
||||||
gchar* value = sokoke_js_script_eval (js_context, script, NULL);
|
value = sokoke_js_script_eval (js_context, script, NULL);
|
||||||
|
|
||||||
formhistory_suggestions_hide_cb (NULL, NULL, priv);
|
formhistory_suggestions_hide_cb (NULL, NULL, priv);
|
||||||
if (value && *value)
|
if (value && *value)
|
||||||
|
@ -130,8 +134,6 @@ formhistory_add_tab_cb (MidoriBrowser* browser,
|
||||||
MidoriView* view,
|
MidoriView* view,
|
||||||
MidoriExtension* extension)
|
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);
|
GtkWidget* web_view = midori_view_get_web_view (view);
|
||||||
|
|
||||||
g_signal_connect (web_view, "window-object-cleared",
|
g_signal_connect (web_view, "window-object-cleared",
|
||||||
|
@ -144,7 +146,6 @@ static void
|
||||||
formhistory_add_tab_foreach_cb (MidoriView* view,
|
formhistory_add_tab_foreach_cb (MidoriView* view,
|
||||||
MidoriExtension* extension)
|
MidoriExtension* extension)
|
||||||
{
|
{
|
||||||
g_return_if_fail (MIDORI_IS_VIEW (view));
|
|
||||||
formhistory_add_tab_cb (NULL, view, extension);
|
formhistory_add_tab_cb (NULL, view, extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,9 +154,6 @@ formhistory_app_add_browser_cb (MidoriApp* app,
|
||||||
MidoriBrowser* browser,
|
MidoriBrowser* browser,
|
||||||
MidoriExtension* extension)
|
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 ();
|
GtkAccelGroup* acg = gtk_accel_group_new ();
|
||||||
GtkActionGroup* action_group = midori_browser_get_action_group (browser);
|
GtkActionGroup* action_group = midori_browser_get_action_group (browser);
|
||||||
|
@ -188,8 +186,6 @@ static void
|
||||||
formhistory_deactivate_tab (MidoriView* view,
|
formhistory_deactivate_tab (MidoriView* view,
|
||||||
MidoriExtension* extension)
|
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);
|
GtkWidget* web_view = midori_view_get_web_view (view);
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (
|
g_signal_handlers_disconnect_by_func (
|
||||||
|
|
Loading…
Reference in a new issue