Fixed "file with spaces in the name" bug, boot player can't read these
[bootcreen] / bootscreenR.cpp
index a00b3e4..2b1e019 100644 (file)
@@ -7,28 +7,25 @@
 
 BootScreenR::BootScreenR()
 {
-    logFile.setFileName("/home/user/.bootscreen/log.txt");
+    settingsDir = "/opt/bootscreen/data/";
+    logFile.setFileName("/opt/bootscreen/data/log.txt");
 
     if (!logFile.open(QIODevice::ReadWrite | QIODevice::Text))
         qDebug() << "Can't write log" << endl;
 
     QTextStream out(&logFile);
-    out << "log" << endl;
+    //out << "log" << endl;
     QDir dir("/home/user/");
-    if (dir.cd(".bootscreen")) {
-        settingsFile.setFileName(dir.filePath("settings.ini"));
-        if (settingsFile.exists()){
-            QSettings tempSettings(settingsFile.fileName(),QSettings::IniFormat);
-            bool random = tempSettings.value("random").toBool();
-            if(random)
-                selectRandomFile();
-        }
-        else
-           out << "Can't read settings file1111" << endl;
-     }
-     else
-        out << "Can't read settings file2222" << endl;
 
+    settingsFile.setFileName(dir.filePath("settings.ini"));
+    if (settingsFile.exists()){
+        QSettings tempSettings(settingsFile.fileName(),QSettings::IniFormat);
+        bool random = tempSettings.value("random").toBool();
+        if(random)
+            selectRandomFile();
+    }
+    else
+       out << "Can't read settings file" << endl;
 }
 
 void BootScreenR::selectRandomFile()