Duplicated URLs in the history 23/50523/4 tizen
authorKamil Nowac <k.nowac@samsung.com>
Thu, 29 Oct 2015 10:54:59 +0000 (11:54 +0100)
committerJanusz Majnert <j.majnert@samsung.com>
Thu, 29 Oct 2015 14:01:25 +0000 (07:01 -0700)
[Issue] https://bugs.tizen.org/jira/browse/TT-236
[Problem] Duplicated records in the history
[Solution] Added check if url already exist
[Verification] 1. Open few tabs with the same url
2.Open History Manager

There should be only one record for one URL

Change-Id: I7ede53f6855245da88c3f40f0d58c9bef0471b4d

services/HistoryUI/HistoryUI.cpp

index 619d4a19f0ca2206de53d94e12d43dd041f8be92..697eaaeb3208bc701e783d435dfa085609518d0a 100644 (file)
@@ -239,6 +239,10 @@ void HistoryUI::_clearHistory_clicked(void* data, Evas_Object*, void*)
 void HistoryUI::addHistoryItem(std::shared_ptr<services::HistoryItem> hi)
 {
     BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__);
+    for (auto it : _history_item_data) {
+        if (it->item->getTitle() == hi->getTitle())
+            return;
+    }
     HistoryItemData *itemData = new HistoryItemData();
     itemData->item = hi;
     itemData->historyUI = std::shared_ptr<tizen_browser::base_ui::HistoryUI>(this);