summaryrefslogtreecommitdiffstats
path: root/src/server/main.cpp
diff options
context:
space:
mode:
authorsr2013-02-04 19:50:31 +0100
committersr2013-02-04 19:50:31 +0100
commit1a5709501f94014d41987b956338bb6424b9f90c (patch)
treed3b93fe8dc406bca56aff147ef5cc4cbf9ed6be0 /src/server/main.cpp
parentTest (diff)
downloadpvs2-1a5709501f94014d41987b956338bb6424b9f90c.tar.gz
pvs2-1a5709501f94014d41987b956338bb6424b9f90c.tar.xz
pvs2-1a5709501f94014d41987b956338bb6424b9f90c.zip
Initial commit
Diffstat (limited to 'src/server/main.cpp')
-rw-r--r--src/server/main.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/server/main.cpp b/src/server/main.cpp
new file mode 100644
index 0000000..e7c709a
--- /dev/null
+++ b/src/server/main.cpp
@@ -0,0 +1,41 @@
+#include "mainwindow/mainwindow.h"
+#include "util/util.h"
+
+int main(int argc, char** argv)
+{
+ QApplication app(argc, argv);
+ app.setOrganizationName("openslx");
+ app.setOrganizationDomain("openslx.org");
+ app.setApplicationName("pvsmgr");
+
+ qsrand((uint)QDateTime::currentMSecsSinceEpoch());
+
+ // Make sure settings directory exists
+ do {
+ USER_SETTINGS(settings);
+ QFileInfo fi(settings.fileName());
+ QDir path(fi.path());
+ qDebug() << "Settings directory is " << fi.path();
+ if (!path.exists())
+ path.mkpath(path.absolutePath());
+ // Now check if settings file exists. If not, copy system default (if available)
+ if (!fi.exists())
+ {
+ SYSTEM_SETTINGS(sys);
+ QFileInfo sysfi(sys.fileName());
+ if (sysfi.exists())
+ {
+ if (!QFile::copy(sys.fileName(), settings.fileName()))
+ qDebug() << "Copying default settings from " << sys.fileName() << " to " << settings.fileName() << " failed.";
+ }
+ }
+ } while (0);
+
+ // use system locale as language to translate gui
+ QTranslator translator;
+ translator.load(":pvsmgr");
+ app.installTranslator(&translator);
+
+ MainWindow pvsmgr;
+ return app.exec();
+}