aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/history/ephy-history-service-urls-table.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index de0d516ac..0b72875a6 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -102,16 +102,17 @@ ephy_history_service_get_url_row (EphyHistoryService *self, const char *url_stri
if (url == NULL) {
url = ephy_history_url_new (NULL, NULL, 0, 0, 0, 1.0);
- } else {
- if (url->url)
- g_free (url->url);
- if (url->title)
- g_free (url->title);
}
url->id = ephy_sqlite_statement_get_column_as_int (statement, 0);
- url->url = g_strdup (ephy_sqlite_statement_get_column_as_string (statement, 1)),
- url->title = g_strdup (ephy_sqlite_statement_get_column_as_string (statement, 2)),
+
+ /* Only get the URL and page title if we don't know it yet, as the version in the
+ history could be outdated. */
+ if (url->url == NULL)
+ url->url = g_strdup (ephy_sqlite_statement_get_column_as_string (statement, 1));
+ if (url->title == NULL)
+ url->title = g_strdup (ephy_sqlite_statement_get_column_as_string (statement, 2));
+
url->visit_count = ephy_sqlite_statement_get_column_as_int (statement, 3),
url->typed_count = ephy_sqlite_statement_get_column_as_int (statement, 4),
url->last_visit_time = ephy_sqlite_statement_get_column_as_int (statement, 5);