diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 0b9665532d6..da65b0f42d8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -25,15 +25,13 @@ #include #include -#include #include using namespace ProjectExplorer; using namespace QtSupport; using namespace Utils; -namespace CMakeProjectManager { -namespace Internal { +namespace CMakeProjectManager::Internal { static Q_LOGGING_CATEGORY(cmInputLog, "qtc.cmake.import", QtWarningMsg); @@ -104,7 +102,7 @@ CMakeProjectImporter::CMakeProjectImporter(const FilePath &path, const PresetsDa } -QStringList CMakeProjectImporter::importCandidates() +FilePaths CMakeProjectImporter::importCandidates() { FilePaths candidates; @@ -131,7 +129,7 @@ QStringList CMakeProjectImporter::importCandidates() const FilePaths finalists = Utils::filteredUnique(candidates); qCInfo(cmInputLog) << "import candidates:" << finalists; - return finalists; + return Utils::transform(finalists, &FilePath::fromString); } static CMakeConfig configurationFromPresetProbe( @@ -685,8 +683,7 @@ void CMakeProjectImporter::persistTemporaryCMake(Kit *k, const QVariantList &vl) qCDebug(cmInputLog) << "Temporary CMake tool made persistent."; } -} // namespace Internal -} // namespace CMakeProjectManager +} // CMakeProjectManager::Internal #ifdef WITH_TESTS diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h index d4cedd6a727..52f3c1dc0df 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h @@ -21,7 +21,7 @@ class CMakeProjectImporter : public QtSupport::QtProjectImporter public: CMakeProjectImporter(const Utils::FilePath &path, const Internal::PresetsData &presetsData); - QStringList importCandidates() final; + Utils::FilePaths importCandidates() final; private: QList examineDirectory(const Utils::FilePath &importPath, diff --git a/src/plugins/mesonprojectmanager/project/mesonprojectimporter.cpp b/src/plugins/mesonprojectmanager/project/mesonprojectimporter.cpp index dc9f7f749d6..3fbf32abe25 100644 --- a/src/plugins/mesonprojectmanager/project/mesonprojectimporter.cpp +++ b/src/plugins/mesonprojectmanager/project/mesonprojectimporter.cpp @@ -16,7 +16,7 @@ MesonProjectImporter::MesonProjectImporter(const Utils::FilePath &path) : QtSupport::QtProjectImporter{path} {} -QStringList MesonProjectImporter::importCandidates() +Utils::FilePaths MesonProjectImporter::importCandidates() { //TODO, this can be done later return {}; diff --git a/src/plugins/mesonprojectmanager/project/mesonprojectimporter.h b/src/plugins/mesonprojectmanager/project/mesonprojectimporter.h index ad4f0858472..730837d6bd9 100644 --- a/src/plugins/mesonprojectmanager/project/mesonprojectimporter.h +++ b/src/plugins/mesonprojectmanager/project/mesonprojectimporter.h @@ -3,21 +3,18 @@ #pragma once -#include "exewrappers/mesonwrapper.h" - #include #include #include -namespace MesonProjectManager { -namespace Internal { +namespace MesonProjectManager::Internal { class MesonProjectImporter final : public QtSupport::QtProjectImporter { public: MesonProjectImporter(const Utils::FilePath &path); - QStringList importCandidates() final; + Utils::FilePaths importCandidates() final; private: // importPath is an existing directory at this point! @@ -32,5 +29,4 @@ private: void deleteDirectoryData(void *directoryData) const final; }; -} // namespace Internal -} // namespace MesonProjectManager +} // MesonProjectManager::Internal diff --git a/src/plugins/projectexplorer/projectimporter.h b/src/plugins/projectexplorer/projectimporter.h index 52c2e976223..de3e15647d1 100644 --- a/src/plugins/projectexplorer/projectimporter.h +++ b/src/plugins/projectexplorer/projectimporter.h @@ -34,7 +34,7 @@ public: const Utils::FilePath projectDirectory() const { return m_projectPath.parentDir(); } virtual const QList import(const Utils::FilePath &importPath, bool silent = false); - virtual QStringList importCandidates() = 0; + virtual Utils::FilePaths importCandidates() = 0; virtual Target *preferredTarget(const QList &possibleTargets); bool isUpdating() const { return m_isUpdating; } diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index 5fa5f6ee4ae..eeb57e6602c 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -334,9 +334,9 @@ void TargetSetupPage::setupImports() if (!m_importer || m_projectPath.isEmpty()) return; - const QStringList toImport = m_importer->importCandidates(); - for (const QString &path : toImport) - import(FilePath::fromString(path), true); + const FilePaths toImport = m_importer->importCandidates(); + for (const FilePath &path : toImport) + import(path, true); } void TargetSetupPage::handleKitAddition(Kit *k) diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp index b475bbac8df..4c88d52b821 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp @@ -24,8 +24,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { struct BuildGraphData { @@ -88,7 +87,7 @@ static QStringList candidatesForDirectory(const QString &dir) return candidates; } -QStringList QbsProjectImporter::importCandidates() +FilePaths QbsProjectImporter::importCandidates() { const QString projectDir = projectFilePath().toFileInfo().absolutePath(); QStringList candidates = candidatesForDirectory(projectDir); @@ -105,7 +104,7 @@ QStringList QbsProjectImporter::importCandidates() } } qCDebug(qbsPmLog) << "build directory candidates:" << candidates; - return candidates; + return Utils::transform(candidates, &FilePath::fromString); } QList QbsProjectImporter::examineDirectory(const FilePath &importPath, @@ -212,5 +211,4 @@ void QbsProjectImporter::deleteDirectoryData(void *directoryData) const delete static_cast(directoryData); } -} // namespace Internal -} // namespace QbsProjectManager +} // QbsProjectManager::Internal diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.h b/src/plugins/qbsprojectmanager/qbsprojectimporter.h index 9d197a41472..5f5895614d5 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.h +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.h @@ -5,8 +5,7 @@ #include -namespace QbsProjectManager { -namespace Internal { +namespace QbsProjectManager::Internal { class QbsProjectImporter final : public QtSupport::QtProjectImporter { @@ -16,7 +15,7 @@ public: QbsProjectImporter(const Utils::FilePath &path); private: - QStringList importCandidates() override; + Utils::FilePaths importCandidates() override; QList examineDirectory(const Utils::FilePath &importPath, QString *warningMessage) const override; bool matchKit(void *directoryData, const ProjectExplorer::Kit *k) const override; ProjectExplorer::Kit *createKit(void *directoryData) const override; @@ -24,5 +23,4 @@ private: void deleteDirectoryData(void *directoryData) const override; }; -} // namespace Internal -} // namespace QbsProjectManager +} // QbsProjectManager::Internal diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 1b26bbb7627..6b0308fc7b3 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -54,8 +54,7 @@ struct DirectoryData } // namespace -namespace QmakeProjectManager { -namespace Internal { +namespace QmakeProjectManager::Internal { const Utils::Id QT_IS_TEMPORARY("Qmake.TempQt"); const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // ugly @@ -64,7 +63,7 @@ QmakeProjectImporter::QmakeProjectImporter(const FilePath &path) : QtProjectImporter(path) { } -QStringList QmakeProjectImporter::importCandidates() +FilePaths QmakeProjectImporter::importCandidates() { QStringList candidates; @@ -84,7 +83,7 @@ QStringList QmakeProjectImporter::importCandidates() candidates << path; } } - return candidates; + return Utils::transform(candidates, &FilePath::fromString); } QList QmakeProjectImporter::examineDirectory(const FilePath &importPath, @@ -255,5 +254,4 @@ Kit *QmakeProjectImporter::createTemporaryKit(const QtProjectImporter::QtVersion }); } -} // namespace Internal -} // namespace QmakeProjectManager +} // QmakeProjectManager::Internal diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h index 4557a60aba3..12a9f69953b 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h @@ -7,8 +7,7 @@ #include -namespace QmakeProjectManager { -namespace Internal { +namespace QmakeProjectManager::Internal { // Documentation inside. class QmakeProjectImporter : public QtSupport::QtProjectImporter @@ -16,7 +15,7 @@ class QmakeProjectImporter : public QtSupport::QtProjectImporter public: QmakeProjectImporter(const Utils::FilePath &path); - QStringList importCandidates() final; + Utils::FilePaths importCandidates() final; private: QList examineDirectory(const Utils::FilePath &importPath, QString *warningMessage) const final; @@ -31,5 +30,4 @@ private: const QMakeStepConfig::OsType &osType) const; }; -} // namespace Internal -} // namespace QmakeProjectManager +} // QmakeProjectManager::Internal diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp index 07042b33e83..6cf04265f73 100644 --- a/src/plugins/qtsupport/qtprojectimporter.cpp +++ b/src/plugins/qtsupport/qtprojectimporter.cpp @@ -16,7 +16,6 @@ #include #include -#include #include using namespace ProjectExplorer; @@ -153,7 +152,7 @@ public: m_testData(testData) { } - QStringList importCandidates() override; + FilePaths importCandidates() override { return {}; } bool allDeleted() const { return m_deletedTestData.count() == m_testData.count();} @@ -173,11 +172,6 @@ private: QList m_deletedKits; }; -QStringList TestQtProjectImporter::importCandidates() -{ - return QStringList(); -} - QList TestQtProjectImporter::examineDirectory(const Utils::FilePath &importPath, QString *warningMessage) const {