+ QString strPath;
+
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ //For maemo fremantle or harmattan use a common path
+ QDir logDir = QDir(QDir().homePath() + "/.vicar");
+ if (!logDir.exists()){
+ if (QDir().mkpath(logDir.absolutePath())){
+ qDebug() << "Vicar: Log directory created successfully";
+ }
+ else{
+ qDebug() << "Vicar: Error creating log directory";
+ }
+ }
+ strPath = logDir.absolutePath() + "/vicar.log";
+#else
+ strPath = "vicar.log";
+#endif
+ logFile = new QFile(strPath,this);
+
+ if (!logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
+ qDebug() << "Vicar: Error opening logfile for writing at path " << strPath;
+ }