diff options
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/plugins/cpptools/cppkitinfo.cpp | 64 | ||||
-rw-r--r-- | src/plugins/cpptools/cppkitinfo.h | 56 | ||||
-rw-r--r-- | src/plugins/cpptools/cppprojectinfogenerator.cpp | 7 | ||||
-rw-r--r-- | src/plugins/cpptools/cppprojectinfogenerator.h | 4 | ||||
-rw-r--r-- | src/plugins/cpptools/cppprojectupdater.cpp | 2 | ||||
-rw-r--r-- | src/plugins/cpptools/cppprojectupdater.h | 5 | ||||
-rw-r--r-- | src/plugins/cpptools/cpptools.pro | 4 | ||||
-rw-r--r-- | src/plugins/cpptools/cpptools.qbs | 2 | ||||
-rw-r--r-- | src/plugins/cpptools/projectinfo.cpp | 38 | ||||
-rw-r--r-- | src/plugins/cpptools/projectinfo.h | 44 |
11 files changed, 12 insertions, 215 deletions
diff --git a/src/plugins/cpptools/CMakeLists.txt b/src/plugins/cpptools/CMakeLists.txt index 0908442f8b..ea1ff7a7d9 100644 --- a/src/plugins/cpptools/CMakeLists.txt +++ b/src/plugins/cpptools/CMakeLists.txt @@ -48,7 +48,6 @@ add_qtc_plugin(CppTools cpphoverhandler.cpp cpphoverhandler.h cppincludesfilter.cpp cppincludesfilter.h cppindexingsupport.cpp cppindexingsupport.h - cppkitinfo.cpp cppkitinfo.h cpplocalsymbols.cpp cpplocalsymbols.h cpplocatordata.cpp cpplocatordata.h cpplocatorfilter.cpp cpplocatorfilter.h diff --git a/src/plugins/cpptools/cppkitinfo.cpp b/src/plugins/cpptools/cppkitinfo.cpp deleted file mode 100644 index e57a4dbd73..0000000000 --- a/src/plugins/cpptools/cppkitinfo.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "cppkitinfo.h" - -#include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/kitmanager.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> - -#include <qtsupport/qtkitinformation.h> - -namespace CppTools { - -using namespace ProjectExplorer; - -KitInfo::KitInfo(Project *project) -{ - // Kit - if (Target *target = project->activeTarget()) - kit = target->kit(); - else - kit = KitManager::defaultKit(); - - // Toolchains - if (kit) { - cToolChain = ToolChainKitAspect::toolChain(kit, Constants::C_LANGUAGE_ID); - cxxToolChain = ToolChainKitAspect::toolChain(kit, Constants::CXX_LANGUAGE_ID); - } - - // Sysroot - sysRootPath = ProjectExplorer::SysRootKitAspect::sysRoot(kit).toString(); -} - -bool KitInfo::isValid() const -{ - return kit; -} - -} // namespace CppTools diff --git a/src/plugins/cpptools/cppkitinfo.h b/src/plugins/cpptools/cppkitinfo.h deleted file mode 100644 index a3033c62af..0000000000 --- a/src/plugins/cpptools/cppkitinfo.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include <projectexplorer/rawprojectpart.h> - -#include "cpptools_global.h" - -namespace ProjectExplorer { -class Kit; -class Project; -class ToolChain; -} // namespace ProjectExplorer - -namespace CppTools { - -class CPPTOOLS_EXPORT KitInfo -{ -public: - explicit KitInfo(ProjectExplorer::Project *project); - - bool isValid() const; - - ProjectExplorer::Kit *kit = nullptr; - ProjectExplorer::ToolChain *cToolChain = nullptr; - ProjectExplorer::ToolChain *cxxToolChain = nullptr; - - Utils::QtVersion projectPartQtVersion = Utils::QtVersion::None; - - QString sysRootPath; -}; - -} // namespace CppTools diff --git a/src/plugins/cpptools/cppprojectinfogenerator.cpp b/src/plugins/cpptools/cppprojectinfogenerator.cpp index 28b953389e..c013e62566 100644 --- a/src/plugins/cpptools/cppprojectinfogenerator.cpp +++ b/src/plugins/cpptools/cppprojectinfogenerator.cpp @@ -35,8 +35,9 @@ namespace CppTools { namespace Internal { -ProjectInfoGenerator::ProjectInfoGenerator(const QFutureInterface<void> &futureInterface, - const ProjectUpdateInfo &projectUpdateInfo) +ProjectInfoGenerator::ProjectInfoGenerator( + const QFutureInterface<void> &futureInterface, + const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo) : m_futureInterface(futureInterface) , m_projectUpdateInfo(projectUpdateInfo) { @@ -147,7 +148,7 @@ ProjectPart::Ptr ProjectInfoGenerator::createProjectPart( Utils::LanguageExtensions languageExtensions) { ProjectExplorer::RawProjectPartFlags flags; - ToolChainInfo tcInfo; + ProjectExplorer::ToolChainInfo tcInfo; if (language == Language::C) { flags = rawProjectPart.flagsForC; tcInfo = m_projectUpdateInfo.cToolChainInfo; diff --git a/src/plugins/cpptools/cppprojectinfogenerator.h b/src/plugins/cpptools/cppprojectinfogenerator.h index 1a0535ac2d..2dbc4cd2fa 100644 --- a/src/plugins/cpptools/cppprojectinfogenerator.h +++ b/src/plugins/cpptools/cppprojectinfogenerator.h @@ -37,7 +37,7 @@ class ProjectInfoGenerator { public: ProjectInfoGenerator(const QFutureInterface<void> &futureInterface, - const ProjectUpdateInfo &projectUpdateInfo); + const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo); ProjectInfo generate(); @@ -53,7 +53,7 @@ private: private: const QFutureInterface<void> m_futureInterface; - const ProjectUpdateInfo &m_projectUpdateInfo; + const ProjectExplorer::ProjectUpdateInfo &m_projectUpdateInfo; }; } // namespace Internal } // namespace CppTools diff --git a/src/plugins/cpptools/cppprojectupdater.cpp b/src/plugins/cpptools/cppprojectupdater.cpp index 23842f15f3..342db21265 100644 --- a/src/plugins/cpptools/cppprojectupdater.cpp +++ b/src/plugins/cpptools/cppprojectupdater.cpp @@ -46,7 +46,7 @@ CppProjectUpdater::~CppProjectUpdater() cancelAndWaitForFinished(); } -void CppProjectUpdater::update(const ProjectUpdateInfo &projectUpdateInfo) +void CppProjectUpdater::update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo) { // Stop previous update. cancelAndWaitForFinished(); diff --git a/src/plugins/cpptools/cppprojectupdater.h b/src/plugins/cpptools/cppprojectupdater.h index 65eb1522a1..460cf707fb 100644 --- a/src/plugins/cpptools/cppprojectupdater.h +++ b/src/plugins/cpptools/cppprojectupdater.h @@ -34,7 +34,6 @@ namespace CppTools { class ProjectInfo; -class ProjectUpdateInfo; class CPPTOOLS_EXPORT CppProjectUpdater : public QObject { @@ -44,7 +43,7 @@ public: CppProjectUpdater(); ~CppProjectUpdater() override; - void update(const ProjectUpdateInfo &projectUpdateInfo); + void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo); void cancel(); private: @@ -54,7 +53,7 @@ private: void onProjectInfoGenerated(); private: - ProjectUpdateInfo m_projectUpdateInfo; + ProjectExplorer::ProjectUpdateInfo m_projectUpdateInfo; QFutureInterface<void> m_futureInterface; QFutureWatcher<ProjectInfo> m_generateFutureWatcher; diff --git a/src/plugins/cpptools/cpptools.pro b/src/plugins/cpptools/cpptools.pro index b8b625845a..7ca9a8bc6f 100644 --- a/src/plugins/cpptools/cpptools.pro +++ b/src/plugins/cpptools/cpptools.pro @@ -103,7 +103,6 @@ HEADERS += \ cppmodelmanagerinterface.h \ cppbuiltinmodelmanagersupport.h \ headerpathfilter.h \ - cppkitinfo.h \ cpptools_clazychecks.h SOURCES += \ @@ -190,8 +189,7 @@ SOURCES += \ cppprojectpartchooser.cpp \ wrappablelineedit.cpp \ cppbuiltinmodelmanagersupport.cpp \ - headerpathfilter.cpp \ - cppkitinfo.cpp + headerpathfilter.cpp FORMS += \ clangdiagnosticconfigswidget.ui \ diff --git a/src/plugins/cpptools/cpptools.qbs b/src/plugins/cpptools/cpptools.qbs index 26ed1c1181..ddbc9d8375 100644 --- a/src/plugins/cpptools/cpptools.qbs +++ b/src/plugins/cpptools/cpptools.qbs @@ -116,8 +116,6 @@ Project { "cppincludesfilter.h", "cppindexingsupport.cpp", "cppindexingsupport.h", - "cppkitinfo.cpp", - "cppkitinfo.h", "cpplocalsymbols.cpp", "cpplocalsymbols.h", "cpplocatordata.cpp", diff --git a/src/plugins/cpptools/projectinfo.cpp b/src/plugins/cpptools/projectinfo.cpp index 9c6428f258..a7047dc972 100644 --- a/src/plugins/cpptools/projectinfo.cpp +++ b/src/plugins/cpptools/projectinfo.cpp @@ -25,48 +25,14 @@ #include "projectinfo.h" -#include "cppkitinfo.h" - #include <projectexplorer/abi.h> -#include <projectexplorer/toolchain.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/rawprojectpart.h> +#include <projectexplorer/toolchain.h> namespace CppTools { -ToolChainInfo::ToolChainInfo(const ProjectExplorer::ToolChain *toolChain, - const QString &sysRootPath, const Utils::Environment &env) -{ - if (toolChain) { - // Keep the following cheap/non-blocking for the ui thread... - type = toolChain->typeId(); - isMsvc2015ToolChain - = toolChain->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMsvc2015Flavor; - wordWidth = toolChain->targetAbi().wordWidth(); - targetTriple = toolChain->originalTargetTriple(); - extraCodeModelFlags = toolChain->extraCodeModelFlags(); - - // ...and save the potentially expensive operations for later so that - // they can be run from a worker thread. - this->sysRootPath = sysRootPath; - headerPathsRunner = toolChain->createBuiltInHeaderPathsRunner(env); - macroInspectionRunner = toolChain->createMacroInspectionRunner(); - } -} - -ProjectUpdateInfo::ProjectUpdateInfo(ProjectExplorer::Project *project, - const KitInfo &kitInfo, - const Utils::Environment &env, - const ProjectExplorer::RawProjectParts &rawProjectParts) - : project(project) - , rawProjectParts(rawProjectParts) - , cToolChain(kitInfo.cToolChain) - , cxxToolChain(kitInfo.cxxToolChain) - , cToolChainInfo(ToolChainInfo(cToolChain, kitInfo.sysRootPath, env)) - , cxxToolChainInfo(ToolChainInfo(cxxToolChain, kitInfo.sysRootPath, env)) -{ -} - ProjectInfo::ProjectInfo(QPointer<ProjectExplorer::Project> project) : m_project(project) { diff --git a/src/plugins/cpptools/projectinfo.h b/src/plugins/cpptools/projectinfo.h index e8f585e384..347e72f477 100644 --- a/src/plugins/cpptools/projectinfo.h +++ b/src/plugins/cpptools/projectinfo.h @@ -40,50 +40,6 @@ namespace CppTools { -class KitInfo; - -class ToolChainInfo -{ -public: - ToolChainInfo() = default; - ToolChainInfo(const ProjectExplorer::ToolChain *toolChain, - const QString &sysRootPath, const Utils::Environment &env); - - bool isValid() const { return type.isValid(); } - -public: - Core::Id type; - bool isMsvc2015ToolChain = false; - unsigned wordWidth = 0; - QString targetTriple; - QStringList extraCodeModelFlags; - - QString sysRootPath; // For headerPathsRunner. - ProjectExplorer::ToolChain::BuiltInHeaderPathsRunner headerPathsRunner; - ProjectExplorer::ToolChain::MacroInspectionRunner macroInspectionRunner; -}; - -class CPPTOOLS_EXPORT ProjectUpdateInfo -{ -public: - ProjectUpdateInfo() = default; - ProjectUpdateInfo(ProjectExplorer::Project *project, - const KitInfo &kitInfo, - const Utils::Environment &env, - const ProjectExplorer::RawProjectParts &rawProjectParts); - bool isValid() const { return project && !rawProjectParts.isEmpty(); } - -public: - QPointer<ProjectExplorer::Project> project; - ProjectExplorer::RawProjectParts rawProjectParts; - - const ProjectExplorer::ToolChain *cToolChain = nullptr; - const ProjectExplorer::ToolChain *cxxToolChain = nullptr; - - ToolChainInfo cToolChainInfo; - ToolChainInfo cxxToolChainInfo; -}; - class CPPTOOLS_EXPORT ProjectInfo { public: |