diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-05-30 11:33:32 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-01 09:34:50 +0200 |
commit | 6cb34bd5000b68d04b2798f6aa16134464573420 (patch) | |
tree | 9a5dc8a6a638cccf783c39ed593262c91bb2215c /src/qml/qml/qqmlfile.cpp | |
parent | 2c65dce8f68bfb03848dbd395fd1501fd7cd1510 (diff) |
Avoid string-based lookup of signals
Change-Id: I5b83b5d07b6a5d2de86d0f37471cf59baa7b0e43
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlfile.cpp')
-rw-r--r-- | src/qml/qml/qqmlfile.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlfile.cpp b/src/qml/qml/qqmlfile.cpp index 9bdd2cdabb..b0da80f102 100644 --- a/src/qml/qml/qqmlfile.cpp +++ b/src/qml/qml/qqmlfile.cpp @@ -43,6 +43,7 @@ #include <QtCore/qurl.h> #include <QtCore/qobject.h> +#include <QtCore/qmetaobject.h> #include <private/qqmlengine_p.h> #include <private/qqmlglobal_p.h> @@ -127,15 +128,14 @@ QQmlFileNetworkReply::QQmlFileNetworkReply(QQmlEngine *e, QQmlFilePrivate *p, co : m_engine(e), m_p(p), m_redirectCount(0), m_reply(0) { if (finishedIndex == -1) { + finishedIndex = QMetaMethod::fromSignal(&QQmlFileNetworkReply::finished).methodIndex(); + downloadProgressIndex = QMetaMethod::fromSignal(&QQmlFileNetworkReply::downloadProgress).methodIndex(); const QMetaObject *smo = &staticMetaObject; - finishedIndex = smo->indexOfSignal("finished()"); - downloadProgressIndex = smo->indexOfSignal("downloadProgress(qint64,qint64)"); networkFinishedIndex = smo->indexOfMethod("networkFinished()"); networkDownloadProgressIndex = smo->indexOfMethod("networkDownloadProgress(qint64,qint64)"); - const QMetaObject *rsmo = &QNetworkReply::staticMetaObject; - replyFinishedIndex = rsmo->indexOfSignal("finished()"); - replyDownloadProgressIndex = rsmo->indexOfSignal("downloadProgress(qint64,qint64)"); + replyFinishedIndex = QMetaMethod::fromSignal(&QNetworkReply::finished).methodIndex(); + replyDownloadProgressIndex = QMetaMethod::fromSignal(&QNetworkReply::downloadProgress).methodIndex(); } Q_ASSERT(finishedIndex != -1 && downloadProgressIndex != -1 && networkFinishedIndex != -1 && networkDownloadProgressIndex != -1 && |