adding handling theme info file
authorYong Song <yong.song@samsung.com>
Tue, 27 Aug 2013 11:42:00 +0000 (20:42 +0900)
committerYong Song <yong.song@samsung.com>
Tue, 27 Aug 2013 11:42:00 +0000 (20:42 +0900)
Change-Id: I076857b51dcc62cdb8a2e4260c6f119f8dec87e3

src/app/FApp_ThemeInfo.cpp

index 875c2fa..debcf7c 100644 (file)
@@ -49,7 +49,7 @@ _ThemeInfo::LoadThemeInformation(String& systemTheme, String& userTheme)
 
        if( r != E_SUCCESS)
        {
-               _ThemeInfo::LoadThemeInfoFromDatabase(systemTheme, userTheme);
+               r = _ThemeInfo::LoadThemeInfoFromDatabase(systemTheme, userTheme);
        }
 
        return r;
@@ -65,14 +65,19 @@ _ThemeInfo::LoadThemeInfoFromInfoFile(String& systemTheme, String& userTheme)
 
        // Get UI theme info from info/[appId]/uitheme.info
        {
-               File uiThemeInfoFile;
                const String themeInfoFilePath(L"info/" + appId +  L"/" + _theme_info_file);
 
-               r = uiThemeInfoFile.Construct(_AppInfo::GetAppRootPath() + themeInfoFilePath, L"r");
-               SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Propagating.");
-
-               r = uiThemeInfoFile.Read(uiThemeInfoString);
-               SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Propagating.");
+               if (File::IsFileExist(_AppInfo::GetAppRootPath() + themeInfoFilePath)) {
+                       File uiThemeInfoFile;
+                       r = uiThemeInfoFile.Construct(_AppInfo::GetAppRootPath() + themeInfoFilePath, L"r");
+                       SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Propagating.");
+
+                       r = uiThemeInfoFile.Read(uiThemeInfoString);
+                       SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "Propagating.");
+               } else {
+                       ClearLastResult();
+                       return E_FILE_NOT_FOUND;
+               }
        }
 
        StringTokenizer infoTokenizer(uiThemeInfoString, L" ");