From: Paweł Forysiuk Date: Sun, 22 May 2011 11:20:16 +0000 (+0200) Subject: Merge HTTP logins with Form History in Clear Private Data X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03254c22afb7caedb1e4fb8f6bcea6dc89361bcd;p=midori Merge HTTP logins with Form History in Clear Private Data --- diff --git a/extensions/formhistory.c b/extensions/formhistory.c index cc4c07cf..3190cf8f 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -21,12 +21,6 @@ #include #endif -#ifdef G_OS_WIN32 - #define LIBPREFIX "" -#else - #define LIBPREFIX "lib" -#endif - static GHashTable* global_keys; static gchar* jsforms; @@ -491,21 +485,6 @@ formhistory_activate_cb (MidoriExtension* extension, */ #endif -static void -formhistory_clear_database_cb (void) -{ - gchar* filename = g_build_filename (sokoke_set_config_dir (NULL), - "extensions", LIBPREFIX "formhistory." G_MODULE_SUFFIX, "forms.db", NULL); - sqlite3* db; - if (sqlite3_open (filename, &db) == SQLITE_OK) - { - sqlite3_exec (db, "DELETE FROM forms", NULL, NULL, NULL); - sqlite3_close (db); - } - g_free (filename); - -} - MidoriExtension* extension_init (void) { @@ -539,9 +518,5 @@ extension_init (void) g_signal_connect (extension, "activate", G_CALLBACK (formhistory_activate_cb), NULL); - /* i18n: Data entered into web forms by the user */ - sokoke_register_privacy_item ("formhistory", _("_Form History"), - G_CALLBACK (formhistory_clear_database_cb)); - return extension; } diff --git a/midori/main.c b/midori/main.c index c6b8568f..595439e4 100644 --- a/midori/main.c +++ b/midori/main.c @@ -61,6 +61,12 @@ #include #endif +#ifdef G_OS_WIN32 + #define LIBPREFIX "" +#else + #define LIBPREFIX "lib" +#endif + static gchar* build_config_filename (const gchar* filename) { @@ -1811,6 +1817,23 @@ midori_clear_flash_cookies_cb (void) } #endif +static void +midori_clear_saved_logins_cb (void) +{ + sqlite3* db; + gchar* path = g_build_filename (sokoke_set_config_dir (NULL), "logins", NULL); + g_unlink (path); + /* Form History database, written by the extension */ + katze_assign (path, g_build_filename (sokoke_set_config_dir (NULL), + "extensions", LIBPREFIX "formhistory." G_MODULE_SUFFIX, "forms.db", NULL)); + if (sqlite3_open (path, &db) == SQLITE_OK) + { + sqlite3_exec (db, "DELETE FROM forms", NULL, NULL, NULL); + sqlite3_close (db); + } + g_free (path); +} + #if WEBKIT_CHECK_VERSION (1, 1, 14) static void midori_clear_html5_databases_cb (void) @@ -2090,6 +2113,9 @@ main (int argc, sokoke_register_privacy_item ("page-icons", _("Website icons"), G_CALLBACK (midori_clear_page_icons_cb)); + /* i18n: Logins and passwords in websites and web forms */ + sokoke_register_privacy_item ("formhistory", _("Saved logins and _passwords"), + G_CALLBACK (midori_clear_saved_logins_cb)); sokoke_register_privacy_item ("web-cookies", _("Cookies"), G_CALLBACK (midori_clear_web_cookies_cb)); #ifdef GDK_WINDOWING_X11