From df168536ca1aaf0b147e67ef214bf35dfd34e441 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 30 May 2019 01:14:31 +0200 Subject: 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 --- src/vsession.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/vsession.cpp') 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 #include #include @@ -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; -- cgit v1.2.3-55-g7522