Fixed to display default favicon when bookmark favicon is not exist
authorahram.suh <ahram.suh@samsung.com>
Fri, 29 Mar 2013 12:41:20 +0000 (21:41 +0900)
committerahram.suh <ahram.suh@samsung.com>
Fri, 29 Mar 2013 12:41:20 +0000 (21:41 +0900)
Change-Id: I593bb7c0961a876f6af34921a82af162891a2f00

src/IntBookmarkListForm.cpp
src/IntPresentationModelBase.cpp

index 5df99c7..1ace66f 100644 (file)
@@ -629,12 +629,12 @@ BookmarkListForm::CreateItem(int index, int itemWidth)
                        AppLog("rahul bitmap is null");
                }
 
-               //pBitmap = FaviconManager::GetInstance()->GetFaviconN(bitmapId);
-               /*if (pBitmap == null)
+               if (pBitmap == null)
                {
                        AppLogDebug("BookmarkListForm::CreateItem bitmap is null");
-                       pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
-               }*/
+                       pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();  // we need to display default bookmark icon when favicon is not exist.
+               }
+
                pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
                pItem->AddElement(Rectangle(x_Margin_Title, 0, width_Title, itemHeight - height_Url), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
                if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
index c0fa1f4..458426a 100644 (file)
@@ -453,18 +453,12 @@ PresentationModelBase::ExecuteBookmarkQuery(const Tizen::Base::String& formatQue
                                __pDbStatement->BindString(4,dt.ToString());
                                __pDbStatement->BindString(5,dt.ToString());
 
-                               if(bookmark.GetFavIconBuffer() != null)
+                               if(bookmark.GetFavIconBuffer() != null) // When favicon is exist, we save favicon to db.
                                {
                                        __pDbStatement->BindBlob(6,*(bookmark.GetFavIconBuffer()));
+                                       __pDbStatement->BindInt(7,bookmark.GetFavIconWidth());
+                                       __pDbStatement->BindInt(8,bookmark.GetFavIconHeight());
                                }
-                               else
-                               {
-                                       ByteBuffer buff;
-                                       buff.Construct(10);
-                                       __pDbStatement->BindBlob(6,buff);
-                               }
-                               __pDbStatement->BindInt(7,bookmark.GetFavIconWidth());
-                               __pDbStatement->BindInt(8,bookmark.GetFavIconHeight());
 
                                __pDataBase->ExecuteStatementN(*__pDbStatement);
 
@@ -576,18 +570,12 @@ PresentationModelBase::ExecuteHistoryQuery(const Tizen::Base::String& formatQuer
                                __pDbStatement->BindString(0,historyUrl);
                                __pDbStatement->BindString(1,historyTitle);
                                __pDbStatement->BindDateTime(2, date);
-                               if(history.GetFavIconBuffer() != null)
+                               if(history.GetFavIconBuffer() != null)  // When favicon is exist, we save favicon to db.
                                {
                                        __pDbStatement->BindBlob(3,*(history.GetFavIconBuffer()));
+                                       __pDbStatement->BindInt(4,history.GetFavIconWidth());
+                                       __pDbStatement->BindInt(5,history.GetFavIconHeight());
                                }
-                               else
-                               {
-                                       ByteBuffer buff;
-                                       buff.Construct(10);
-                                       __pDbStatement->BindBlob(3,buff);
-                               }
-                               __pDbStatement->BindInt(4,history.GetFavIconWidth());
-                               __pDbStatement->BindInt(5,history.GetFavIconHeight());
 
                                __pDataBase->ExecuteStatementN(*__pDbStatement);