Fixing saving locale for each icon
authorTomasz Iwanek <t.iwanek@samsung.com>
Wed, 16 Jan 2013 14:38:05 +0000 (15:38 +0100)
committerGerrit Code Review <gerrit2@kim11>
Tue, 22 Jan 2013 13:46:07 +0000 (22:46 +0900)
[Issue#]       TDIS-1870 / LINUXWRT-24
[Bug]          Icons are not proceeded correctly
[Cause]        N/A
[Solution]     N/A
[Verification] Build repository and run tests for icons:
wrt-tests-w3c --output=text --regexp='ta_iipTwNshRg'
wrt-tests-w3c --output=text --regexp='ta_roCaKRxZhS'
wrt-tests-w3c --output=text --regexp='ta_iuJHnskSHq'
wrt-tests-w3c --output=text --regexp='ta_FAFYMEGELU'

See no regression is precentage of tests that passed

Change-Id: Iad468faeaefe315bedf25824b3f98e0d7c704a13

modules/widget_dao/dao/widget_dao.cpp
modules/widget_dao/dao/widget_dao_read_only.cpp

index 1c73f94..bd421dd 100644 (file)
@@ -530,25 +530,7 @@ void WidgetDAO::registerWidgetIcons(DbWidgetHandle widgetHandle,
             row.Set_app_id(widgetHandle);
             row.Set_icon_id(icon_id);
             row.Set_widget_locale(*j);
-            WRT_DB_SELECT(select, WidgetLocalizedIcon, &WrtDatabase::interface())
-            select->Where(And(Equals<WidgetLocalizedIcon::app_id>(widgetHandle),
-                              Equals<WidgetLocalizedIcon::widget_locale>(*j)));
-            WidgetLocalizedIcon::Select::RowList rows = select->GetRowList();
-
-            bool flag = !rows.empty();
-
-            if(flag == true)
-            {
-                // already default icon value of same locale exists
-                WRT_DB_UPDATE(update, WidgetLocalizedIcon, &WrtDatabase::interface())
-                update->Where(And(Equals<WidgetLocalizedIcon::app_id>(widgetHandle),
-                                  Equals<WidgetLocalizedIcon::widget_locale>(*j)));
-                update->Values(row);
-                update->Execute();
-            }else{
-                // any icon value of same locale doesn't exist
-                DO_INSERT(row, WidgetLocalizedIcon)
-            }
+            DO_INSERT(row, WidgetLocalizedIcon)
         }
     }
 }
index 7adaf41..e5a528a 100644 (file)
@@ -719,6 +719,7 @@ WidgetDAOReadOnly::WidgetIconList WidgetDAOReadOnly::getIconList() const
     {
         WRT_DB_SELECT(select, wrt::WidgetIcon, &WrtDatabase::interface())
         select->Where(Equals<wrt::WidgetIcon::app_id>(m_widgetHandle));
+        select->OrderBy(DPL::TypeListDecl<OrderingAscending<wrt::WidgetIcon::icon_id> >());
 
         std::list<WidgetIcon::Row> list =
                 select->GetRowList();