summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a8ce657..41600a6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -112,13 +112,13 @@ int main(int argc, char *argv[]) {
std::cerr << a.translate("Console", "Requested --config not found: ").toUtf8().constData() << cmdOptions.value("config").toUtf8().constData() << std::endl;
}
}
- if (confFile.isEmpty() && QFileInfo(userConfFile).exists()) {
- confFile = userConfFile;
- std::cerr << a.translate("Console", "Using user specific config: ").toUtf8().constData() << userConfFile.toUtf8().constData() << std::endl;
+ if (confFile.isEmpty() && QFileInfo(CONFIG_FILE_USER).exists()) {
+ confFile = CONFIG_FILE_USER;
+ std::cerr << a.translate("Console", "Using user specific config: ").toUtf8().constData() << CONFIG_FILE_USER.toUtf8().constData() << std::endl;
}
- if (confFile.isEmpty() && QFileInfo(globalConfFile).exists()) {
- confFile = globalConfFile;
- std::cerr << a.translate("Console", "Using global config: ").toUtf8().constData() << globalConfFile.toUtf8().constData() << std::endl;
+ if (confFile.isEmpty() && QFileInfo(CONFIG_FILE_GLOBAL).exists()) {
+ confFile = CONFIG_FILE_GLOBAL;
+ std::cerr << a.translate("Console", "Using global config: ").toUtf8().constData() << CONFIG_FILE_GLOBAL.toUtf8().constData() << std::endl;
}
if (confFile.isEmpty()) {
std::cerr << a.translate("Console", "No config file found or given").toUtf8().constData() << std::endl;
@@ -139,15 +139,15 @@ int main(int argc, char *argv[]) {
}
if (cmdOptions.contains("xpath")) {
- xSessionPath = cmdOptions.value("xpath");
+ g_xSessionPath = cmdOptions.value("xpath");
} else if (settings.contains("xpath")) {
- xSessionPath = settings.value("xpath").toString();
+ g_xSessionPath = settings.value("xpath").toString();
} // else keep default path
if (cmdOptions.contains("url")) {
- urlBase = cmdOptions.value("url");
+ g_urlBase = cmdOptions.value("url");
} else if (settings.contains("url")) {
- urlBase = settings.value("url").toString();
+ g_urlBase = settings.value("url").toString();
} else {
std::cerr
<< a.translate("Console", "vmchooser: no URL given").toUtf8().data()
@@ -157,20 +157,20 @@ int main(int argc, char *argv[]) {
// Change the runVmScript path
if (cmdOptions.contains("runscript")) {
- runVmScript = cmdOptions.value("runscript");
+ g_runVmScript = cmdOptions.value("runscript");
} else if (settings.contains("runscript")) {
- runVmScript = settings.value("runscript").toString();
+ g_runVmScript = settings.value("runscript").toString();
}
/* PARSE URL */
- if (!urlBase.startsWith("http://")) {
+ if (!g_urlBase.startsWith("http://")) {
std::cerr
<< a.translate("Console", "vmchooser: invalid URL").toUtf8().data()
<< std::endl;
return EXIT_FAILURE;
} else {
- if (!urlBase.endsWith("/")) {
- urlBase += "/";
+ if (!g_urlBase.endsWith("/")) {
+ g_urlBase += "/";
}
}
@@ -201,27 +201,27 @@ int main(int argc, char *argv[]) {
}
if (cmdOptions.contains("pool")) {
- pool = cmdOptions.value("pool");
+ g_currentPoolName = cmdOptions.value("pool");
} else if (settings.contains("pool")) {
- pool = settings.value("pool").toString();
+ g_currentPoolName = settings.value("pool").toString();
}
if (cmdOptions.contains("theme")) {
- theme = cmdOptions.value("theme");
+ g_themeName = cmdOptions.value("theme");
} else if (settings.contains("theme")) {
- theme = settings.value("theme").toString();
+ g_themeName = settings.value("theme").toString();
}
if (cmdOptions.contains("debugMode")) {
- debugMode = true;
+ g_debugMode = true;
}
if (cmdOptions.contains("base")) {
- basePath = cmdOptions.value("base");
+ g_vmBasePath = cmdOptions.value("base");
} else if (settings.contains("base")) {
- basePath = settings.value("base").toString();
+ g_vmBasePath = settings.value("base").toString();
} else if (settings.contains("path")) { // Compatibility to v1.0
- basePath = settings.value("path").toString();
+ g_vmBasePath = settings.value("path").toString();
}
if (cmdOptions.contains("location-mode")) {
@@ -284,7 +284,7 @@ int main(int argc, char *argv[]) {
g_allowVmEdit = cmdOptions.contains("allow-vm-edit");
/* read session files */
- QList<Session*> xsessions(XSession::readSessions(xSessionPath));
+ QList<Session*> xsessions(XSession::readSessions(g_xSessionPath));
Dialog w(defaultTab, cmdOptions.contains("exam-mode"));
@@ -295,20 +295,20 @@ int main(int argc, char *argv[]) {
// read xml and add items later
if (cmdOptions.contains("exam-mode")) {
- httpxmldownloader.makeRequest(urlBase + "list?exams=exam-mode", locationIds);
+ httpxmldownloader.makeRequest(g_urlBase + "list?exams=exam-mode", locationIds);
} else {
- httpxmldownloader.makeRequest(urlBase + "list", locationIds);
+ httpxmldownloader.makeRequest(g_urlBase + "list", locationIds);
}
/* DOWNLOAD NEWS */
HttpXmlDownloader news_downloader;
news_downloader.connectSlot(&w, SLOT(addNewsAfterDownload(QNetworkReply*)));
- news_downloader.makeRequest(urlBase + "news");
+ news_downloader.makeRequest(g_urlBase + "news");
/* DOWNLOAD HELP-SECTION */
HttpXmlDownloader help_downloader;
help_downloader.connectSlot(&w, SLOT(addHelpAfterDownload(QNetworkReply*)));
- help_downloader.makeRequest(urlBase + "help");
+ help_downloader.makeRequest(g_urlBase + "help");
w.setTheme();
@@ -318,7 +318,7 @@ int main(int argc, char *argv[]) {
if (size == "fullscreen") {
width = desktopRect.width();
height = desktopRect.height();
- _fullscreen = true;
+ g_fullscreen = true;
}
w.resize(width, height);