diff options
author | Xan Lopez <xan@igalia.com> | 2012-03-06 20:00:04 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-07 04:49:46 +0800 |
commit | ec9466a67a56a55ab344273e6e993a33c139262c (patch) | |
tree | b9ae2691758296ad51cf0f4e6e2f419a61024cd1 /lib | |
parent | c8e0ba263ee394a8c500b30ae340193cfb81edf0 (diff) | |
download | gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.tar gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.tar.gz gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.tar.bz2 gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.tar.lz gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.tar.xz gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.tar.zst gsoc2013-epiphany-ec9466a67a56a55ab344273e6e993a33c139262c.zip |
ephy-history-service: handle correctly zoom level migration
We need to consider the case of an "invalid" host with a non default
zoom level, since the profile migrator will send us that kind of
thing.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/history/ephy-history-service.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c index fb02c80f6..13ed3b3ca 100644 --- a/lib/history/ephy-history-service.c +++ b/lib/history/ephy-history-service.c @@ -432,6 +432,15 @@ ephy_history_service_execute_add_visit_helper (EphyHistoryService *self, EphyHis { if (visit->url->host == NULL) visit->url->host = ephy_history_service_get_host_row_from_url (self, visit->url->url); + else if (visit->url->host->id == -1 && visit->url->host->zoom_level != 1.0) { + /* This will happen when we migrate the old history to the new + * format. We need to store a zoom level for a not-yet-created + * host, so we'll end up here. Ugly, but it works. */ + double zoom_level = visit->url->host->zoom_level; + ephy_history_host_free (visit->url->host); + visit->url->host = ephy_history_service_get_host_row_from_url (self, visit->url->url); + visit->url->host->zoom_level = zoom_level; + } visit->url->host->visit_count++; ephy_history_service_update_host_row (self, visit->url->host); |