skin: using QUrl::fromLocalFile 22/26122/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 18 Aug 2014 03:05:38 +0000 (12:05 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Mon, 18 Aug 2014 03:16:57 +0000 (12:16 +0900)
This function accepts paths separated by slashes
as well as the native separator for this platform.

Change-Id: I99364b1de298cce9e8918378ce67ac58cbba5e97
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/display/qt5_supplement.cpp

index 5942efb54b6d5348c28e5669e69d645f3cc1b837..d050023feb6bf5b52f3f0742bb5fedf526ff8432 100644 (file)
@@ -68,14 +68,14 @@ void qt5_skin_init(void)
     /* parameter parsing */
     // TODO:
 
-    uiInfo->vmName = get_emul_vm_name();
+    uiInfo->vmName = QString(get_emul_vm_name()).trimmed();
     uiInfo->resolution.setWidth(get_emul_resolution_width());
     uiInfo->resolution.setHeight(get_emul_resolution_height());
     uiInfo->basePort = get_emul_vm_base_port() + 1;
 
     uiInfo->skinPath = get_emul_skin_path();
-    if (uiInfo->skinPath.endsWith('/') == false) {
-        uiInfo->skinPath += "/";
+    if (uiInfo->skinPath.endsWith(QDir::separator()) == false) {
+        uiInfo->skinPath += QDir::separator();
     }
     QSettings skinInfo(uiInfo->skinPath + "info.ini", QSettings::IniFormat);
     QString skinName = skinInfo.value("skin.name").toString();
@@ -102,7 +102,7 @@ void qt5_skin_init(void)
     QDir skinDir(uiInfo->skinPath + CON_FORM_SUBPATH);
     QFileInfoList entries = skinDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
     for (int i = 0; i < entries.size(); i++) {
-        QFile conXMLFile(entries.at(i).filePath() + '/' + FORM_FILE_NAME);
+        QFile conXMLFile(entries.at(i).filePath() + QDir::separator() + FORM_FILE_NAME);
         loadControllerFormFromXML(&conXMLFile, uiInfo);
     }
 
@@ -199,7 +199,7 @@ void loadSkinFormFromXML(QFile *file, UIInformation *uiInfo/* out */)
     QQmlEngine *engine = new QQmlEngine();
     QQmlComponent *component = new QQmlComponent(engine);
 
-    component->loadUrl(QUrl(file->fileName()));
+    component->loadUrl(QUrl::fromLocalFile(file->fileName()));
     if (!component->isReady()) {
         qWarning("%s", qPrintable(component->errorString()));
     }
@@ -221,10 +221,10 @@ void loadSkinFormFromXML(QFile *file, UIInformation *uiInfo/* out */)
             formType = (FormType *)formListType->getFormList()->at(index); /* src */
 
             form->displayRegion = formType->getDisplayRegion();
-            form->skinImg[SkinForm::normal].load(
-                        fileInfo.absolutePath() + "/" + formType->mainImageName());
-            form->skinImg[SkinForm::pressed].load(
-                        fileInfo.absolutePath() + "/" + formType->pressedImageName());
+            form->skinImg[SkinForm::normal].load(fileInfo.absolutePath()
+                + QDir::separator() + formType->mainImageName());
+            form->skinImg[SkinForm::pressed].load(fileInfo.absolutePath()
+                + QDir::separator() + formType->pressedImageName());
 
             keyListType = formType->keyListType();
             if (keyListType != NULL) {
@@ -260,7 +260,7 @@ void loadControllerFormFromXML(QFile *file, UIInformation *uiInfo/* out */)
     QQmlEngine *engine = new QQmlEngine();
     QQmlComponent *component = new QQmlComponent(engine);
 
-    component->loadUrl(QUrl(file->fileName()));
+    component->loadUrl(QUrl::fromLocalFile(file->fileName()));
     if (!component->isReady()) {
         qWarning("%s", qPrintable(component->errorString()));
     }
@@ -275,10 +275,10 @@ void loadControllerFormFromXML(QFile *file, UIInformation *uiInfo/* out */)
         HardwareKeyType *hwKeyType = NULL;
 
         ControllerForm *form = new ControllerForm(fileInfo.dir().dirName());
-        form->conImg[ControllerForm::normal].load(
-            fileInfo.absolutePath() + "/" + formType->mainImageName());
-        form->conImg[ControllerForm::pressed].load(
-            fileInfo.absolutePath() + "/" + formType->pressedImageName());
+        form->conImg[ControllerForm::normal].load(fileInfo.absolutePath()
+            + QDir::separator() + formType->mainImageName());
+        form->conImg[ControllerForm::pressed].load(fileInfo.absolutePath()
+            + QDir::separator() + formType->pressedImageName());
 
         keyListType = formType->keyListType();
         if (keyListType != NULL) {