src: removed sonargraph based project setup methods

This commit is contained in:
mlangkabel
2019-11-09 17:56:51 +01:00
parent 7257de9f11
commit ceb30020b5
585 changed files with 2 additions and 27109 deletions
-2
View File
@@ -154,8 +154,6 @@ add_files(
qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.h
qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.h
qt/project_wizard/content/path/QtProjectWizardContentPathSonargraphProject.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathSonargraphProject.h
qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.h
qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.cpp
@@ -22,7 +22,6 @@
#include "QtProjectWizardContentPathCodeblocksProject.h"
#include "QtProjectWizardContentPathCxxPch.h"
#include "QtProjectWizardContentPathPythonEnvironment.h"
#include "QtProjectWizardContentPathSonargraphProject.h"
#include "QtProjectWizardContentPathSourceGradle.h"
#include "QtProjectWizardContentPathSourceMaven.h"
#include "QtProjectWizardContentPaths.h"
@@ -46,11 +45,9 @@
#include "SourceGroupSettingsCxxCdb.h"
#include "SourceGroupSettingsCxxCdbVs.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#include "SourceGroupSettingsCxxSonargraph.h"
#include "SourceGroupSettingsJavaEmpty.h"
#include "SourceGroupSettingsJavaGradle.h"
#include "SourceGroupSettingsJavaMaven.h"
#include "SourceGroupSettingsJavaSonargraph.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "MessageLoadProject.h"
#include "MessageStatus.h"
@@ -279,45 +276,6 @@ namespace
return pages;
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph>> getSourceGroupWizardPages<SourceGroupSettingsCxxSonargraph>()
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Sonargraph Project Path");
page.addContentCreatorWithSettings<QtProjectWizardContentCppStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreator(
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings, QtProjectWizardWindow* window)
{
return new QtProjectWizardContentPathSonargraphProject(settings, settings, settings, window);
}
);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsIndexedHeaders>(WIZARD_CONTENT_CONTEXT_ALL, std::string("Sonargraph project"));
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
}
return pages;
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs>> getSourceGroupWizardPages<SourceGroupSettingsCxxCdbVs>()
{
@@ -352,7 +310,6 @@ namespace
return pages;
}
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty>> getSourceGroupWizardPages<SourceGroupSettingsJavaEmpty>()
{
@@ -418,31 +375,6 @@ namespace
return pages;
}
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph>> getSourceGroupWizardPages<SourceGroupSettingsJavaSonargraph>()
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph> page("Sonargraph Project Path");
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreator(
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings, QtProjectWizardWindow* window)
{
return new QtProjectWizardContentPathSonargraphProject(settings, std::shared_ptr<SourceGroupSettingsCxxSonargraph>(), settings, window);
}
);
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph> page("Dependencies");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsClassJava>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
}
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty>> getSourceGroupWizardPages<SourceGroupSettingsPythonEmpty>()
@@ -874,10 +806,6 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
{
fillSummary(summary, settings, this);
}
else if (std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxxSonargraph>(group))
{
fillSummary(summary, settings, this);
}
else if (std::shared_ptr<SourceGroupSettingsCxxCdbVs> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxxCdbVs>(group))
{
fillSummary(summary, settings, this);
@@ -894,10 +822,6 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
{
fillSummary(summary, settings, this);
}
else if (std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaSonargraph>(group))
{
fillSummary(summary, settings, this);
}
else if (std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsPythonEmpty>(group))
{
fillSummary(summary, settings, this);
@@ -1107,13 +1031,6 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
executeSourceGroupSetup<SourceGroupSettingsCxxCodeblocks>(settings);
}
break;
case SOURCE_GROUP_CXX_SONARGRAPH:
{
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings = std::make_shared<SourceGroupSettingsCxxSonargraph>(sourceGroupId, m_projectSettings.get());
addMsvcCompatibilityFlagsOnDemand(settings);
executeSourceGroupSetup<SourceGroupSettingsCxxSonargraph>(settings);
}
break;
case SOURCE_GROUP_CXX_VS:
{
std::shared_ptr<SourceGroupSettingsCxxCdbVs> settings = std::make_shared<SourceGroupSettingsCxxCdbVs>(sourceGroupId, m_projectSettings.get());
@@ -1138,12 +1055,6 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
executeSourceGroupSetup<SourceGroupSettingsJavaGradle>(settings);
}
break;
case SOURCE_GROUP_JAVA_SONARGRAPH:
{
std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings = std::make_shared<SourceGroupSettingsJavaSonargraph>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsJavaSonargraph>(settings);
}
break;
case SOURCE_GROUP_PYTHON_EMPTY:
{
std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::make_shared<SourceGroupSettingsPythonEmpty>(sourceGroupId, m_projectSettings.get());
@@ -51,16 +51,13 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CDB, true));
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_VS));
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CODEBLOCKS));
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_SONARGRAPH));
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_C_EMPTY));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CDB, true));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_VS));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CODEBLOCKS));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_SONARGRAPH));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CPP_EMPTY));
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_MAVEN));
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_GRADLE));
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_SONARGRAPH));
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_EMPTY));
sourceGroupInfos[LANGUAGE_PYTHON].push_back(SourceGroupInfo(SOURCE_GROUP_PYTHON_EMPTY));
sourceGroupInfos[LANGUAGE_CUSTOM].push_back(SourceGroupInfo(SOURCE_GROUP_CUSTOM_COMMAND));
@@ -70,12 +67,10 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
m_sourceGroupTypeIconName[SOURCE_GROUP_CPP_EMPTY] = L"empty_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_CDB] = L"cdb_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_VS] = L"vs_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_SONARGRAPH] = L"sonargraph_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_CODEBLOCKS] = L"cbp_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_EMPTY] = L"empty_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_MAVEN] = L"mvn_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_GRADLE] = L"gradle_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_SONARGRAPH] = L"sonargraph_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_PYTHON_EMPTY] = L"empty_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CUSTOM_COMMAND] = L"empty_icon";
@@ -91,17 +86,12 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
"<p>Create a new Source Group from an existing Visual Studio Solution file.</p>"
"<p><b>Note</b>: Requires a running Visual Studio instance with the "
"<a href=\"https://sourcetrail.com/documentation/index.html#VisualStudio\">Sourcetrail Visual Studio Extension</a> installed.</p>";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_SONARGRAPH] =
"<p>Create a new Source Group from an existing <a href=\"https://www.hello2morrow.com/products/sonargraph\">Sonargraph</a> "
"project file.</p><p>Currently manual C/C++ Sonargraph modules are supported as well as Sonargraph modules that are based on CMake JSON Command files.</p>";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CODEBLOCKS] =
"<p>Create a new Source Group from an existing Code::Blocks project file.</p>"
"<p><b>Note</b>: A \".cbp\" file will also get generated by the <b>Qt Creator</b> if a CMakeLists file is imported.</p>";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_EMPTY] = "Create a new Source Group by defining which Java files will be indexed.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_MAVEN] = "Create a new Source Group from an existing Maven project.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_GRADLE] = "Create a new Source Group from an existing Gradle project.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_SONARGRAPH] =
"Create a new Source Group from an existing <a href=\"https://www.hello2morrow.com/products/sonargraph\">Sonargraph</a> project file.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_PYTHON_EMPTY] =
"<p>Create a new Source Group by defining which Python files will be indexed. This Source Group type uses the "
"<a href=\"https://github.com/CoatiSoftware/SourcetrailPythonIndexer\">SourcetrailPythonIndexer</a> " + pythonIndexerVersion + "in the "
@@ -1,166 +0,0 @@
#include "QtProjectWizardContentPathSonargraphProject.h"
#include <QMessageBox>
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "SonargraphProject.h"
#include "SourceGroupCxxSonargraph.h"
#include "SourceGroupJavaSonargraph.h"
#include "SourceGroupSettingsCxxSonargraph.h"
#include "SourceGroupSettingsJavaSonargraph.h"
#include "SourceGroupSettingsWithSonargraphProjectPath.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathSonargraphProject::QtProjectWizardContentPathSonargraphProject(
std::shared_ptr<SourceGroupSettings> settings,
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settingsCxxSonargraph,
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> settingsWithSonargraphProjectPath,
QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
, m_settingsCxxSonargraph(settingsCxxSonargraph)
, m_settingsWithSonargraphProjectPath(settingsWithSonargraphProjectPath)
, m_filePaths([&]()
{
std::set<FilePath> allSourceFilePaths;
if (std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxxSonargraph>(m_settings))
{
allSourceFilePaths = SourceGroupCxxSonargraph(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaSonargraph>(m_settings))
{
allSourceFilePaths = SourceGroupJavaSonargraph(settings).getAllSourceFilePaths();
}
return utility::getAsRelativeIfShorter(
utility::toVector(allSourceFilePaths),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Sonargraph Project (system.sonargraph)");
setHelpString(
"Select the Sonargraph file for the project. Sourcetrail will index your project based on the settings "
"this file. It contains using all include paths and compiler flags required. The Sourcetrail project "
"will stay up to date with changes in the Sonargraph project on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".sonargraph" });
}
void QtProjectWizardContentPathSonargraphProject::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Sonargraph Project (system.sonargraph)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizardContentPathSonargraphProject::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all settings from the Sonargraph project and stay up-to-date with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizardContentPathSonargraphProject::load()
{
m_picker->setText(QString::fromStdWString(m_settingsWithSonargraphProjectPath->getSonargraphProjectPath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) + "</b> source files were found in the Sonargraph project.");
}
}
void QtProjectWizardContentPathSonargraphProject::save()
{
m_settingsWithSonargraphProjectPath->setSonargraphProjectPath(FilePath(m_picker->getText().toStdWString()));
}
bool QtProjectWizardContentPathSonargraphProject::check()
{
if (!QtProjectWizardContentPath::check())
{
return false;
}
if (std::shared_ptr<Sonargraph::Project> sonargraphProject = Sonargraph::Project::load(
m_settingsWithSonargraphProjectPath->getSonargraphProjectPathExpandedAndAbsolute(), m_settings->getLanguage()
))
{
if (sonargraphProject->getLoadedModuleCount() == 0)
{
QMessageBox msgBox;
msgBox.setText(QString::fromStdString(
"The Sonargraph project file doesn't seem to contain any supported " +
languageTypeToString(m_settings->getLanguage()) + " modules. Please " +
"consider choosing another project file or removing this sourcegroup."
));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
return msgBox.exec() == QMessageBox::Ok;
}
}
return true;
}
std::vector<FilePath> QtProjectWizardContentPathSonargraphProject::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizardContentPathSonargraphProject::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizardContentPathSonargraphProject::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizardContentPathSonargraphProject::pickedPath()
{
m_window->saveContent();
if (m_settingsCxxSonargraph)
{
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromSonargraphProject(m_settingsCxxSonargraph))
{
if (projectPath.contains(path))
{
indexedHeaderPaths.insert(path.getRelativeTo(projectPath)); // the relative path is always shorter than the absolute path
}
}
m_settingsCxxSonargraph->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
}
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathSonargraphProject::getSourceGroupSettings()
{
return m_settings;
}
@@ -1,46 +0,0 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_SONARGRAPH_PROJECT_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_SONARGRAPH_PROJECT_H
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
class SourceGroupSettingsCxxSonargraph;
class SourceGroupSettingsWithSonargraphProjectPath;
class QtProjectWizardContentPathSonargraphProject
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathSonargraphProject(
std::shared_ptr<SourceGroupSettings> settings,
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settingsCxxSonargraph,
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> settingsWithSonargraphProjectPath,
QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
bool check() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettings> m_settings;
std::shared_ptr<SourceGroupSettingsCxxSonargraph> m_settingsCxxSonargraph;
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> m_settingsWithSonargraphProjectPath;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_SONARGRAPH_PROJECT_H
@@ -10,50 +10,11 @@
#include "QtPathListDialog.h"
#include "QtSelectPathsDialog.h"
#include "QtTextEditDialog.h"
#include "SonargraphProject.h"
#include "SourceGroupSettingsCxxCdb.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#include "SourceGroupSettingsCxxSonargraph.h"
#include "utility.h"
#include "utilityFile.h"
std::vector<FilePath> QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromSonargraphProject(
std::shared_ptr<const SourceGroupSettingsCxxSonargraph> settings)
{
std::set<FilePath> indexedHeaderPaths;
{
const FilePath sonargraphProjectPath = settings->getSonargraphProjectPathExpandedAndAbsolute();
if (!sonargraphProjectPath.empty() && sonargraphProjectPath.exists())
{
if (std::shared_ptr<Sonargraph::Project> sonargraphProject = Sonargraph::Project::load(
sonargraphProjectPath, settings->getLanguage()
))
{
for (const FilePath& path : sonargraphProject->getAllSourceFilePathsCanonical())
{
indexedHeaderPaths.insert(path.getCanonical().getParentDirectory());
}
utility::append(indexedHeaderPaths, sonargraphProject->getAllCxxHeaderSearchPathsCanonical());
}
}
else
{
LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist.");
}
}
std::vector<FilePath> topLevelPaths;
for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths))
{
if (path.exists())
{
topLevelPaths.push_back(path);
}
}
return topLevelPaths;
}
std::vector<FilePath> QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromCodeblocksProject(
std::shared_ptr<const SourceGroupSettingsCxxCodeblocks> settings)
{
@@ -78,7 +39,7 @@ std::vector<FilePath> QtProjectWizardContentPathsIndexedHeaders::getIndexedPaths
}
else
{
LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist.");
LOG_WARNING("Unable to fetch indexed header paths. The provided Codeblocks project path does not exist.");
}
}
@@ -212,39 +173,7 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
if (!m_filesDialog)
{
if (std::shared_ptr<SourceGroupSettingsCxxSonargraph> sonargraphSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxSonargraph>(m_settings))
{
const FilePath sonargraphProjectPath = sonargraphSettings->getSonargraphProjectPathExpandedAndAbsolute();
if (!sonargraphProjectPath.exists())
{
QMessageBox msgBox;
msgBox.setText("The provided Sonargraph project path does not exist.");
msgBox.setDetailedText(QString::fromStdWString(sonargraphProjectPath.wstr()));
msgBox.exec();
return;
}
m_filesDialog = std::make_shared<QtSelectPathsDialog>(
"Select from Include Paths",
"The list contains all Include Paths found in the Sonargraph project. Red paths do not exist. Select the "
"paths containing the header files you want to index with Sourcetrail.");
m_filesDialog->setup();
connect(m_filesDialog.get(), &QtSelectPathsDialog::finished, this, &QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog);
connect(m_filesDialog.get(), &QtSelectPathsDialog::canceled, this, &QtProjectWizardContentPathsIndexedHeaders::closedFilesDialog);
const FilePath projectPath = sonargraphSettings->getProjectDirectoryPath();
dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->setPathsList(
utility::convert<FilePath, FilePath>(
getIndexedPathsDerivedFromSonargraphProject(sonargraphSettings),
[&](const FilePath& path) { return utility::getAsRelativeIfShorter(path, projectPath); }
),
sonargraphSettings->getIndexedHeaderPaths(),
m_settings->getProjectDirectoryPath()
);
}
else if (std::shared_ptr<SourceGroupSettingsCxxCodeblocks> codeblocksSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxCodeblocks>(m_settings))
if (std::shared_ptr<SourceGroupSettingsCxxCodeblocks> codeblocksSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxCodeblocks>(m_settings))
{
const FilePath codeblocksProjectPath = codeblocksSettings->getCodeblocksProjectPathExpandedAndAbsolute();
if (!codeblocksProjectPath.exists())
@@ -5,7 +5,6 @@
class SourceGroupSettingsCxxCdb;
class SourceGroupSettingsCxxCodeblocks;
class SourceGroupSettingsCxxSonargraph;
class QtProjectWizardContentPathsIndexedHeaders
: public QtProjectWizardContentPaths
@@ -13,7 +12,6 @@ class QtProjectWizardContentPathsIndexedHeaders
Q_OBJECT
public:
static std::vector<FilePath> getIndexedPathsDerivedFromSonargraphProject(std::shared_ptr<const SourceGroupSettingsCxxSonargraph> settings);
static std::vector<FilePath> getIndexedPathsDerivedFromCodeblocksProject(std::shared_ptr<const SourceGroupSettingsCxxCodeblocks> settings);
static std::vector<FilePath> getIndexedPathsDerivedFromCDB(std::shared_ptr<const SourceGroupSettingsCxxCdb> settings);