From 162121941f6d7bccc4c8f4e98431441e0afe8460 Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Thu, 4 Nov 2010 14:02:39 +0100 Subject: Config option: pool * formerly vmchooser_env in vmchooser.conf * pool/vmchooser_env in vmchooser.conf * -P/--pools command line option * a virtual session will only be displayed if a) their pools attribute contains pool b) their pools attribute is unset/empty c) pool is unset/empty * fix for segfault with invalid command line options --- src/vsession.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/vsession.cpp') diff --git a/src/vsession.cpp b/src/vsession.cpp index d3c0296..edcd1e8 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -111,6 +111,12 @@ bool VSession::isActive() const { } } + if (!pool.isEmpty() && + !getAttribute("pools").split("\\s*,\\s*").contains(pool)) { + // pools does not contain pool + return false; + } + return true; } @@ -182,7 +188,8 @@ void VSession::addUserAndHostname() { QString image(this->getAttribute("image_name")); if (QFileInfo(image).isRelative()) { // make path to image absolute - this->addNodeWithAttribute("image_name", this->baseDirPath_ + "/" + image); + this->addNodeWithAttribute("image_name", + this->baseDirPath_ + "/" + image); } // insert computername as the first child of -- cgit v1.2.3-55-g7522