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/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index fbb3f67..faef051 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,7 @@ int main(int argc, char *argv[]) { "Console", "Usage: vmchooser [ OPTIONS | FILE ]\n\n" " -d, --default name of default session\n" + " -P, --pool name of the environment\n" " -p, --path path to vmware .xml files\n" " -x, --xpath path of X Session .desktop files\n" " -s, --size window size x\n" @@ -149,6 +150,14 @@ int main(int argc, char *argv[]) { height = VMCHOOSER_DEFAULT_HEIGHT; } + if (cmdOptions.contains("pool")) { + pool = cmdOptions.value("pool"); + } else if (settings.contains("pool")) { + pool = settings.value("pool").toString(); + } else if (settings.contains("vmchooser_env")) { + pool = settings.value("vmchooser_env").toString(); + } + /* read session files */ QList xsessions(XSession::readSessions(xSessionPath)); QList vsessions(VSession::readXmlDir(vSessionPath)); -- cgit v1.2.3-55-g7522