stifui/qt/src/uisetting.cpp
branchRCL_3
changeset 22 822c625f7adc
parent 14 404ad6c9bc20
child 31 e7a04a6385be
--- a/stifui/qt/src/uisetting.cpp	Tue May 11 16:14:15 2010 +0300
+++ b/stifui/qt/src/uisetting.cpp	Wed Jun 09 09:42:37 2010 +0300
@@ -40,6 +40,11 @@
         {
         value = settingList.value(item);
         }
+    else
+        {
+        value = getDefaultValue(item);
+        settingList.insert(item, value);
+        }
     return value;
     }
 
@@ -58,10 +63,24 @@
 void UiSetting::loadDefault()
     {
     settingList.clear();
-    settingList.insert("showoutput", "true");
+    settingList.insert(KShowOutput, getDefaultValue(KShowOutput));
+    settingList.insert(KStyleSheet, getDefaultValue(KStyleSheet));
     //add mor default setting here.
     }
 
+QString UiSetting::getDefaultValue(const QString& item)
+    {
+    QString result = "";
+    if(item == KShowOutput)
+        {
+        result = "true";
+        }
+    else if(item == KStyleSheet)
+        {
+        result = ":/qss/coffee.qss";
+        }
+    return result;
+    }
 
 bool UiSetting::load()
     {
@@ -75,7 +94,7 @@
     int index;
     while(!in.atEnd())
         {
-        line = in.readLine().trimmed().toLower();
+        line = in.readLine().trimmed();
         if(!line.startsWith("//"))
             {
             index = line.indexOf("=");