aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs/parser/commandlineoption.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-06-14 10:57:38 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-06-18 10:57:25 +0200
commitb1d926024ddded2a43cc182c2d97839bb528def4 (patch)
treefe9992446242f7aa25fe1e8c2e8875b8da86dbfe /src/app/qbs/parser/commandlineoption.cpp
parent1d5c5e16a582401f5d1af299f95b57936db84593 (diff)
Some minor improvements to the Error class.
- Rename "Error" to "ErrorInfo", to make clear that this class conveys information about errors, including that there might not actually be one. - Rename "ErrorData" to "ErrorItem", to make clear that these are parts of an aggregate structure. - Introduce ErrorInfo::hasError() for quick checking of whether an error occurred. Change-Id: Icea6ed5240d6d14bd30e9cea189c6babd7004792 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/app/qbs/parser/commandlineoption.cpp')
-rw-r--r--src/app/qbs/parser/commandlineoption.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/app/qbs/parser/commandlineoption.cpp b/src/app/qbs/parser/commandlineoption.cpp
index 2fc88147a..358ed312a 100644
--- a/src/app/qbs/parser/commandlineoption.cpp
+++ b/src/app/qbs/parser/commandlineoption.cpp
@@ -49,7 +49,7 @@ void CommandLineOption::parse(CommandType command, const QString &representation
QString CommandLineOption::getArgument(const QString &representation, QStringList &input)
{
if (input.isEmpty()) {
- throw Error(Tr::tr("Invalid use of option '%1': Missing argument.\nUsage: %2")
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': Missing argument.\nUsage: %2")
.arg(representation, description(command())));
}
return input.takeFirst();
@@ -150,7 +150,7 @@ void JobsOption::doParse(const QString &representation, QStringList &input)
bool stringOk;
m_jobCount = jobCountString.toInt(&stringOk);
if (!stringOk || m_jobCount <= 0)
- throw Error(Tr::tr("Invalid use of option '%1': Illegal job count '%2'.\nUsage: %3")
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': Illegal job count '%2'.\nUsage: %3")
.arg(representation, jobCountString, description(command())));
}
@@ -219,12 +219,12 @@ void StringListOption::doParse(const QString &representation, QStringList &input
{
m_arguments = getArgument(representation, input).split(QLatin1Char(','));
if (m_arguments.isEmpty()) {
- throw Error(Tr::tr("Invalid use of option '%1': Argument list must not be empty.\n"
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': Argument list must not be empty.\n"
"Usage: %2").arg(representation, description(command())));
}
foreach (const QString &element, m_arguments) {
if (element.isEmpty()) {
- throw Error(Tr::tr("Invalid use of option '%1': Argument list must not contain "
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': Argument list must not contain "
"empty elements.\nUsage: %2")
.arg(representation, description(command())));
}
@@ -304,7 +304,7 @@ void LogLevelOption::doParse(const QString &representation, QStringList &input)
return;
}
}
- throw Error(Tr::tr("Invalid use of option '%1': Unknown log level '%2'.\nUsage: %3")
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': Unknown log level '%2'.\nUsage: %3")
.arg(representation, levelString, description(command())));
}
@@ -362,7 +362,7 @@ QString InstallRootOption::longRepresentation() const
void InstallRootOption::doParse(const QString &representation, QStringList &input)
{
if (input.isEmpty()) {
- throw Error(Tr::tr("Invalid use of option '%1: Argument expected.\n"
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1: Argument expected.\n"
"Usage: %2").arg(representation, description(command())));
}
const QString installRoot = input.takeFirst();