Fix installation of widgets with multiple default icons
authorZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Fri, 13 Sep 2013 13:00:33 +0000 (15:00 +0200)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Mon, 16 Sep 2013 09:10:57 +0000 (18:10 +0900)
[Issue#]   WGL-540
[Problem]  The default Tizen icon is displayed on menu tray
           instead of the one provided with web application.
[Cause]    When more than one default icons are provided with web application
           (e.g. icon.jpg and icon.png) then one of them is installed in the file
           system (icon.png) but the other one is set in manifest file (icon.jpg).
           As a result, web application's icon cannot be found and tizen default
           icon is displayed instead.
[Solution] Make sure that the same icon is installed in the file system
           as is set in manifest file (with respect to the default icon search
           order specified by W3C P&C spec).

[Verification]
  1. Build repository
  2. Install web application attached to WGL-540
     (icon.png should be used as the web application's icon)
  3. Install any web application with a single default icon provided
     inside the web application's package.
  4. Install any web application with an icon specified in the web
     application's configuration file.
  5. Install any web application with an icon specified in the web
     application's configuration file and a default icon available in the
     web application's package (icon explicitly specified in the web
     application's configuration file should be used).

Change-Id: Ia3b05a1c6d926ab8fb9bc70766340d07f469ac8f

src/jobs/widget_install/task_manifest_file.cpp

index d907b4b..b817b8c 100644 (file)
@@ -842,11 +842,9 @@ void TaskManifestFile::setWidgetIcons(UiApplication & uiApp)
     WrtDB::WidgetRegisterInfo::LocalizedIconList & icons =
         m_context.widgetConfig.localizationData.icons;
 
-    //reversed: last <icon> has highest priority to be writen to manifest if it
-    // has given locale (TODO: why was that working that way?)
-    for (WrtDB::WidgetRegisterInfo::LocalizedIconList::const_reverse_iterator
-         icon = icons.rbegin();
-         icon != icons.rend();
+    for (WrtDB::WidgetRegisterInfo::LocalizedIconList::const_iterator
+         icon = icons.begin();
+         icon != icons.end();
          ++icon)
     {
         FOREACH(locale, icon->availableLocales)