diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextinput.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 12 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeimageprovider.cpp | 16 | ||||
-rw-r--r-- | src/plugins/bearer/icd/qicdengine.cpp | 3 |
5 files changed, 27 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index e05f4e4..4e16d24 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -643,6 +643,8 @@ int QDeclarativeTextEdit::cursorPosition() const void QDeclarativeTextEdit::setCursorPosition(int pos) { Q_D(QDeclarativeTextEdit); + if (pos < 0 || pos > d->text.length()) + return; QTextCursor cursor = d->control->textCursor(); if (cursor.position() == pos) return; diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index df103de..521e4ab 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -437,6 +437,8 @@ int QDeclarativeTextInput::cursorPosition() const void QDeclarativeTextInput::setCursorPosition(int cp) { Q_D(QDeclarativeTextInput); + if (cp < 0 || cp > d->control->text().length()) + return; d->control->moveCursor(cp); } diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 201e675..cf3ea42 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -760,8 +760,10 @@ QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url, QSize *s QImage image; QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host()); locker.unlock(); - if (provider) - image = provider->requestImage(url.path().mid(1), size, req_size); + if (provider) { + QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); + image = provider->requestImage(imageId, size, req_size); + } return image; } @@ -771,8 +773,10 @@ QPixmap QDeclarativeEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize QPixmap pixmap; QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host()); locker.unlock(); - if (provider) - pixmap = provider->requestPixmap(url.path().mid(1), size, req_size); + if (provider) { + QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); + pixmap = provider->requestPixmap(imageId, size, req_size); + } return pixmap; } diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index ef31be7..e3da645 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -182,13 +182,17 @@ QDeclarativeImageProvider::ImageType QDeclarativeImageProvider::imageType() cons Implement this method to return the image with \a id. The default implementation returns an empty image. + The \a id is the requested image source, with the "image:" scheme and + provider identifier removed. For example, if the image \l{Image::}{source} + was "image://myprovider/icons/home", the given \a id would be "icons/home". + The \a requestedSize corresponds to the \l {Image::sourceSize} requested by an Image element. If \a requestedSize is a valid size, the image returned should be of that size. In all cases, \a size must be set to the original size of the image. This - is used to set the \l {Item::}{width} and \l {Item::}{height} of image - elements that should be automatically sized to the loaded image. + is used to set the \l {Item::}{width} and \l {Item::}{height} of the + relevant \l Image if these values have not been set explicitly. \note this method may be called by multiple threads, so ensure the implementation of this method is reentrant. @@ -207,13 +211,17 @@ QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, c Implement this method to return the pixmap with \a id. The default implementation returns an empty pixmap. + The \a id is the requested image source, with the "image:" scheme and + provider identifier removed. For example, if the image \l{Image::}{source} + was "image://myprovider/icons/home", the given \a id would be "icons/home". + The \a requestedSize corresponds to the \l {Image::sourceSize} requested by an Image element. If \a requestedSize is a valid size, the image returned should be of that size. In all cases, \a size must be set to the original size of the image. This - is used to set the \l {Item::}{width} and \l {Item::}{height} of image - elements that should be automatically sized to the loaded image. + is used to set the \l {Item::}{width} and \l {Item::}{height} of the + relevant \l Image if these values have not been set explicitly. */ QPixmap QDeclarativeImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) { diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index a5a183b..96827f3 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -966,6 +966,9 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) void QIcdEngine::icdServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner) { + Q_UNUSED(serviceName); + Q_UNUSED(oldOwner); + QMutexLocker locker(&mutex); if (newOwner.isEmpty()) { |