diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-23 14:53:01 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-28 07:47:03 +0000 |
commit | 987288bcec4507da04263ff54b3c352f0a8a27e7 (patch) | |
tree | 73b7c8b055ee3d1d9cdbefca9e60888bebd6a8b0 /src/plugins/qmljstools | |
parent | 32ae4d00368f3e5f4db9bf13264280704a68918c (diff) |
QmlJSTools: make setupProjectInfoQmlBundles private
No one needs to call this function.
Change-Id: I5647475ef2ec7dce5dcf7834245985bfb45632e6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmljstools')
-rw-r--r-- | src/plugins/qmljstools/qmljsmodelmanager.cpp | 54 | ||||
-rw-r--r-- | src/plugins/qmljstools/qmljsmodelmanager.h | 2 |
2 files changed, 25 insertions, 31 deletions
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index ca4fc55594..ef2dc86d71 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -76,6 +76,31 @@ using namespace QmlJS; namespace QmlJSTools { namespace Internal { +static void setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &projectInfo) +{ + Target *activeTarget = nullptr; + if (projectInfo.project) + activeTarget = projectInfo.project->activeTarget(); + Kit *activeKit = activeTarget ? activeTarget->kit() : KitManager::defaultKit(); + const QHash<QString, QString> replacements = {{QLatin1String("$(QT_INSTALL_QML)"), projectInfo.qtQmlPath}}; + + for (IBundleProvider *bp : IBundleProvider::allBundleProviders()) + bp->mergeBundlesForKit(activeKit, projectInfo.activeBundle, replacements); + + projectInfo.extendedBundle = projectInfo.activeBundle; + + if (projectInfo.project) { + QSet<Kit *> currentKits; + foreach (const Target *t, projectInfo.project->targets()) + currentKits.insert(t->kit()); + currentKits.remove(activeKit); + foreach (Kit *kit, currentKits) { + for (IBundleProvider *bp : IBundleProvider::allBundleProviders()) + bp->mergeBundlesForKit(kit, projectInfo.extendedBundle, replacements); + } + } +} + ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( Project *project) const { @@ -139,35 +164,6 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( return projectInfo; } -} // namespace Internal - -void setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &projectInfo) -{ - Target *activeTarget = nullptr; - if (projectInfo.project) - activeTarget = projectInfo.project->activeTarget(); - Kit *activeKit = activeTarget ? activeTarget->kit() : KitManager::defaultKit(); - const QHash<QString, QString> replacements = {{QLatin1String("$(QT_INSTALL_QML)"), projectInfo.qtQmlPath}}; - - for (IBundleProvider *bp : IBundleProvider::allBundleProviders()) - bp->mergeBundlesForKit(activeKit, projectInfo.activeBundle, replacements); - - projectInfo.extendedBundle = projectInfo.activeBundle; - - if (projectInfo.project) { - QSet<Kit *> currentKits; - foreach (const Target *t, projectInfo.project->targets()) - currentKits.insert(t->kit()); - currentKits.remove(activeKit); - foreach (Kit *kit, currentKits) { - for (IBundleProvider *bp : IBundleProvider::allBundleProviders()) - bp->mergeBundlesForKit(kit, projectInfo.extendedBundle, replacements); - } - } -} - -namespace Internal { - QHash<QString,Dialect> ModelManager::initLanguageForSuffix() const { QHash<QString,Dialect> res = ModelManagerInterface::languageForSuffix(); diff --git a/src/plugins/qmljstools/qmljsmodelmanager.h b/src/plugins/qmljstools/qmljsmodelmanager.h index 678882ec3a..be953d2a27 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.h +++ b/src/plugins/qmljstools/qmljsmodelmanager.h @@ -64,6 +64,4 @@ private: } // namespace Internal -QMLJSTOOLS_EXPORT void setupProjectInfoQmlBundles(QmlJS::ModelManagerInterface::ProjectInfo &projectInfo); - } // namespace QmlJSTools |