summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcompileddata.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-12-03 07:00:44 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-12-03 07:00:44 (GMT)
commitc901e373c8402d2542b708831deb4a5773624b1b (patch)
tree00deae96b0db3e864295ab51b171a2c6126b7e9f /src/declarative/qml/qmlcompileddata.cpp
parent3338430a0a421eab2cb61f446675303585b0b1dd (diff)
downloadQt-c901e373c8402d2542b708831deb4a5773624b1b.zip
Qt-c901e373c8402d2542b708831deb4a5773624b1b.tar.gz
Qt-c901e373c8402d2542b708831deb4a5773624b1b.tar.bz2
Avoid QString <-> QUrl conversions
Diffstat (limited to 'src/declarative/qml/qmlcompileddata.cpp')
-rw-r--r--src/declarative/qml/qmlcompileddata.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlcompileddata.cpp b/src/declarative/qml/qmlcompileddata.cpp
index c4a0b59..c41ee3f 100644
--- a/src/declarative/qml/qmlcompileddata.cpp
+++ b/src/declarative/qml/qmlcompileddata.cpp
@@ -85,6 +85,16 @@ int QmlCompiledData::indexForByteArray(const QByteArray &data)
return idx;
}
+int QmlCompiledData::indexForUrl(const QUrl &data)
+{
+ int idx = urls.indexOf(data);
+ if (idx == -1) {
+ idx = urls.count();
+ urls << data;
+ }
+ return idx;
+}
+
int QmlCompiledData::indexForFloat(float *data, int count)
{
Q_ASSERT(count > 0);