Fixed Nabi Issues
[apps/osp/Internet.git] / src / IntHistoryListForm.cpp
index ac7ad08..309c11f 100644 (file)
@@ -592,19 +592,20 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                }
        }
        bool urlFoundInBookmark = false;
-
-       if(__pBookmarkList != null)
-       {
-               for (int i = 0; i < __pBookmarkList->GetCount();i++)
-               {
-                       BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
-                       if(pBookMark != null && pHistory->GetHistoryUrl().CompareTo(pBookMark->GetUrl()) == 0)
-                       {
-                               urlFoundInBookmark = true;
-                               break;
-                       }
-               }
-       }
+//
+//     if(__pBookmarkList != null)
+//     {
+//             for (int i = 0; i < __pBookmarkList->GetCount();i++)
+//             {
+//                     BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
+//                     if(pBookMark != null && pHistory->GetHistoryUrl().CompareTo(pBookMark->GetUrl()) == 0)
+//                     {
+//                             urlFoundInBookmark = true;
+//                             break;
+//                     }
+//             }
+//     }
+       BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(pHistory->GetHistoryUrl(),urlFoundInBookmark);
        if (urlFoundInBookmark == true)
        {
                pBookmarkBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_ON_TEMP);
@@ -922,18 +923,19 @@ HistoryListForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
                bool bookmarkFound = false;
                BookmarkData* pBookMark = null;
-               if(__pBookmarkList != null)
-               {
-                       for (int i = 0; i < __pBookmarkList->GetCount(); i++)
-                       {
-                               pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
-                               if (pBookMark != null && toggledUrl.CompareTo(pBookMark->GetUrl()) == 0)
-                               {
-                                       bookmarkFound = true;
-                                       break;
-                               }
-                       }
-               }
+//             if(__pBookmarkList != null)
+//             {
+//                     for (int i = 0; i < __pBookmarkList->GetCount(); i++)
+//                     {
+//                             pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
+//                             if (pBookMark != null && toggledUrl.CompareTo(pBookMark->GetUrl()) == 0)
+//                             {
+//                                     bookmarkFound = true;
+//                                     break;
+//                             }
+//                     }
+//             }
+               BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(toggledUrl,bookmarkFound);
                if(bookmarkFound == false)
                {
                        // Add the history in bookmark database
@@ -945,7 +947,13 @@ HistoryListForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
                        bookmark.SetBookmarkTitle(bookmarkTitle);
                        bookmark.SetUrl(pHistory->GetHistoryUrl());
                        bookmark.SetFaviconId(pHistory->GetFaviconId());
-                       bookmark.SetFavIconBuffer(*pHistory->GetFavIconBuffer());
+                       if(pHistory->GetFavIconBuffer())
+                       {
+                               ByteBuffer *pBuffer = new ByteBuffer();
+
+                               pBuffer->Construct(*pHistory->GetFavIconBuffer());
+                               bookmark.SetFavIconBuffer(*pBuffer);
+                       }
                        //r = BookmarkPresentationModel::GetInstance()->SaveBookmark(pBookmark);
                        r = BookmarkPresentationModel::GetInstance()->SaveTempBookmark(bookmark);
                }