0.7.1
[fapman] / mainwindow.cpp
index 24a61a5..f44c9e7 100644 (file)
@@ -19,7 +19,8 @@ extern "C"
 
 extern "C"
 {
-    #include <sys/vfs.h>
+#include <sys/vfs.h>
+#include <unistd.h>
 }
 
 #include "mainwindow.h"
@@ -120,6 +121,16 @@ MainWindow::MainWindow(QWidget *parent) :
         }
     }
 
+    // workaround for Trolltech.conf getting owned by root..
+#ifdef Q_WS_MAEMO_5
+    QFileInfo trollConf("/home/user/.config/Trolltech.conf");
+    if( trollConf.exists() && trollConf.ownerId() == 0 )
+    {
+        uint uid = 29999; // "user" (maemo5)
+        uint gid = 29999; // "users" (maemo5)
+        chown(trollConf.absoluteFilePath().toAscii(), uid, gid);
+    }
+#endif
 
     iMediaObject = new Phonon::MediaObject(this);
     Phonon::AudioOutput* aout = new Phonon::AudioOutput(Phonon::NotificationCategory, this);