src: Refactored SourceGroupSettings into components as bases architecture
This commit is contained in:
@@ -93,7 +93,7 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
void addMsvcCompatibilityFlagsOnDemand(std::shared_ptr<SourceGroupSettingsCxx> settings)
|
||||
void addMsvcCompatibilityFlagsOnDemand(std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> settings)
|
||||
{
|
||||
if (applicationSettingsContainVisualStudioHeaderSearchPaths())
|
||||
{
|
||||
|
||||
@@ -4,9 +4,13 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "QtStringListBox.h"
|
||||
#include "SourceGroupSettingsCxx.h"
|
||||
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
|
||||
|
||||
QtProjectWizardContentFlags::QtProjectWizardContentFlags(std::shared_ptr<SourceGroupSettingsCxx> settings, QtProjectWizardWindow* window, bool indicateAsAdditional)
|
||||
QtProjectWizardContentFlags::QtProjectWizardContentFlags(
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> settings,
|
||||
QtProjectWizardWindow* window,
|
||||
bool indicateAsAdditional
|
||||
)
|
||||
: QtProjectWizardContent(window)
|
||||
, m_settings(settings)
|
||||
, m_indicateAsAdditional(indicateAsAdditional)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "QtProjectWizardContent.h"
|
||||
|
||||
class QtStringListBox;
|
||||
class SourceGroupSettingsCxx;
|
||||
class SourceGroupSettingsWithCxxPathsAndFlags;
|
||||
|
||||
class QtProjectWizardContentFlags
|
||||
: public QtProjectWizardContent
|
||||
@@ -12,7 +12,11 @@ class QtProjectWizardContentFlags
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtProjectWizardContentFlags(std::shared_ptr<SourceGroupSettingsCxx> settings, QtProjectWizardWindow* window, bool indicateAsAdditional = false);
|
||||
QtProjectWizardContentFlags(
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> settings,
|
||||
QtProjectWizardWindow* window,
|
||||
bool indicateAsAdditional = false
|
||||
);
|
||||
|
||||
// QtProjectWizardContent implementation
|
||||
virtual void populate(QGridLayout* layout, int& row) override;
|
||||
@@ -22,7 +26,7 @@ public:
|
||||
virtual bool check() override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<SourceGroupSettingsCxx> m_settings;
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> m_settings;
|
||||
const bool m_indicateAsAdditional;
|
||||
|
||||
QtStringListBox* m_list;
|
||||
|
||||
+6
-3
@@ -1,6 +1,7 @@
|
||||
#include "QtProjectWizardContentPathsFrameworkSearch.h"
|
||||
|
||||
#include "SourceGroupSettingsCxx.h"
|
||||
#include "SourceGroupSettings.h"
|
||||
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
|
||||
|
||||
QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFrameworkSearch(
|
||||
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, bool indicateAsAdditional
|
||||
@@ -18,7 +19,8 @@ QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFramework
|
||||
|
||||
void QtProjectWizardContentPathsFrameworkSearch::load()
|
||||
{
|
||||
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings);
|
||||
if (cxxSettings)
|
||||
{
|
||||
m_list->setPaths(cxxSettings->getFrameworkSearchPaths());
|
||||
@@ -27,7 +29,8 @@ void QtProjectWizardContentPathsFrameworkSearch::load()
|
||||
|
||||
void QtProjectWizardContentPathsFrameworkSearch::save()
|
||||
{
|
||||
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings);
|
||||
if (cxxSettings)
|
||||
{
|
||||
cxxSettings->setFrameworkSearchPaths(m_list->getPathsAsDisplayed());
|
||||
|
||||
+10
-7
@@ -11,7 +11,8 @@
|
||||
#include "QtPathListDialog.h"
|
||||
#include "QtTextEditDialog.h"
|
||||
#include "ScopedFunctor.h"
|
||||
#include "SourceGroupSettingsCxx.h"
|
||||
#include "SourceGroupSettings.h"
|
||||
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
|
||||
#include "SourceGroupSettingsWithExcludeFilters.h"
|
||||
#include "SourceGroupSettingsWithSourceExtensions.h"
|
||||
#include "SourceGroupSettingsWithSourcePaths.h"
|
||||
@@ -73,7 +74,8 @@ void QtProjectWizardContentPathsHeaderSearch::populate(QGridLayout* layout, int&
|
||||
|
||||
void QtProjectWizardContentPathsHeaderSearch::load()
|
||||
{
|
||||
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings);
|
||||
if (cxxSettings)
|
||||
{
|
||||
m_list->setPaths(cxxSettings->getHeaderSearchPaths());
|
||||
@@ -82,7 +84,8 @@ void QtProjectWizardContentPathsHeaderSearch::load()
|
||||
|
||||
void QtProjectWizardContentPathsHeaderSearch::save()
|
||||
{
|
||||
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
|
||||
std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings);
|
||||
if (cxxSettings)
|
||||
{
|
||||
cxxSettings->setHeaderSearchPaths(m_list->getPathsAsDisplayed());
|
||||
@@ -162,8 +165,8 @@ void QtProjectWizardContentPathsHeaderSearch::validateIncludesButtonClicked()
|
||||
indexedFilePaths = pathSettings->getSourcePathsExpandedAndAbsolute();
|
||||
|
||||
headerSearchPaths = ApplicationSettings::getInstance()->getHeaderSearchPathsExpanded();
|
||||
if (std::shared_ptr<SourceGroupSettingsCxx> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings))
|
||||
if (std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings))
|
||||
{
|
||||
utility::append(headerSearchPaths, cxxSettings->getHeaderSearchPathsExpandedAndAbsolute());
|
||||
}
|
||||
@@ -232,8 +235,8 @@ void QtProjectWizardContentPathsHeaderSearch::finishedSelectDetectIncludesRootPa
|
||||
sourceFilePaths = fileManager.getAllSourceFilePaths();
|
||||
|
||||
headerSearchPaths = ApplicationSettings::getInstance()->getHeaderSearchPathsExpanded();
|
||||
if (std::shared_ptr<SourceGroupSettingsCxx> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings))
|
||||
if (std::shared_ptr<SourceGroupSettingsWithCxxPathsAndFlags> cxxSettings =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings))
|
||||
{
|
||||
utility::append(headerSearchPaths, cxxSettings->getHeaderSearchPathsExpandedAndAbsolute());
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "SourceGroupCxxEmpty.h"
|
||||
#include "SourceGroupJavaEmpty.h"
|
||||
#include "SourceGroupPythonEmpty.h"
|
||||
#include "SourceGroupSettingsCxx.h"
|
||||
#include "SourceGroupSettingsCustomCommand.h"
|
||||
#include "SourceGroupSettingsJavaEmpty.h"
|
||||
#include "SourceGroupSettingsPythonEmpty.h"
|
||||
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
|
||||
#include "SourceGroupSettingsWithSourcePaths.h"
|
||||
#include "utility.h"
|
||||
#include "utilityFile.h"
|
||||
@@ -50,9 +50,9 @@ void QtProjectWizardContentPathsSource::save()
|
||||
std::vector<FilePath> QtProjectWizardContentPathsSource::getFilePaths() const
|
||||
{
|
||||
std::set<FilePath> allSourceFilePaths;
|
||||
if (std::shared_ptr<SourceGroupSettingsCxx> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings))
|
||||
if (std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings))
|
||||
{
|
||||
allSourceFilePaths = SourceGroupCxxEmpty(settings).getAllSourceFilePaths();
|
||||
allSourceFilePaths = SourceGroupCxxEmpty(m_settings).getAllSourceFilePaths();
|
||||
}
|
||||
else if (std::shared_ptr<SourceGroupSettingsJavaEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(m_settings))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user