Commit cc632c15 authored by Friedemann Kleint's avatar Friedemann Kleint

Header cleanup in ProjectExplorer.

Change-Id: I19f100003427ba43aaae5ba0dc7078088017cb09
Reviewed-on: http://codereview.qt.nokia.com/3178Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent e4349694
......@@ -38,6 +38,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/buildsteplist.h>
#include <utils/qtcassert.h>
......
......@@ -44,6 +44,8 @@
#include <utils/pathchooser.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/abi.h>
#include <texteditor/fontsettings.h>
#include <QtGui/QVBoxLayout>
......
......@@ -46,6 +46,8 @@
#include <utils/detailswidget.h>
#include <utils/qtcassert.h>
#include <utils/debuggerlanguagechooser.h>
#include <utils/qtcprocess.h>
#include <utils/stringutils.h>
#include <QtGui/QFormLayout>
#include <QtGui/QLineEdit>
......
......@@ -92,6 +92,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <projectexplorer/abi.h>
......
......@@ -33,6 +33,8 @@
#include "debuggertoolchaincombobox.h"
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/abi.h>
#include <utils/qtcassert.h>
#include <QtCore/QFileInfo>
......
......@@ -36,6 +36,7 @@
#include "genericprojectconstants.h"
#include "generictarget.h"
#include <projectexplorer/abi.h>
#include <projectexplorer/buildenvironmentwidget.h>
#include <projectexplorer/headerpath.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
......
......@@ -31,6 +31,7 @@
**************************************************************************/
#include "abiwidget.h"
#include "abi.h"
#include <QtGui/QComboBox>
#include <QtGui/QHBoxLayout>
......
......@@ -35,11 +35,10 @@
#include "projectexplorer_export.h"
#include "abi.h"
#include <QtGui/QWidget>
namespace ProjectExplorer {
class Abi;
namespace Internal {
class AbiWidgetPrivate;
......
......@@ -36,6 +36,7 @@
#include "ioutputparser.h"
#include "project.h"
#include "target.h"
#include "task.h"
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
......
......@@ -36,17 +36,17 @@
#include "buildstep.h"
#include "processparameters.h"
#include <utils/environment.h>
#include <utils/qtcprocess.h>
#include <QtCore/QString>
#include <QtCore/QProcess>
QT_BEGIN_NAMESPACE
class QEventLoop;
class QTimer;
QT_END_NAMESPACE
namespace Utils {
class QtcProcess;
}
namespace ProjectExplorer {
class IOutputParser;
......
......@@ -36,8 +36,6 @@
#include "runconfiguration.h"
#include "applicationlauncher.h"
#include "abi.h"
namespace Utils {
class AbstractMacroExpander;
class Environment;
......
......@@ -32,6 +32,7 @@
#include "buildconfiguration.h"
#include "toolchain.h"
#include "buildmanager.h"
#include "buildsteplist.h"
#include "projectexplorer.h"
......@@ -42,25 +43,47 @@
#include <coreplugin/variablemanager.h>
#include <utils/stringutils.h>
#include <QtCore/QProcess>
using namespace ProjectExplorer;
static const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildStepListCount";
static const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList.";
static const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "ProjectExplorer.BuildConfiguration.ClearSystemEnvironment";
static const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.BuildConfiguration.UserEnvironmentChanges";
static const char TOOLCHAIN_KEY[] = "ProjectExplorer.BuildCOnfiguration.ToolChain";
namespace {
namespace ProjectExplorer {
namespace Internal {
const char * const BUILD_STEP_LIST_COUNT("ProjectExplorer.BuildConfiguration.BuildStepListCount");
const char * const BUILD_STEP_LIST_PREFIX("ProjectExplorer.BuildConfiguration.BuildStepList.");
const char * const CLEAR_SYSTEM_ENVIRONMENT_KEY("ProjectExplorer.BuildConfiguration.ClearSystemEnvironment");
const char * const USER_ENVIRONMENT_CHANGES_KEY("ProjectExplorer.BuildConfiguration.UserEnvironmentChanges");
const char * const TOOLCHAIN_KEY("ProjectExplorer.BuildCOnfiguration.ToolChain");
class BuildConfigMacroExpander : public Utils::AbstractQtcMacroExpander {
public:
explicit BuildConfigMacroExpander(const BuildConfiguration *bc) : m_bc(bc) {}
virtual bool resolveMacro(const QString &name, QString *ret);
private:
const BuildConfiguration *m_bc;
};
} // namespace
bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret)
{
if (name == QLatin1String("sourceDir")) {
*ret = QDir::toNativeSeparators(m_bc->target()->project()->projectDirectory());
return true;
}
if (name == QLatin1String("buildDir")) {
*ret = QDir::toNativeSeparators(m_bc->buildDirectory());
return true;
}
*ret = Core::VariableManager::instance()->value(name);
return !ret->isEmpty();
}
} // namespace Internal
BuildConfiguration::BuildConfiguration(Target *target, const QString &id) :
ProjectConfiguration(target, id),
m_clearSystemEnvironment(false),
m_macroExpander(this),
m_toolChain(0)
m_toolChain(0),
m_macroExpander(0)
{
Q_ASSERT(target);
BuildStepList *bsl = new BuildStepList(this, QLatin1String(Constants::BUILDSTEPS_BUILD));
......@@ -84,8 +107,8 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc
ProjectConfiguration(target, source),
m_clearSystemEnvironment(source->m_clearSystemEnvironment),
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
m_macroExpander(this),
m_toolChain(source->m_toolChain)
m_toolChain(source->m_toolChain),
m_macroExpander(0)
{
Q_ASSERT(target);
// Do not clone stepLists here, do that in the derived constructor instead
......@@ -101,7 +124,16 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc
}
BuildConfiguration::~BuildConfiguration()
{ }
{
delete m_macroExpander;
}
Utils::AbstractMacroExpander *BuildConfiguration::macroExpander()
{
if (!m_macroExpander)
m_macroExpander = new Internal::BuildConfigMacroExpander(this);
return m_macroExpander;
}
QStringList BuildConfiguration::knownStepLists() const
{
......@@ -284,20 +316,6 @@ QString BuildConfiguration::disabledReason() const
return QString();
}
bool BuildConfigMacroExpander::resolveMacro(const QString &name, QString *ret)
{
if (name == QLatin1String("sourceDir")) {
*ret = QDir::toNativeSeparators(m_bc->target()->project()->projectDirectory());
return true;
}
if (name == QLatin1String("buildDir")) {
*ret = QDir::toNativeSeparators(m_bc->buildDirectory());
return true;
}
*ret = Core::VariableManager::instance()->value(name);
return !ret->isEmpty();
}
///
// IBuildConfigurationFactory
///
......@@ -308,3 +326,5 @@ IBuildConfigurationFactory::IBuildConfigurationFactory(QObject *parent) :
IBuildConfigurationFactory::~IBuildConfigurationFactory()
{ }
} // namespace ProjectExplorer
......@@ -36,12 +36,14 @@
#include "projectexplorer_export.h"
#include "projectconfiguration.h"
#include <utils/stringutils.h>
#include <utils/environment.h>
#include <QtCore/QString>
#include <QtCore/QStringList>
namespace Utils {
class AbstractMacroExpander;
}
namespace ProjectExplorer {
class BuildConfiguration;
......@@ -50,14 +52,6 @@ class Target;
class ToolChain;
class IOutputParser;
class BuildConfigMacroExpander : public Utils::AbstractQtcMacroExpander {
public:
BuildConfigMacroExpander(BuildConfiguration *bc) : m_bc(bc) {}
virtual bool resolveMacro(const QString &name, QString *ret);
private:
BuildConfiguration *m_bc;
};
class PROJECTEXPLORER_EXPORT BuildConfiguration : public ProjectConfiguration
{
Q_OBJECT
......@@ -94,7 +88,7 @@ public:
virtual bool isEnabled() const;
virtual QString disabledReason() const;
Utils::AbstractMacroExpander *macroExpander() { return &m_macroExpander; }
Utils::AbstractMacroExpander *macroExpander();
virtual ProjectExplorer::ToolChain *toolChain() const;
virtual void setToolChain(ProjectExplorer::ToolChain *tc);
......@@ -129,8 +123,8 @@ private:
bool m_clearSystemEnvironment;
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
QList<BuildStepList *> m_stepLists;
BuildConfigMacroExpander m_macroExpander;
ToolChain *m_toolChain;
Utils::AbstractMacroExpander *m_macroExpander;
};
class PROJECTEXPLORER_EXPORT IBuildConfigurationFactory :
......
......@@ -35,13 +35,12 @@
#include "projectconfiguration.h"
#include "projectexplorer_export.h"
#include "task.h"
#include <QtCore/QFutureInterface>
#include <QtGui/QWidget>
namespace ProjectExplorer {
class Task;
class BuildConfiguration;
class BuildStepList;
class DeployConfiguration;
......
......@@ -34,6 +34,7 @@
#define CLANGPARSER_H
#include "ioutputparser.h"
#include "task.h"
#include <QtCore/QRegExp>
......
......@@ -37,10 +37,12 @@
#include "debugginghelper.h"
#include "projectexplorerconstants.h"
#include "target.h"
#include "abi.h"
#include <coreplugin/icore.h>
#include <utils/qtcprocess.h>
#include <utils/stringutils.h>
#include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox>
......
......@@ -32,16 +32,14 @@
#include "gccparser.h"
#include "ldparser.h"
#include "taskwindow.h"
#include "task.h"
#include "projectexplorerconstants.h"
using namespace ProjectExplorer;
namespace {
// opt. drive letter + filename: (2 brackets)
const char * const FILE_PATTERN = "(<command[ -]line>|([A-Za-z]:)?[^:]+\\.[^:]+):";
const char * const COMMAND_PATTERN = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(gcc|g\\+\\+)(-[0-9\\.]+)?(\\.exe)?: ";
}
// opt. drive letter + filename: (2 brackets)
static const char FILE_PATTERN[] = "(<command[ -]line>|([A-Za-z]:)?[^:]+\\.[^:]+):";
static const char COMMAND_PATTERN[] = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(gcc|g\\+\\+)(-[0-9\\.]+)?(\\.exe)?: ";
GccParser::GccParser()
{
......
......@@ -33,7 +33,7 @@
#include "gnumakeparser.h"
#include "projectexplorerconstants.h"
#include "taskwindow.h"
#include "task.h"
#include <QtCore/QDir>
#include <QtCore/QFile>
......
......@@ -32,7 +32,7 @@
#include "ldparser.h"
#include "projectexplorerconstants.h"
#include "taskwindow.h"
#include "task.h"
using namespace ProjectExplorer;
......
......@@ -34,6 +34,7 @@
#define LINUXICCPARSER_H
#include "ioutputparser.h"
#include "task.h"
#include <QtCore/QRegExp>
......
......@@ -39,6 +39,7 @@
#include <utils/environment.h>
#include <QtGui/QLabel>
#include <QtGui/QIcon>
#include <QtCore/QDir>
namespace ProjectExplorer {
......
......@@ -35,7 +35,6 @@
#include "projectexplorer_export.h"
#include <QtCore/QString>
#include <QtCore/QStringList>
namespace ProjectExplorer {
......
......@@ -31,6 +31,7 @@
**************************************************************************/
#include "outputparser_test.h"
#include "task.h"
#if defined(WITH_TESTS)
......
......@@ -33,11 +33,10 @@
#ifndef PROJECTEXPLORER_H
#define PROJECTEXPLORER_H
#include <QtCore/QPair>
#include "projectexplorer_export.h"
#include <extensionsystem/iplugin.h>
#include <QtCore/QPair>
QT_BEGIN_NAMESPACE
......@@ -50,10 +49,6 @@ namespace Core {
class IMode;
}
namespace Utils {
class ParameterAction;
}
namespace ProjectExplorer {
class BuildManager;
class RunControl;
......@@ -66,7 +61,6 @@ class BuildConfiguration;
class ProjectNode;
namespace Internal {
class ProjectFileFactory;
struct ProjectExplorerSettings;
}
......
......@@ -33,24 +33,23 @@
#ifndef PROJECTNODES_H
#define PROJECTNODES_H
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtGui/QIcon>
#include "runconfiguration.h"
#include "projectexplorer_export.h"
#include <QtGui/QIcon>
#include <QtCore/QObject>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
class QFileInfo;
QT_END_NAMESPACE
namespace Core {
class MimeDatabase;
}
namespace ProjectExplorer {
class RunConfiguration;
enum NodeType {
FileNodeType = 1,
......
......@@ -35,11 +35,13 @@
#include "project.h"
#include "target.h"
#include "toolchain.h"
#include "abi.h"
#include "buildconfiguration.h"
#include "projectexplorerconstants.h"
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <utils/outputformatter.h>
#include <utils/checkablemessagebox.h>
#include <coreplugin/icore.h>
......
......@@ -33,19 +33,23 @@
#ifndef RUNCONFIGURATION_H
#define RUNCONFIGURATION_H
#include "abi.h"
#include "projectconfiguration.h"
#include "projectexplorer_export.h"
#include <utils/outputformatter.h>
#include <utils/outputformat.h>
#include <QtCore/QMetaType>
#include <QtCore/QWeakPointer>
#include <QtGui/QWidget>
#include <QtGui/QIcon>
namespace ProjectExplorer {
QT_FORWARD_DECLARE_CLASS(QIcon)
namespace Utils {
class OutputFormatter;
}
namespace ProjectExplorer {
class Abi;
class BuildConfiguration;
class IRunConfigurationAspect;
class RunControl;
......
......@@ -32,6 +32,7 @@
#include "target.h"
#include "toolchain.h"
#include "buildconfiguration.h"
#include "deployconfiguration.h"
#include "project.h"
......
......@@ -51,7 +51,6 @@ class ToolChainPrivate;
}
class Abi;
class HeaderPath;
class IOutputParser;
class ToolChainConfigWidget;
class ToolChainFactory;
......
......@@ -31,7 +31,7 @@
**************************************************************************/
#include "toolchainmanager.h"
#include "abi.h"
#include "toolchain.h"
#include <coreplugin/icore.h>
......
......@@ -35,9 +35,6 @@
#include "projectexplorer_export.h"
#include "abi.h"
#include "toolchain.h"
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QString>
......@@ -46,6 +43,7 @@ namespace ProjectExplorer {
class ProjectExplorerPlugin;
class ToolChain;
class ToolChainFactory;
class Abi;
namespace Internal {
class ToolChainManagerPrivate;
......
......@@ -31,7 +31,8 @@
**************************************************************************/
#include "toolchainoptionspage.h"
#include "toolchain.h"
#include "abi.h"
#include "projectexplorerconstants.h"
#include "toolchainconfigwidget.h"
#include "toolchainmanager.h"
......
......@@ -33,7 +33,7 @@
#include "qmakeparser.h"
#include "qt4projectmanagerconstants.h"
#include <projectexplorer/taskwindow.h>
#include <projectexplorer/task.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h>
......@@ -41,11 +41,9 @@ using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::Task;
QMakeParser::QMakeParser()
QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+):(\\d+):\\s(.+)$"))
{
setObjectName(QLatin1String("QMakeParser"));
m_error.setPattern("^(.+):(\\d+):\\s(.+)$");
m_error.setMinimal(true);
}
......
......@@ -54,6 +54,7 @@
#include <utils/qtcprocess.h>
#include <utils/pathchooser.h>
#include <utils/detailswidget.h>
#include <utils/stringutils.h>
#include <utils/debuggerlanguagechooser.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/baseqtversion.h>
......