Simplify codes for assigning of apps icon
authorKyuho Jo <kyuho.jo@samsung.com>
Thu, 2 Mar 2017 08:39:46 +0000 (17:39 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:44 +0000 (18:34 +0900)
Change-Id: I818e9b90ae9041e8dcd502e042e59d090c625307
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
TVHome/TVHome/Models/AppShortcutController.cs

index ce9d0f467a5f7d61de4edf642af62667d30070b3..a705a71267fe29d5b8079c300ed2aee75169b022 100644 (file)
@@ -53,22 +53,17 @@ namespace TVHome.Models
                     appInfo.TryGetValue("IconPath", out appIconPath);\r
 \r
                     DebuggingUtils.Dbg("AppID: " + appShortcutInfo.AppID + ", Label : " + appLabel + " IconPath : " + appIconPath);\r
+                    Random random = new Random();\r
                     var defaultStateDescription = new StateDescription()\r
                     {\r
                         Label = appLabel,\r
-                        IconPath = appIconPath,\r
+                        IconPath = appIconPath??icons[random.Next(0, 6)], //IconPath = (resul5t[2] == null) ? "AppIcon.png" : result[2],\r
                         Action = new AppControlAction\r
                         {\r
                             AppID = appShortcutInfo.AppID,\r
                         }\r
                     };\r
                     \r
-                    if (defaultStateDescription.IconPath == null || defaultStateDescription.IconPath.Length == 0)\r
-                    {\r
-                        Random random = new Random();\r
-                        defaultStateDescription.IconPath = icons[random.Next(0, 6)]; //IconPath = (resul5t[2] == null) ? "AppIcon.png" : result[2],\r
-                    }\r
-\r
                     appShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);\r
                     appShortcutInfo.CurrentStateDescription = defaultStateDescription;\r
                 }\r