summaryrefslogtreecommitdiff
path: root/src/plugins/qmljstools
diff options
context:
space:
mode:
authorMarco Benelli <marco.benelli@qt.io>2018-01-08 11:14:05 +0100
committerMarco Benelli <marco.benelli@qt.io>2018-01-08 13:15:23 +0000
commitd11e31230cd09a7777af60fb3aa04995fea3bb16 (patch)
tree667270e94d67648df59de001995b48229e2af482 /src/plugins/qmljstools
parentfdf95a2fe7d683f7532ef8d075171f074747e7e1 (diff)
downloadqt-creator-d11e31230cd09a7777af60fb3aa04995fea3bb16.tar.gz
QmlJs: remove bundles for QtQuick1 type descriptions
QtCreator now assumes that QtQuick2 is used, so the relevant bundle is loaded unconditionally. Change-Id: Ib6b7b0c9a949e74edf0e0b7f68b0c774d7bcb451 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmljstools')
-rw-r--r--src/plugins/qmljstools/qmljsbundleprovider.cpp73
1 files changed, 20 insertions, 53 deletions
diff --git a/src/plugins/qmljstools/qmljsbundleprovider.cpp b/src/plugins/qmljstools/qmljsbundleprovider.cpp
index 8fa30ae870..d73665f9da 100644
--- a/src/plugins/qmljstools/qmljsbundleprovider.cpp
+++ b/src/plugins/qmljstools/qmljsbundleprovider.cpp
@@ -110,12 +110,6 @@ void BasicBundleProvider::mergeBundlesForKit(ProjectExplorer::Kit *kit
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(kit);
if (!qtVersion) {
- QmlBundle b1(defaultQt4QtQuick1Bundle());
- bundles.mergeBundleForLanguage(Dialect::Qml, b1);
- bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, b1);
- QmlBundle b11(defaultQt5QtQuick1Bundle());
- bundles.mergeBundleForLanguage(Dialect::Qml, b11);
- bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, b11);
QmlBundle b2(defaultQt5QtQuick2Bundle());
bundles.mergeBundleForLanguage(Dialect::Qml, b2);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2, b2);
@@ -125,55 +119,28 @@ void BasicBundleProvider::mergeBundlesForKit(ProjectExplorer::Kit *kit
QString qtImportsPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
QString qtQmlPath = qtVersion->qmlPath().toString();
- QSet<Core::Id> features = qtVersion->availableFeatures();
- if (features.contains(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX)) {
- myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtImportsPath);
- QDir qtQuick1Bundles(qtImportsPath);
- qtQuick1Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));
- QmlBundle qtQuick1Bundle;
- QFileInfoList list = qtQuick1Bundles.entryInfoList();
- for (int i = 0; i < list.size(); ++i) {
- QmlBundle bAtt;
- QStringList errors;
- if (!bAtt.readFrom(list.value(i).filePath(), &errors))
- qWarning() << "BasicBundleProvider: ERROR reading " << list[i].filePath() << " : "
- << errors;
- qtQuick1Bundle.merge(bAtt);
- }
- if (!qtQuick1Bundle.supportedImports().contains(QLatin1String("QtQuick 1."),
- PersistentTrie::Partial)) {
- if (qtVersion->qtVersion().majorVersion == 4)
- qtQuick1Bundle.merge(defaultQt4QtQuick1Bundle());
- else if (qtVersion->qtVersion().majorVersion > 4)
- qtQuick1Bundle.merge(defaultQt5QtQuick1Bundle());
- }
- qtQuick1Bundle.replaceVars(myReplacements);
- bundles.mergeBundleForLanguage(Dialect::Qml, qtQuick1Bundle);
- bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, qtQuick1Bundle);
+ myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtQmlPath);
+ QDir qtQuick2Bundles(qtQmlPath);
+ qtQuick2Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));
+ QmlBundle qtQuick2Bundle;
+ QFileInfoList list = qtQuick2Bundles.entryInfoList();
+ for (int i = 0; i < list.size(); ++i) {
+ QmlBundle bAtt;
+ QStringList errors;
+ if (!bAtt.readFrom(list.value(i).filePath(), &errors))
+ qWarning() << "BasicBundleProvider: ERROR reading " << list[i].filePath() << " : "
+ << errors;
+ qtQuick2Bundle.merge(bAtt);
}
- if (features.contains(Core::Id::versionedId(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX, 2))) {
- myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtQmlPath);
- QDir qtQuick2Bundles(qtQmlPath);
- qtQuick2Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));
- QmlBundle qtQuick2Bundle;
- QFileInfoList list = qtQuick2Bundles.entryInfoList();
- for (int i = 0; i < list.size(); ++i) {
- QmlBundle bAtt;
- QStringList errors;
- if (!bAtt.readFrom(list.value(i).filePath(), &errors))
- qWarning() << "BasicBundleProvider: ERROR reading " << list[i].filePath() << " : "
- << errors;
- qtQuick2Bundle.merge(bAtt);
- }
- if (!qtQuick2Bundle.supportedImports().contains(QLatin1String("QtQuick 2."),
- PersistentTrie::Partial)) {
- qtQuick2Bundle.merge(defaultQt5QtQuick2Bundle());
- }
- qtQuick2Bundle.replaceVars(myReplacements);
- bundles.mergeBundleForLanguage(Dialect::Qml, qtQuick2Bundle);
- bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2, qtQuick2Bundle);
- bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2Ui, qtQuick2Bundle);
+ if (!qtQuick2Bundle.supportedImports().contains(QLatin1String("QtQuick 2."),
+ PersistentTrie::Partial)) {
+ qtQuick2Bundle.merge(defaultQt5QtQuick2Bundle());
}
+ qtQuick2Bundle.replaceVars(myReplacements);
+ bundles.mergeBundleForLanguage(Dialect::Qml, qtQuick2Bundle);
+ bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2, qtQuick2Bundle);
+ bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2Ui, qtQuick2Bundle);
+
}
static QList<IBundleProvider *> g_bundleProviders;