Move config and sqlite database. They are both at the xdg-specified locations now:
authorgregor herrmann <gregoa@debian.org>
Thu, 23 Jun 2011 21:30:13 +0000 (21:30 +0000)
committergregor herrmann <gregoa@debian.org>
Thu, 23 Jun 2011 21:30:13 +0000 (21:30 +0000)
~/.local/share/data/Toastfreeware/ConfClerk/ConfClerk.sqlite
~/.config/Toastfreeware/ConfClerk.conf

TODO
src/app/appsettings.cpp
src/app/main.cpp
src/sql/sqlengine.cpp

diff --git a/TODO b/TODO
index f57ad00..f6d4d90 100644 (file)
--- a/TODO
+++ b/TODO
@@ -21,6 +21,7 @@ other:
 - copyright for icons / replace icons (gnome-icon-theme etc.)
 - add contact info
 - .pro: maybe play with install target
+- manpage
 
 --
 
@@ -28,3 +29,6 @@ schedules:
 - FOSDEM (2011): http://fosdem.org/schedule/xml
 - DebConf (2010): http://penta.debconf.org/dc10_schedule/schedule.en.xml
 - 27C3: http://events.ccc.de/congress/2010/Fahrplan/schedule.en.xml
+
+~/.local/share/data/Toastfreeware/ConfClerk/ConfClerk.sqlite
+~/.config/Toastfreeware/ConfClerk.conf
index d206198..2569398 100644 (file)
@@ -23,7 +23,7 @@ const QString PROXY_ADDRESS_SETTING ("proxyAddress");
 const QString PROXY_PORT_SETTING ("proxyPort"); 
 const QString PROXY_ISDIRECT_SETTING ("proxyIsDirectConnection"); 
 
-QSettings AppSettings::mSettings("Ixonos", "FOSDEM");
+QSettings AppSettings::mSettings("Toastfreeware", "ConfClerk");
 
 QString AppSettings::proxyAddress()
 {
index 1dc940a..a072156 100644 (file)
@@ -40,6 +40,10 @@ int main(int argc, char *argv[])
     Application a(argc, argv);
     Application::setWindowIcon(QIcon(":/icons/fosdem.png"));
 
+    // needed by QDesktopServices
+    QCoreApplication::setOrganizationName("Toastfreeware");
+    QCoreApplication::setApplicationName("ConfClerk");
     SqlEngine::initialize(); // creates "SQLITE" DB connection
 
     QWidget *window;
index ed4170d..1a1c7f4 100644 (file)
@@ -25,6 +25,7 @@
 #include <QDateTime>
 
 #include <QDir>
+#include <QDesktopServices>
 #include "sqlengine.h"
 #include <track.h>
 #include <conference.h>
@@ -76,9 +77,12 @@ QString SqlEngine::login(const QString &aDatabaseType, const QString &aDatabaseN
 void SqlEngine::initialize()
 {
     QString databaseName;
-    if(!QDir::home().exists(".fosdem"))
-        QDir::home().mkdir(".fosdem");
-    databaseName = QDir::homePath() + "/.fosdem/" + "fosdem.sqlite";
+    QString dataDirName;
+    dataDirName = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+    QDir dataDir = QDir(dataDirName).absolutePath();
+    if(!dataDir.exists())
+        dataDir.mkpath(dataDirName);
+    databaseName = dataDirName + "ConfClerk.sqlite";
     login("QSQLITE",databaseName);
 }