[Xfce4-commits] <midori:master> Always clear private data in inactivity reset

Christian Dywan noreply at xfce.org
Sat Oct 30 02:10:01 CEST 2010


Updating branch refs/heads/master
         to 949f38fb58f32e3525832bf246307e9d1c92f609 (commit)
       from 5f0a9676b837284223f0f7e559c75f22951ac5b7 (commit)

commit 949f38fb58f32e3525832bf246307e9d1c92f609
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Oct 29 22:19:04 2010 +0200

    Always clear private data in inactivity reset

 midori/main.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 4be39a3..45fb906 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1513,12 +1513,22 @@ midori_inactivity_timeout (gpointer data)
         {
             guint i = 0;
             GtkWidget* view;
+            KatzeArray* history = katze_object_get_object (mit->browser, "history");
+            sqlite3* db;
+            KatzeArray* trash = katze_object_get_object (mit->browser, "trash");
+            GList* data_items = sokoke_register_privacy_item (NULL, NULL, NULL);
 
             while ((view = midori_browser_get_nth_tab (mit->browser, i++)))
                 gtk_widget_destroy (view);
             midori_browser_set_current_uri (mit->browser, mit->uri);
-            /* TODO: Re-run initial commands */
-
+            /* Clear all private data */
+            if (history && (db = g_object_get_data (G_OBJECT (history), "db")))
+                sqlite3_exec (db, "DELETE FROM history; DELETE FROM search",
+                              NULL, NULL, NULL);
+            if (trash != NULL)
+                katze_array_clear (trash);
+            for (; data_items != NULL; data_items = g_list_next (data_items))
+                ((SokokePrivacyItem*)(data_items->data))->clear ();
         }
     }
     #else



More information about the Xfce4-commits mailing list