From bc889a1622ffefcb617f0f0f85d1245b1acacec9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 23 Dec 2015 14:01:26 +0100 Subject: QQuickStyleSelector: don't include an empty style name as a selector This solves the recently surfaced QML import issue: ASSERT failure in QQmlImportDatabase::importDynamicPlugin: "Internal error: Plugin imported previously with different uri", file /home/qt/work/qt/qtdeclarative/src/qml/qml/qqmlimport.cpp, line 1947 Because QQuickStyleSelector included double slashes, the path ("Qt/labs/controls//") got converted to a uri with an extra dot in the end ("Qt.labs.controls."), which conflicted with the actual uri "Qt.labs.controls". Somehow related to qtbase commit 2e1de7f which changed QUrl behavior with local files. Change-Id: I8236a685a68dcffcd5f03c439236b2e8ea04492e Reviewed-by: Simon Hausmann --- src/controls/qquickstyleselector.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controls/qquickstyleselector.cpp b/src/controls/qquickstyleselector.cpp index a56670e8..6779836c 100644 --- a/src/controls/qquickstyleselector.cpp +++ b/src/controls/qquickstyleselector.cpp @@ -163,7 +163,10 @@ QStringList QQuickStyleSelector::allSelectors() const Q_D(const QQuickStyleSelector); QMutexLocker locker(&sharedDataMutex); QQuickStyleSelectorPrivate::updateSelectors(); - return QStringList(d->style) + sharedData->staticSelectors; + QStringList selectors = sharedData->staticSelectors; + if (!d->style.isEmpty()) + selectors.prepend(d->style); + return selectors; } void QQuickStyleSelector::setBaseUrl(const QUrl &base) -- cgit v1.2.3