ProjectExplorer: Move settings structures out of Internal namespace

There is a public exported API that returns these structures,
and different plugins use it, so there is not point in keeping
them inside Internal namespace.

Remove some unused includes.

Change-Id: Ia9d3fc83738c38ae37f04ae0f518ec5d972c9d85
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2023-01-13 14:02:32 +01:00
parent 7f85a2f331
commit 9438575beb
11 changed files with 30 additions and 34 deletions

View File

@@ -351,10 +351,10 @@ void TestRunner::prepareToRunTests(TestRunMode mode)
QTC_ASSERT(!m_executingTests, return);
m_skipTargetsCheck = false;
m_runMode = mode;
ProjectExplorer::Internal::ProjectExplorerSettings projectExplorerSettings =
ProjectExplorerPlugin::projectExplorerSettings();
const ProjectExplorerSettings projectExplorerSettings
= ProjectExplorerPlugin::projectExplorerSettings();
if (mode != TestRunMode::RunAfterBuild
&& projectExplorerSettings.buildBeforeDeploy != ProjectExplorer::Internal::BuildBeforeRunMode::Off
&& projectExplorerSettings.buildBeforeDeploy != BuildBeforeRunMode::Off
&& !projectExplorerSettings.saveBeforeBuild) {
if (!ProjectExplorerPlugin::saveModifiedFiles())
return;
@@ -387,7 +387,7 @@ void TestRunner::prepareToRunTests(TestRunMode mode)
m_targetConnect = connect(project, &Project::activeTargetChanged,
this, [this] { cancelCurrent(KitChanged); });
if (projectExplorerSettings.buildBeforeDeploy == ProjectExplorer::Internal::BuildBeforeRunMode::Off
if (projectExplorerSettings.buildBeforeDeploy == BuildBeforeRunMode::Off
|| mode == TestRunMode::DebugWithoutDeploy
|| mode == TestRunMode::RunWithoutDeploy || mode == TestRunMode::RunAfterBuild) {
runOrDebugTests();

View File

@@ -16,25 +16,16 @@
#include "debuggerruncontrol.h"
#include "debuggerkitinformation.h"
#include "debuggertr.h"
#include "memoryagent.h"
#include "breakhandler.h"
#include "disassemblerlines.h"
#include "enginemanager.h"
#include "logwindow.h"
#include "moduleshandler.h"
#include "stackhandler.h"
#include "stackwindow.h"
#include "watchhandler.h"
#include "watchwindow.h"
#include "watchutils.h"
#include "stackframe.h"
#include "unstartedappwatcherdialog.h"
#include "localsandexpressionswindow.h"
#include "loadcoredialog.h"
#include "sourceutils.h"
#include "shared/hostutils.h"
#include "console/console.h"
#include "threadshandler.h"
#include "commonoptionspage.h"
#include "analyzer/analyzerconstants.h"
@@ -74,6 +65,7 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorersettings.h>
#include <projectexplorer/projecttree.h>
#include <projectexplorer/runconfiguration.h>

View File

@@ -13,6 +13,7 @@
#include "kitinformation.h"
#include "project.h"
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
#include "projectexplorersettings.h"
#include "runcontrol.h"
#include "session.h"
@@ -442,12 +443,12 @@ int BuildManager::getErrorTaskCount()
return errors;
}
void BuildManager::setCompileOutputSettings(const Internal::CompileOutputSettings &settings)
void BuildManager::setCompileOutputSettings(const CompileOutputSettings &settings)
{
d->m_outputWindow->setSettings(settings);
}
const Internal::CompileOutputSettings &BuildManager::compileOutputSettings()
const CompileOutputSettings &BuildManager::compileOutputSettings()
{
return d->m_outputWindow->settings();
}

View File

@@ -6,6 +6,7 @@
#include "buildmanager.h"
#include "ioutputparser.h"
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
#include "projectexplorericons.h"
#include "projectexplorersettings.h"
#include "showoutputtaskhandler.h"

View File

@@ -1727,7 +1727,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
if (tmp < 0 || tmp > int(StopBeforeBuild::SameApp))
tmp = int(defaultSettings.stopBeforeBuild);
dd->m_projectExplorerSettings.stopBeforeBuild = StopBeforeBuild(tmp);
dd->m_projectExplorerSettings.terminalMode = static_cast<Internal::TerminalMode>(
dd->m_projectExplorerSettings.terminalMode = static_cast<ProjectExplorer::TerminalMode>(
s->value(Constants::TERMINAL_MODE_SETTINGS_KEY, int(defaultSettings.terminalMode)).toInt());
dd->m_projectExplorerSettings.closeSourceFilesWithProject
= s->value(Constants::CLOSE_FILES_WITH_PROJECT_SETTINGS_KEY,

View File

@@ -29,16 +29,16 @@ class ProcessHandle;
namespace ProjectExplorer {
class BuildPropertiesSettings;
class CustomParserSettings;
class FolderNode;
class Node;
class Project;
class ProjectExplorerSettings;
class RunControl;
class RunConfiguration;
class Project;
class Node;
class FolderNode;
namespace Internal {
class AppOutputSettings;
class MiniProjectTargetSelector;
class ProjectExplorerSettings;
}
using RecentProjectsEntry = QPair<Utils::FilePath, QString>;
@@ -113,8 +113,8 @@ public:
ShutdownFlag aboutToShutdown() override;
QVector<QObject *> createTestObjects() const override;
static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes);
static const Internal::ProjectExplorerSettings &projectExplorerSettings();
static void setProjectExplorerSettings(const ProjectExplorerSettings &pes);
static const ProjectExplorerSettings &projectExplorerSettings();
static void setAppOutputSettings(const Internal::AppOutputSettings &settings);
static const Internal::AppOutputSettings &appOutputSettings();

View File

@@ -3,18 +3,14 @@
#pragma once
#include "projectexplorerconstants.h"
#include <coreplugin/coreconstants.h>
#include <utils/hostosinfo.h>
#include <QUuid>
namespace ProjectExplorer {
namespace Internal {
enum class TerminalMode { On, Off, Smart };
enum class AppOutputPaneMode { FlashOnOutput, PopupOnOutput, PopupOnFirstOutput };
enum class BuildBeforeRunMode { Off, WholeProject, AppOnly };
enum class StopBeforeBuild { None, SameProject, All, SameBuildDir, SameApp };
@@ -63,6 +59,10 @@ public:
QUuid environmentId;
};
namespace Internal {
enum class AppOutputPaneMode { FlashOnOutput, PopupOnOutput, PopupOnFirstOutput };
class AppOutputSettings
{
public:
@@ -82,5 +82,5 @@ public:
int maxCharCount = Core::Constants::DEFAULT_MAX_CHAR_COUNT;
};
} // namespace ProjectExplorer
} // namespace Internal
} // namespace ProjectExplorer

View File

@@ -2,6 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "projectexplorersettingspage.h"
#include "projectexplorerconstants.h"
#include "projectexplorersettings.h"
#include "projectexplorer.h"
@@ -28,7 +30,7 @@ enum { UseCurrentDirectory, UseProjectDirectory };
class ProjectExplorerSettingsWidget : public QWidget
{
Q_DECLARE_TR_FUNCTIONS(ProjextExplorer::Internal::ProjectExplorerSettings)
Q_DECLARE_TR_FUNCTIONS(ProjextExplorer::ProjectExplorerSettings)
public:
explicit ProjectExplorerSettingsWidget(QWidget *parent = nullptr);
@@ -177,7 +179,7 @@ ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const
m_settings.automaticallyCreateRunConfigurations = m_automaticallyCreateRunConfiguration->isChecked();
m_settings.stopBeforeBuild = static_cast<StopBeforeBuild>(
m_stopBeforeBuildComboBox->currentData().toInt());
m_settings.terminalMode = static_cast<TerminalMode>(m_terminalModeComboBox->currentIndex());
m_settings.terminalMode = static_cast<ProjectExplorer::TerminalMode>(m_terminalModeComboBox->currentIndex());
m_settings.closeSourceFilesWithProject = m_closeSourceFilesCheckBox->isChecked();
m_settings.clearIssuesOnRebuild = m_clearIssuesCheckBox->isChecked();
m_settings.abortBuildAllOnError = m_abortBuildAllOnErrorCheckBox->isChecked();

View File

@@ -10,7 +10,6 @@
namespace ProjectExplorer {
namespace Internal {
class ProjectExplorerSettings;
class ProjectExplorerSettingsWidget;
class ProjectExplorerSettingsPage : public Core::IOptionsPage

View File

@@ -105,8 +105,8 @@ void TerminalAspect::calculateUseTerminal()
return;
bool useTerminal;
switch (ProjectExplorerPlugin::projectExplorerSettings().terminalMode) {
case Internal::TerminalMode::On: useTerminal = true; break;
case Internal::TerminalMode::Off: useTerminal = false; break;
case TerminalMode::On: useTerminal = true; break;
case TerminalMode::Off: useTerminal = false; break;
default: useTerminal = m_useTerminalHint;
}
if (m_useTerminal != useTerminal) {

View File

@@ -5,13 +5,14 @@
#include "buildconfiguration.h"
#include "customparser.h"
#include "devicesupport/desktopdevice.h"
#include "devicesupport/devicemanager.h"
#include "devicesupport/idevice.h"
#include "devicesupport/idevicefactory.h"
#include "devicesupport/sshsettings.h"
#include "kitinformation.h"
#include "project.h"
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
#include "projectexplorersettings.h"
#include "runconfigurationaspects.h"
#include "runcontrol.h"