aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-11-21 15:03:21 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2012-11-22 11:44:09 +0100
commit7e007a8e65ff3fcc1f37cc316df874bfceb1f9db (patch)
tree857152876b209b97d0d15337657c0f08da9d3d6a
parent8119f310d5bffc9764fa2ef14d68e964c6a89b7f (diff)
setup-qt: use common error class
Change-Id: I13f12ffe0cdbfdef61d15b1fe29c9da1a96fc577 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
-rw-r--r--src/app/qbs-setup-qt/main.cpp4
-rw-r--r--src/app/qbs-setup-qt/setupqt.cpp4
-rw-r--r--src/app/qbs-setup-qt/setupqt.h18
3 files changed, 5 insertions, 21 deletions
diff --git a/src/app/qbs-setup-qt/main.cpp b/src/app/qbs-setup-qt/main.cpp
index d36384058..edb82f0d1 100644
--- a/src/app/qbs-setup-qt/main.cpp
+++ b/src/app/qbs-setup-qt/main.cpp
@@ -96,8 +96,8 @@ int main(int argc, char *argv[])
} else {
printHelp();
}
- } catch (const Exception &e) {
- qbsError() << "qbs-setup-qt: " << qPrintable(e.message());
+ } catch (const Error &e) {
+ qbsError() << "qbs-setup-qt: " << qPrintable(e.toString());
return EXIT_FAILURE;
}
diff --git a/src/app/qbs-setup-qt/setupqt.cpp b/src/app/qbs-setup-qt/setupqt.cpp
index 4f2845814..c13acd529 100644
--- a/src/app/qbs-setup-qt/setupqt.cpp
+++ b/src/app/qbs-setup-qt/setupqt.cpp
@@ -164,7 +164,7 @@ QtEnviroment SetupQt::fetchEnviroment(const QString &qmakePath)
if (mkspecsPath.isEmpty()) {
mkspecsPath = queryOutput.value("QT_INSTALL_PREFIX");
if (mkspecsPath.isEmpty())
- throw Exception(tr("Cannot extract the mkspecs directory."));
+ throw Error(tr("Cannot extract the mkspecs directory."));
mkspecsPath += "/mkspecs";
}
qtEnvironment.mkspecsPath = mkspecsPath;
@@ -178,7 +178,7 @@ QtEnviroment SetupQt::fetchEnviroment(const QString &qmakePath)
qtEnvironment.mkspec = mkSpecPath(mkspecsPath);
if (!QFileInfo(qtEnvironment.mkspec).exists())
- throw Exception(tr("mkspec '%1' does not exist").arg(qtEnvironment.mkspec));
+ throw Error(tr("mkspec '%1' does not exist").arg(qtEnvironment.mkspec));
return qtEnvironment;
}
diff --git a/src/app/qbs-setup-qt/setupqt.h b/src/app/qbs-setup-qt/setupqt.h
index fb32a6b83..1359998b4 100644
--- a/src/app/qbs-setup-qt/setupqt.h
+++ b/src/app/qbs-setup-qt/setupqt.h
@@ -30,7 +30,7 @@
#ifndef QBS_SETUPQT_H
#define QBS_SETUPQT_H
-#include <QString>
+#include <tools/error.h>
#include <QCoreApplication>
namespace qbs {
@@ -54,22 +54,6 @@ struct QtEnviroment {
int qtPatchVersion;
};
-class Exception
-{
-public:
- Exception(const QString &message)
- : m_message(message)
- {}
-
- const QString &message() const
- {
- return m_message;
- }
-
-private:
- QString m_message;
-};
-
class SetupQt
{
Q_DECLARE_TR_FUNCTIONS(SetupQt)