From 987288bcec4507da04263ff54b3c352f0a8a27e7 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 23 Oct 2019 14:53:01 +0200 Subject: QmlJSTools: make setupProjectInfoQmlBundles private No one needs to call this function. Change-Id: I5647475ef2ec7dce5dcf7834245985bfb45632e6 Reviewed-by: Thomas Hartmann --- src/plugins/qmljstools/qmljsmodelmanager.cpp | 54 +++++++++++++--------------- src/plugins/qmljstools/qmljsmodelmanager.h | 2 -- 2 files changed, 25 insertions(+), 31 deletions(-) (limited to 'src/plugins/qmljstools') diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index ca4fc555941..ef2dc86d71e 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 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 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 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 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 ModelManager::initLanguageForSuffix() const { QHash res = ModelManagerInterface::languageForSuffix(); diff --git a/src/plugins/qmljstools/qmljsmodelmanager.h b/src/plugins/qmljstools/qmljsmodelmanager.h index 678882ec3ae..be953d2a278 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 -- cgit v1.2.3