diff options
author | Simon Rettberg | 2019-05-30 01:14:31 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-05-30 01:14:31 +0200 |
commit | df168536ca1aaf0b147e67ef214bf35dfd34e441 (patch) | |
tree | 7ffcd8e12318c57440e733728de71cf556705c12 /src/vsession.cpp | |
parent | Add 'disable screensaver' checkbox (diff) | |
download | vmchooser2-df168536ca1aaf0b147e67ef214bf35dfd34e441.tar.gz vmchooser2-df168536ca1aaf0b147e67ef214bf35dfd34e441.tar.xz vmchooser2-df168536ca1aaf0b147e67ef214bf35dfd34e441.zip |
Cleanup, and rewrite cmdline + settings handling
Command line parsing now uses QCommandLineXXX classes
Old unused options have been removed, like the "pools" feature
Closes #3599
Diffstat (limited to 'src/vsession.cpp')
-rw-r--r-- | src/vsession.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/vsession.cpp b/src/vsession.cpp index e35c1af..a4e5a7b 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -1,3 +1,5 @@ +#include "config.h" + #include <QtXml> #include <QDir> #include <QApplication> @@ -107,7 +109,7 @@ QString VSession::toXml() const { .toElement(); if (QFileInfo(image).isRelative()) { // make path to image absolute - path.setAttribute("param", g_vmBasePath + "/" + image); + path.setAttribute("param", Config::get(Config::BASEDIR) + "/" + image); } else { path.setAttribute("param", image); } @@ -205,15 +207,7 @@ bool VSession::isActive() const { return false; } } - // Filtering by pool name - if (!g_currentPoolName.isEmpty()) { - QStringList pools = getAttribute("pools").split("\\s*,\\s*"); - if (!pools.isEmpty() && !pools.contains(g_currentPoolName)) { - // pools does not contain pool - if (g_debugMode) qDebug() << "'" << shortDescription() << "' not active. Reason: '" << g_currentPoolName << "' is not part of active pool list (" << pools << ")"; - return false; - } - } + // Filter by LDAP data if (!UserLdapData::isEmpty()) { QDomElement el(eintrag_.namedItem("filters").firstChildElement("filter")); @@ -286,7 +280,7 @@ bool VSession::run() const { tmpfile.close(); QObject::connect(&_process, SIGNAL(finished(int, QProcess::ExitStatus)), QApplication::instance(), SLOT(quit())); - _process.start(g_runVmScript, QStringList(tmpFileName)); + _process.start(Config::get(Config::RUNSCRIPT), QStringList(tmpFileName)); _process.waitForStarted(10); if (_process.state() == QProcess::Starting || _process.state() == QProcess::Running) return true; |