diff options
author | Christian Klinger | 2016-09-30 12:02:38 +0200 |
---|---|---|
committer | Christian Klinger | 2016-09-30 12:02:38 +0200 |
commit | 877607b07f30cbb8d7d8d06b1b91383095fdc144 (patch) | |
tree | 4c2ca41db4b9caa8e6c370237771d58bd99d7f13 /src/server/main.cpp | |
parent | added a pre-commit hook for astyle. (diff) | |
download | pvs2-877607b07f30cbb8d7d8d06b1b91383095fdc144.tar.gz pvs2-877607b07f30cbb8d7d8d06b1b91383095fdc144.tar.xz pvs2-877607b07f30cbb8d7d8d06b1b91383095fdc144.zip |
refactoring.
Diffstat (limited to 'src/server/main.cpp')
-rw-r--r-- | src/server/main.cpp | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/src/server/main.cpp b/src/server/main.cpp index 02fd399..9c44adf 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -1,9 +1,8 @@ #include <iostream> #include <stdlib.h> #include "mainwindow/mainwindow.h" -#include "util/util.h" -#include "util/global.h" #include "../shared/settings.h" +#include "serverapp/serverapp.h" using std::cout; using std::endl; @@ -23,22 +22,15 @@ void usage() int main(int argc, char** argv) { - QApplication app(argc, argv); - - app.setOrganizationName("openslx"); - app.setOrganizationDomain("openslx.org"); - app.setApplicationName("pvsmgr"); + ServerApp app(argc, argv); for (QString a : app.arguments()) { - if (a == "--manager-only") { - Global::manager_only = true; - break; - } else if (a.startsWith("--config=")) { - Global::setIniPath(a.mid(9)); - } else if (a == "--usage" || a == "--help") { + if (a == "--usage" || a == "--help") { usage(); exit(0); - } else if (!a.endsWith("pvsmgr")) { + } else if (a.endsWith("pvsmgr")) { + /* ignore */ + } else { qDebug() << "ignoring unknown argument: \"" << a << "\""; } } @@ -54,18 +46,5 @@ int main(int argc, char** argv) qsrand((uint)QDateTime::currentMSecsSinceEpoch()); - // Set the global path of the settings - QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, "/opt/"); - QSharedPointer<QSettings> sys = Global::getSettings(); - qDebug() << "System settings are in:" << sys->fileName(); - QFileInfo sysfi(sys->fileName()); - - - // use system locale as language to translate gui - QTranslator translator; - translator.load(":pvsmgr"); - app.installTranslator(&translator); - - MainWindow pvsmgr; return app.exec(); } |