summaryrefslogtreecommitdiff
path: root/resourceqt-client/commandlineparser.cpp
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-11-18 07:43:29 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-11-18 07:43:29 +0200
commit25c021cf36e2ce1924d2fb253f147c3ed8726bf2 (patch)
tree74ea0f86f5ca2533d8bc4171fb0ef38d82204c1b /resourceqt-client/commandlineparser.cpp
parent4b949a43b56a2336499c30e2bdc4c1cda8e81a68 (diff)
downloadlibresourceqt-25c021cf36e2ce1924d2fb253f147c3ed8726bf2.tar.gz
Added support for the -p (prefix) flag
Diffstat (limited to 'resourceqt-client/commandlineparser.cpp')
-rw-r--r--resourceqt-client/commandlineparser.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/resourceqt-client/commandlineparser.cpp b/resourceqt-client/commandlineparser.cpp
index f169801..24658ea 100644
--- a/resourceqt-client/commandlineparser.cpp
+++ b/resourceqt-client/commandlineparser.cpp
@@ -28,7 +28,7 @@ QHash<QString, ResourcePolicy::ResourceType> CommandLineParser::resourceValues;
CommandLineParser::CommandLineParser():
allResources(), optResources(), autoRelease(false), alwaysReply(false),
- verbose(false), allowUnkownResourceClass(false), output(stdout)
+ verbose(false), allowUnkownResourceClass(false), output(stdout), prefix("")
{
resourceValues["AudioPlayback"] = ResourcePolicy::AudioPlaybackType;
resourceValues["VideoPlayback"] = ResourcePolicy::VideoPlaybackType;
@@ -82,6 +82,9 @@ bool CommandLineParser::parseArguments()
case 'v':
verbose = true;
break;
+ case 'p':
+ parsePrefix(*(++ci));
+ break;
case 'h':
default:
usage();
@@ -139,6 +142,16 @@ bool CommandLineParser::parseClassString(const QString &str)
return true;
}
+void CommandLineParser::parsePrefix(const QString &str)
+{
+ prefix = str + ": ";
+}
+
+QString CommandLineParser::getPrefix() const
+{
+ return prefix;
+}
+
bool CommandLineParser::parseResourceList(const QString &resourceListStr,
QSet<ResourcePolicy::ResourceType> &resources)
{