[Xfce4-commits] <midori:master> Merge HTTP logins with Form History in Clear Private Data
Christian Dywan
noreply at xfce.org
Sun May 22 14:36:01 CEST 2011
Updating branch refs/heads/master
to 03254c22afb7caedb1e4fb8f6bcea6dc89361bcd (commit)
from 95a84ff84d434ae034b5eb8e378e0d353b259acb (commit)
commit 03254c22afb7caedb1e4fb8f6bcea6dc89361bcd
Author: Paweł Forysiuk <tuxator at o2.pl>
Date: Sun May 22 13:20:16 2011 +0200
Merge HTTP logins with Form History in Clear Private Data
extensions/formhistory.c | 25 -------------------------
midori/main.c | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/extensions/formhistory.c b/extensions/formhistory.c
index cc4c07c..3190cf8 100644
--- a/extensions/formhistory.c
+++ b/extensions/formhistory.c
@@ -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;
}
diff --git a/midori/main.c b/midori/main.c
index c6b8568..595439e 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -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
More information about the Xfce4-commits
mailing list