summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlerror.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-07-16 21:36:34 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-07-16 21:36:34 (GMT)
commit6470f646d0815f67bab507c1362cdda775c42a6e (patch)
tree6389ca2728ec8b78294af60e20b918fdccdf88f1 /src/declarative/qml/qmlerror.cpp
parent50f400ac20e918db1d0a6496003d953dedaba42a (diff)
parent3bd0062535aaa991fadf739f9362851afacb19eb (diff)
downloadQt-6470f646d0815f67bab507c1362cdda775c42a6e.zip
Qt-6470f646d0815f67bab507c1362cdda775c42a6e.tar.gz
Qt-6470f646d0815f67bab507c1362cdda775c42a6e.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlerror.cpp')
-rw-r--r--src/declarative/qml/qmlerror.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/declarative/qml/qmlerror.cpp b/src/declarative/qml/qmlerror.cpp
index 149e173..5ee9144 100644
--- a/src/declarative/qml/qmlerror.cpp
+++ b/src/declarative/qml/qmlerror.cpp
@@ -168,6 +168,21 @@ void QmlError::setColumn(int column)
}
/*!
+ Return the error as a human readable string.
+*/
+QString QmlError::toString() const
+{
+ QString rv;
+ rv = url().toString() + QLatin1String(":") + QString::number(line());
+ if(column() != -1)
+ rv += QLatin1String(":") + QString::number(column());
+
+ rv += QLatin1String(": ") + description();
+
+ return rv;
+}
+
+/*!
\relates QmlError
\fn QDebug operator<<(QDebug debug, const QmlError &error)
@@ -176,19 +191,9 @@ void QmlError::setColumn(int column)
QDebug operator<<(QDebug debug, const QmlError &error)
{
- QUrl url = error.url();
-
- QString output;
-
- output = url.toString() + QLatin1String(":") +
- QString::number(error.line());
+ debug << qPrintable(error.toString());
- if(error.column() != -1)
- output += QLatin1String(":") + QString::number(error.column());
-
- output += QLatin1String(": ") + error.description();
-
- debug << qPrintable(output);
+ QUrl url = error.url();
if (error.line() > 0 && url.scheme() == QLatin1String("file")) {
QString file = url.toLocalFile();