After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671559 - ephy-history-service: remove orphan hosts from database
ephy-history-service: remove orphan hosts from database
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-07 14:43 UTC by Claudio Saavedra
Modified: 2012-03-07 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ephy-history-service: remove orphan hosts from database (2.93 KB, patch)
2012-03-07 14:43 UTC, Claudio Saavedra
committed Details | Review
ephy-hosts-view: add a method to select a given host (2.09 KB, patch)
2012-03-07 14:48 UTC, Claudio Saavedra
committed Details | Review
ephy-history-window: update the list of hosts after a url is deleted (1.58 KB, patch)
2012-03-07 14:48 UTC, Claudio Saavedra
committed Details | Review

Description Claudio Saavedra 2012-03-07 14:43:10 UTC
After removing all the urls in a host, we don't need that host
anymore.
Comment 1 Claudio Saavedra 2012-03-07 14:43:12 UTC
Created attachment 209164 [details] [review]
ephy-history-service: remove orphan hosts from database
Comment 2 Claudio Saavedra 2012-03-07 14:48:19 UTC
Created attachment 209165 [details] [review]
ephy-hosts-view: add a method to select a given host
Comment 3 Claudio Saavedra 2012-03-07 14:48:22 UTC
Created attachment 209166 [details] [review]
ephy-history-window: update the list of hosts after a url is deleted

Since now we remove orphan hosts, we need to update the list of hosts
after url removal, too. Do this while preserving the currently
selected host, if any.
Comment 4 Xan Lopez 2012-03-07 15:32:52 UTC
Review of attachment 209164 [details] [review]:

::: lib/history/ephy-history-service-hosts-table.c
@@ +383,3 @@
+                                  "  (SELECT hosts.id FROM hosts LEFT JOIN urls "
+                                  "    ON hosts.id = urls.host WHERE urls.host is NULL);",
+                                  &error);

Can you add a comment explaining a bit how this works?

@@ +385,3 @@
+                                  &error);
+  if (error) {
+    g_error ("Couldn't clear history database: %s", error->message);

Copy&Pasta error is Copy&Pasta error.
Comment 5 Xan Lopez 2012-03-07 15:34:59 UTC
Review of attachment 209165 [details] [review]:

::: lib/widgets/ephy-hosts-view.h
@@ +25,2 @@
 #include "ephy-history-view.h"
 

No empty line, and the alphabetical order is backwards.
Comment 6 Xan Lopez 2012-03-07 15:38:04 UTC
Review of attachment 209166 [details] [review]:

::: src/ephy-history-window.c
@@ +437,3 @@
 		return;
 
+	filter_now (editor, TRUE, TRUE);

It's always difficult to remember what these functions with two or more boolean parameters do.
Comment 7 Claudio Saavedra 2012-03-07 16:14:38 UTC
Attachment 209164 [details] pushed as 5d2779a - ephy-history-service: remove orphan hosts from database
Attachment 209165 [details] pushed as 5596d5f - ephy-hosts-view: add a method to select a given host
Attachment 209166 [details] pushed as 50715d7 - ephy-history-window: update the list of hosts after a url is deleted