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 @@ ...@@ -38,6 +38,7 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/abi.h>
#include <texteditor/fontsettings.h> #include <texteditor/fontsettings.h>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#include <utils/detailswidget.h> #include <utils/detailswidget.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/debuggerlanguagechooser.h> #include <utils/debuggerlanguagechooser.h>
#include <utils/qtcprocess.h>
#include <utils/stringutils.h>
#include <QtGui/QFormLayout> #include <QtGui/QFormLayout>
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/abi.h> #include <projectexplorer/abi.h>
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "debuggertoolchaincombobox.h" #include "debuggertoolchaincombobox.h"
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/abi.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "genericprojectconstants.h" #include "genericprojectconstants.h"
#include "generictarget.h" #include "generictarget.h"
#include <projectexplorer/abi.h>
#include <projectexplorer/buildenvironmentwidget.h> #include <projectexplorer/buildenvironmentwidget.h>
#include <projectexplorer/headerpath.h> #include <projectexplorer/headerpath.h>
#include <projectexplorer/customexecutablerunconfiguration.h> #include <projectexplorer/customexecutablerunconfiguration.h>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
**************************************************************************/ **************************************************************************/
#include "abiwidget.h" #include "abiwidget.h"
#include "abi.h"
#include <QtGui/QComboBox> #include <QtGui/QComboBox>
#include <QtGui/QHBoxLayout> #include <QtGui/QHBoxLayout>
......
...@@ -35,11 +35,10 @@ ...@@ -35,11 +35,10 @@
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include "abi.h"
#include <QtGui/QWidget> #include <QtGui/QWidget>
namespace ProjectExplorer { namespace ProjectExplorer {
class Abi;
namespace Internal { namespace Internal {
class AbiWidgetPrivate; class AbiWidgetPrivate;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "ioutputparser.h" #include "ioutputparser.h"
#include "project.h" #include "project.h"
#include "target.h" #include "target.h"
#include "task.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
......
...@@ -36,17 +36,17 @@ ...@@ -36,17 +36,17 @@
#include "buildstep.h" #include "buildstep.h"
#include "processparameters.h" #include "processparameters.h"
#include <utils/environment.h>
#include <utils/qtcprocess.h>
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QProcess>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QEventLoop; class QEventLoop;
class QTimer; class QTimer;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Utils {
class QtcProcess;
}
namespace ProjectExplorer { namespace ProjectExplorer {
class IOutputParser; class IOutputParser;
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
#include "runconfiguration.h" #include "runconfiguration.h"
#include "applicationlauncher.h" #include "applicationlauncher.h"
#include "abi.h"
namespace Utils { namespace Utils {
class AbstractMacroExpander; class AbstractMacroExpander;
class Environment; class Environment;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "buildconfiguration.h" #include "buildconfiguration.h"
#include "toolchain.h"
#include "buildmanager.h" #include "buildmanager.h"
#include "buildsteplist.h" #include "buildsteplist.h"
#include "projectexplorer.h" #include "projectexplorer.h"
...@@ -42,25 +43,47 @@ ...@@ -42,25 +43,47 @@
#include <coreplugin/variablemanager.h> #include <coreplugin/variablemanager.h>
#include <utils/stringutils.h>
#include <QtCore/QProcess> #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"); class BuildConfigMacroExpander : public Utils::AbstractQtcMacroExpander {
const char * const BUILD_STEP_LIST_PREFIX("ProjectExplorer.BuildConfiguration.BuildStepList."); public:
const char * const CLEAR_SYSTEM_ENVIRONMENT_KEY("ProjectExplorer.BuildConfiguration.ClearSystemEnvironment"); explicit BuildConfigMacroExpander(const BuildConfiguration *bc) : m_bc(bc) {}
const char * const USER_ENVIRONMENT_CHANGES_KEY("ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"); virtual bool resolveMacro(const QString &name, QString *ret);
const char * const TOOLCHAIN_KEY("ProjectExplorer.BuildCOnfiguration.ToolChain"); 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) : BuildConfiguration::BuildConfiguration(Target *target, const QString &id) :
ProjectConfiguration(target, id), ProjectConfiguration(target, id),
m_clearSystemEnvironment(false), m_clearSystemEnvironment(false),
m_macroExpander(this), m_toolChain(0),
m_toolChain(0) m_macroExpander(0)
{ {
Q_ASSERT(target); Q_ASSERT(target);
BuildStepList *bsl = new BuildStepList(this, QLatin1String(Constants::BUILDSTEPS_BUILD)); BuildStepList *bsl = new BuildStepList(this, QLatin1String(Constants::BUILDSTEPS_BUILD));
...@@ -84,8 +107,8 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc ...@@ -84,8 +107,8 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc
ProjectConfiguration(target, source), ProjectConfiguration(target, source),
m_clearSystemEnvironment(source->m_clearSystemEnvironment), m_clearSystemEnvironment(source->m_clearSystemEnvironment),
m_userEnvironmentChanges(source->m_userEnvironmentChanges), m_userEnvironmentChanges(source->m_userEnvironmentChanges),
m_macroExpander(this), m_toolChain(source->m_toolChain),
m_toolChain(source->m_toolChain) m_macroExpander(0)
{ {
Q_ASSERT(target); Q_ASSERT(target);
// Do not clone stepLists here, do that in the derived constructor instead // Do not clone stepLists here, do that in the derived constructor instead
...@@ -101,7 +124,16 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc ...@@ -101,7 +124,16 @@ BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *sourc
} }
BuildConfiguration::~BuildConfiguration() 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 QStringList BuildConfiguration::knownStepLists() const
{ {
...@@ -284,20 +316,6 @@ QString BuildConfiguration::disabledReason() const ...@@ -284,20 +316,6 @@ QString BuildConfiguration::disabledReason() const
return QString(); 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 // IBuildConfigurationFactory
/// ///
...@@ -308,3 +326,5 @@ IBuildConfigurationFactory::IBuildConfigurationFactory(QObject *parent) : ...@@ -308,3 +326,5 @@ IBuildConfigurationFactory::IBuildConfigurationFactory(QObject *parent) :
IBuildConfigurationFactory::~IBuildConfigurationFactory() IBuildConfigurationFactory::~IBuildConfigurationFactory()
{ } { }
} // namespace ProjectExplorer
...@@ -36,12 +36,14 @@ ...@@ -36,12 +36,14 @@
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include "projectconfiguration.h" #include "projectconfiguration.h"
#include <utils/stringutils.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
namespace Utils {
class AbstractMacroExpander;
}
namespace ProjectExplorer { namespace ProjectExplorer {
class BuildConfiguration; class BuildConfiguration;
...@@ -50,14 +52,6 @@ class Target; ...@@ -50,14 +52,6 @@ class Target;
class ToolChain; class ToolChain;
class IOutputParser; 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 class PROJECTEXPLORER_EXPORT BuildConfiguration : public ProjectConfiguration
{ {
Q_OBJECT Q_OBJECT
...@@ -94,7 +88,7 @@ public: ...@@ -94,7 +88,7 @@ public:
virtual bool isEnabled() const; virtual bool isEnabled() const;
virtual QString disabledReason() const; virtual QString disabledReason() const;
Utils::AbstractMacroExpander *macroExpander() { return &m_macroExpander; } Utils::AbstractMacroExpander *macroExpander();
virtual ProjectExplorer::ToolChain *toolChain() const; virtual ProjectExplorer::ToolChain *toolChain() const;
virtual void setToolChain(ProjectExplorer::ToolChain *tc); virtual void setToolChain(ProjectExplorer::ToolChain *tc);
...@@ -129,8 +123,8 @@ private: ...@@ -129,8 +123,8 @@ private:
bool m_clearSystemEnvironment; bool m_clearSystemEnvironment;
QList<Utils::EnvironmentItem> m_userEnvironmentChanges; QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
QList<BuildStepList *> m_stepLists; QList<BuildStepList *> m_stepLists;
BuildConfigMacroExpander m_macroExpander;
ToolChain *m_toolChain; ToolChain *m_toolChain;
Utils::AbstractMacroExpander *m_macroExpander;
}; };
class PROJECTEXPLORER_EXPORT IBuildConfigurationFactory : class PROJECTEXPLORER_EXPORT IBuildConfigurationFactory :
......
...@@ -35,13 +35,12 @@ ...@@ -35,13 +35,12 @@
#include "projectconfiguration.h" #include "projectconfiguration.h"
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include "task.h"
#include <QtCore/QFutureInterface> #include <QtCore/QFutureInterface>
#include <QtGui/QWidget> #include <QtGui/QWidget>
namespace ProjectExplorer { namespace ProjectExplorer {
class Task;
class BuildConfiguration; class BuildConfiguration;
class BuildStepList; class BuildStepList;
class DeployConfiguration; class DeployConfiguration;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define CLANGPARSER_H #define CLANGPARSER_H
#include "ioutputparser.h" #include "ioutputparser.h"
#include "task.h"
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
......
...@@ -37,10 +37,12 @@ ...@@ -37,10 +37,12 @@
#include "debugginghelper.h" #include "debugginghelper.h"
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
#include "target.h" #include "target.h"
#include "abi.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <utils/stringutils.h>
#include <QtGui/QDialog> #include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox> #include <QtGui/QDialogButtonBox>
......
...@@ -32,16 +32,14 @@ ...@@ -32,16 +32,14 @@
#include "gccparser.h" #include "gccparser.h"
#include "ldparser.h" #include "ldparser.h"
#include "taskwindow.h" #include "task.h"
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace { // opt. drive letter + filename: (2 brackets)
// opt. drive letter + filename: (2 brackets) static const char FILE_PATTERN[] = "(<command[ -]line>|([A-Za-z]:)?[^:]+\\.[^:]+):";
const char * const 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)?: ";
const char * const COMMAND_PATTERN = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(gcc|g\\+\\+)(-[0-9\\.]+)?(\\.exe)?: ";
}
GccParser::GccParser() GccParser::GccParser()
{ {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "gnumakeparser.h" #include "gnumakeparser.h"
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
#include "taskwindow.h" #include "task.h"
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFile> #include <QtCore/QFile>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "ldparser.h" #include "ldparser.h"
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
#include "taskwindow.h" #include "task.h"
using namespace ProjectExplorer; using namespace ProjectExplorer;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define LINUXICCPARSER_H #define LINUXICCPARSER_H
#include "ioutputparser.h" #include "ioutputparser.h"
#include "task.h"
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <utils/environment.h> #include <utils/environment.h>
#include <QtGui/QLabel> #include <QtGui/QLabel>
#include <QtGui/QIcon>
#include <QtCore/QDir> #include <QtCore/QDir>
namespace ProjectExplorer { namespace ProjectExplorer {
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
namespace ProjectExplorer { namespace ProjectExplorer {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
**************************************************************************/ **************************************************************************/
#include "outputparser_test.h" #include "outputparser_test.h"
#include "task.h"
#if defined(WITH_TESTS) #if defined(WITH_TESTS)
......
...@@ -33,11 +33,10 @@ ...@@ -33,11 +33,10 @@
#ifndef PROJECTEXPLORER_H #ifndef PROJECTEXPLORER_H
#define PROJECTEXPLORER_H #define PROJECTEXPLORER_H
#include <QtCore/QPair>
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <QtCore/QPair> #include <QtCore/QPair>