Merge HTTP logins with Form History in Clear Private Data

This commit is contained in:
Paweł Forysiuk 2011-05-22 13:20:16 +02:00 committed by Christian Dywan
parent 95a84ff84d
commit 03254c22af
2 changed files with 26 additions and 25 deletions

View file

@ -21,12 +21,6 @@
#include <unistd.h>
#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,
</html> */
#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;
}

View file

@ -61,6 +61,12 @@
#include <gdk/gdkx.h>
#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