diff --git a/src/plugins/projectexplorer/environment.cpp b/src/libs/utils/environment.cpp similarity index 99% rename from src/plugins/projectexplorer/environment.cpp rename to src/libs/utils/environment.cpp index d1363c519e98e183101187fd32cf46a95928ecd3..03b0084ecc630884c26710638bde1d70b8fba085 100644 --- a/src/plugins/projectexplorer/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -33,7 +33,7 @@ #include <QtCore/QDir> #include <QtCore/QString> -using namespace ProjectExplorer; +using namespace Utils; QList<EnvironmentItem> EnvironmentItem::fromStringList(QStringList list) { diff --git a/src/plugins/projectexplorer/environment.h b/src/libs/utils/environment.h similarity index 92% rename from src/plugins/projectexplorer/environment.h rename to src/libs/utils/environment.h index 41b2ac27706234b873ba3a56b7c2e399c5949fe9..1177c4dc1c169d3f19b7f7f91ee871fa7e4282d4 100644 --- a/src/plugins/projectexplorer/environment.h +++ b/src/libs/utils/environment.h @@ -27,20 +27,21 @@ ** **************************************************************************/ -#ifndef ENVIRONMENT_H -#define ENVIRONMENT_H +#ifndef UTILS_ENVIRONMENT_H +#define UTILS_ENVIRONMENT_H -#include "projectexplorer_export.h" +#include "utils_global.h" #include <QtCore/QString> #include <QtCore/QStringList> #include <QtCore/QMap> #include <QtCore/QList> -namespace ProjectExplorer { +namespace Utils { -struct PROJECTEXPLORER_EXPORT EnvironmentItem +class QTCREATOR_UTILS_EXPORT EnvironmentItem { +public: EnvironmentItem(QString n, QString v) : name(n), value(v), unset(false) {} @@ -58,7 +59,7 @@ struct PROJECTEXPLORER_EXPORT EnvironmentItem static QStringList toStringList(QList<EnvironmentItem> list); }; -class PROJECTEXPLORER_EXPORT Environment { +class QTCREATOR_UTILS_EXPORT Environment { public: typedef QMap<QString, QString>::const_iterator const_iterator; @@ -103,6 +104,6 @@ private: QMap<QString, QString> m_values; }; -} // namespace ProjectExplorer +} // namespace Utils -#endif // ENVIRONMENT_H +#endif // UTILS_ENVIRONMENT_H diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index d338913edf36aef1691bb22e0b36b0c7b47732f1..bfae91f6345b6f459554e684f0d1f7af15348fc5 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -6,7 +6,8 @@ dll { INCLUDEPATH += $$PWD -SOURCES += $$PWD/reloadpromptutils.cpp \ +SOURCES += $$PWD/environment.cpp \ + $$PWD/reloadpromptutils.cpp \ $$PWD/stringutils.cpp \ $$PWD/filesearch.cpp \ $$PWD/pathchooser.cpp \ @@ -61,7 +62,8 @@ unix:!macx { HEADERS += $$PWD/unixutils.h SOURCES += $$PWD/unixutils.cpp } -HEADERS += $$PWD/utils_global.h \ +HEADERS += $$PWD/environment.h \ + $$PWD/utils_global.h \ $$PWD/reloadpromptutils.h \ $$PWD/stringutils.h \ $$PWD/filesearch.h \ diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp index d05c672c269b0fd721726916622c177ced4ae2e3..63b31434f218792e72712e9aa624b11e1d444b13 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp @@ -40,7 +40,6 @@ #include "cmakeprojectmanager.h" #include <utils/pathchooser.h> -#include <projectexplorer/environment.h> #include <projectexplorer/toolchain.h> #include <QtGui/QVBoxLayout> @@ -65,7 +64,7 @@ using namespace CMakeProjectManager::Internal; // |--> Already existing cbp file (and new enough) --> Page: Ready to load the project // |--> Page: Ask for cmd options, run generator -CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const ProjectExplorer::Environment &env) +CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const Utils::Environment &env) : m_cmakeManager(cmakeManager), m_sourceDirectory(sourceDirectory), m_creatingCbpFiles(false), @@ -99,7 +98,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const QString &buildDirectory, CMakeOpenProjectWizard::Mode mode, - const ProjectExplorer::Environment &env) + const Utils::Environment &env) : m_cmakeManager(cmakeManager), m_sourceDirectory(sourceDirectory), m_creatingCbpFiles(true), @@ -119,7 +118,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const QString &oldBuildDirectory, - const ProjectExplorer::Environment &env) + const Utils::Environment &env) : m_cmakeManager(cmakeManager), m_sourceDirectory(sourceDirectory), m_creatingCbpFiles(true), @@ -213,7 +212,7 @@ void CMakeOpenProjectWizard::setArguments(const QStringList &args) m_arguments = args; } -ProjectExplorer::Environment CMakeOpenProjectWizard::environment() const +Utils::Environment CMakeOpenProjectWizard::environment() const { return m_environment; } @@ -422,7 +421,7 @@ void CMakeRunPage::runCMake() { m_runCMake->setEnabled(false); m_argumentsLineEdit->setEnabled(false); - QStringList arguments = ProjectExplorer::Environment::parseCombinedArgString(m_argumentsLineEdit->text()); + QStringList arguments = Utils::Environment::parseCombinedArgString(m_argumentsLineEdit->text()); CMakeManager *cmakeManager = m_cmakeWizard->cmakeManager(); #ifdef Q_OS_WIN @@ -444,7 +443,7 @@ void CMakeRunPage::runCMake() #else // Q_OS_WIN QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles"); #endif - ProjectExplorer::Environment env = m_cmakeWizard->environment(); + Utils::Environment env = m_cmakeWizard->environment(); if (!m_cmakeWizard->msvcVersion().isEmpty()) { // Add the environment of that msvc version to environment ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChain::createMSVCToolChain(m_cmakeWizard->msvcVersion(), false); @@ -482,7 +481,7 @@ void CMakeRunPage::cmakeFinished() m_argumentsLineEdit->setEnabled(true); m_cmakeProcess->deleteLater(); m_cmakeProcess = 0; - m_cmakeWizard->setArguments(ProjectExplorer::Environment::parseCombinedArgString(m_argumentsLineEdit->text())); + m_cmakeWizard->setArguments(Utils::Environment::parseCombinedArgString(m_argumentsLineEdit->text())); //TODO Actually test that running cmake was finished, for setting this bool m_complete = true; emit completeChanged(); diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h index 14d020d531ecfba3c372aa00ccedffce2a83ab99..1fc1dc2ebbab41dbc1c707c5e04fa794f5108205 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h @@ -30,7 +30,7 @@ #ifndef CMAKEOPENPROJECTWIZARD_H #define CMAKEOPENPROJECTWIZARD_H -#include <projectexplorer/environment.h> +#include <utils/environment.h> #include <utils/wizard.h> #include <QtCore/QProcess> @@ -67,14 +67,14 @@ public: }; // used at importing a project without a .user file - CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const ProjectExplorer::Environment &env); + CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const Utils::Environment &env); /// used to update if we have already a .user file /// recreates or updates the cbp file - CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const QString &buildDirectory, Mode mode, const ProjectExplorer::Environment &env); + CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const QString &buildDirectory, Mode mode, const Utils::Environment &env); /// used to change the build directory of one buildconfiguration /// shows a page for selecting a directory /// then the run cmake page - CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const QString &oldBuildDirectory, const ProjectExplorer::Environment &env); + CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, const QString &oldBuildDirectory, const Utils::Environment &env); virtual int nextId() const; QString buildDirectory() const; @@ -83,7 +83,7 @@ public: CMakeManager *cmakeManager() const; QStringList arguments() const; void setArguments(const QStringList &args); - ProjectExplorer::Environment environment() const; + Utils::Environment environment() const; QString msvcVersion() const; void setMsvcVersion(const QString &version); bool existsUpToDateXmlFile() const; @@ -96,7 +96,7 @@ private: QStringList m_arguments; QString m_msvcVersion; bool m_creatingCbpFiles; - ProjectExplorer::Environment m_environment; + Utils::Environment m_environment; }; class InSourceBuildPage : public QWizardPage diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index ef87703670219df8245d71a3f05d7b5c2b47eb5f..a925f8aa201f55efd2ce34502aeeaa8a0d7bddf3 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -56,8 +56,6 @@ using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; using namespace ProjectExplorer; -using ProjectExplorer::Environment; -using ProjectExplorer::EnvironmentItem; // QtCreator CMake Generator wishlist: // Which make targets we need to build to get all executables @@ -478,7 +476,7 @@ bool CMakeProject::fromMap(const QVariantMap &map) // Ask the user for where he wants to build it // and the cmake command line - CMakeOpenProjectWizard copw(m_manager, projectDirectory(), ProjectExplorer::Environment::systemEnvironment()); + CMakeOpenProjectWizard copw(m_manager, projectDirectory(), Utils::Environment::systemEnvironment()); if (copw.exec() != QDialog::Accepted) return false; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 5805d88ab23814dad71d97988d020248ed68ceec..aaffb08bd48408d12a59d7eeb5fbcf3b2e051d5c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -36,7 +36,6 @@ #include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/environment.h> #include <qtconcurrent/QtConcurrentTools> #include <QtCore/QtConcurrentRun> #include <QtCore/QCoreApplication> @@ -103,7 +102,9 @@ bool CMakeManager::hasCodeBlocksMsvcGenerator() const // we probably want the process instead of this function // cmakeproject then could even run the cmake process in the background, adding the files afterwards // sounds like a plan -void CMakeManager::createXmlFile(QProcess *proc, const QStringList &arguments, const QString &sourceDirectory, const QDir &buildDirectory, const ProjectExplorer::Environment &env, const QString &generator) +void CMakeManager::createXmlFile(QProcess *proc, const QStringList &arguments, + const QString &sourceDirectory, const QDir &buildDirectory, + const Utils::Environment &env, const QString &generator) { // We create a cbp file, only if we didn't find a cbp file in the base directory // Yet that can still override cbp files in subdirectories @@ -119,7 +120,8 @@ void CMakeManager::createXmlFile(QProcess *proc, const QStringList &arguments, c proc->setProcessChannelMode(QProcess::MergedChannels); proc->setEnvironment(env.toStringList()); - const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ? QString(QLatin1Char('.')) : sourceDirectory; + const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ? + QString(QLatin1Char('.')) : sourceDirectory; proc->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator); } @@ -243,7 +245,7 @@ CMakeSettingsPage::~CMakeSettingsPage() QString CMakeSettingsPage::findCmakeExecutable() const { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); return env.searchInPath(QLatin1String("cmake")); } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index e4f29233d505fd76f473939743df64c5af90fbb8..f6bae9241d46defd9bbd460415ae4ba3386a4059 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -32,7 +32,7 @@ #include <coreplugin/dialogs/ioptionspage.h> #include <projectexplorer/iprojectmanager.h> -#include <projectexplorer/environment.h> +#include <utils/environment.h> #include <utils/pathchooser.h> #include <QtCore/QFuture> #include <QtCore/QStringList> @@ -67,15 +67,15 @@ public: const QStringList &arguments, const QString &sourceDirectory, const QDir &buildDirectory, - const ProjectExplorer::Environment &env, + const Utils::Environment &env, const QString &generator); bool hasCodeBlocksMsvcGenerator() const; static QString findCbpFile(const QDir &); - static QString findDumperLibrary(const ProjectExplorer::Environment &env); + static QString findDumperLibrary(const Utils::Environment &env); private: static QString qtVersionForQMake(const QString &qmakePath); - static QPair<QString, QString> findQtDir(const ProjectExplorer::Environment &env); + static QPair<QString, QString> findQtDir(const Utils::Environment &env); Core::Context m_projectContext; Core::Context m_projectLanguage; CMakeSettingsPage *m_settingsPage; diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 8549e05359a5fe0172f1b17611170b7f964785e5..33602ccc7487467472ce34013350451c8f61d793 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -35,7 +35,6 @@ #include "cmaketarget.h" #include <coreplugin/coreconstants.h> -#include <projectexplorer/environment.h> #include <projectexplorer/debugginghelper.h> #include <utils/qtcassert.h> #include <utils/debuggerlanguagechooser.h> @@ -141,7 +140,7 @@ QString CMakeRunConfiguration::workingDirectory() const QStringList CMakeRunConfiguration::commandLineArguments() const { - return ProjectExplorer::Environment::parseCombinedArgString(m_arguments); + return Utils::Environment::parseCombinedArgString(m_arguments); } QString CMakeRunConfiguration::title() const @@ -186,7 +185,7 @@ QVariantMap CMakeRunConfiguration::toMap() const map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); map.insert(QLatin1String(TITLE_KEY), m_title); map.insert(QLatin1String(ARGUMENTS_KEY), m_arguments); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges)); + map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), m_baseEnvironmentBase); return map; @@ -200,7 +199,7 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map) m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui; m_title = map.value(QLatin1String(TITLE_KEY)).toString(); m_arguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString(); - m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CMakeRunConfiguration::BuildEnvironmentBase)).toInt()); return RunConfiguration::fromMap(map); @@ -238,13 +237,13 @@ QStringList CMakeRunConfiguration::dumperLibraryLocations() const return ProjectExplorer::DebuggingHelperLibrary::debuggingHelperLibraryLocationsByInstallData(qtInstallData); } -ProjectExplorer::Environment CMakeRunConfiguration::baseEnvironment() const +Utils::Environment CMakeRunConfiguration::baseEnvironment() const { - ProjectExplorer::Environment env; + Utils::Environment env; if (m_baseEnvironmentBase == CMakeRunConfiguration::CleanEnvironmentBase) { // Nothing } else if (m_baseEnvironmentBase == CMakeRunConfiguration::SystemEnvironmentBase) { - env = ProjectExplorer::Environment::systemEnvironment(); + env = Utils::Environment::systemEnvironment(); } else if (m_baseEnvironmentBase == CMakeRunConfiguration::BuildEnvironmentBase) { env = activeBuildConfiguration()->environment(); } @@ -276,19 +275,19 @@ CMakeRunConfiguration::BaseEnvironmentBase CMakeRunConfiguration::baseEnvironmen return m_baseEnvironmentBase; } -ProjectExplorer::Environment CMakeRunConfiguration::environment() const +Utils::Environment CMakeRunConfiguration::environment() const { - ProjectExplorer::Environment env = baseEnvironment(); + Utils::Environment env = baseEnvironment(); env.modify(userEnvironmentChanges()); return env; } -QList<ProjectExplorer::EnvironmentItem> CMakeRunConfiguration::userEnvironmentChanges() const +QList<Utils::EnvironmentItem> CMakeRunConfiguration::userEnvironmentChanges() const { return m_userEnvironmentChanges; } -void CMakeRunConfiguration::setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff) +void CMakeRunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) { if (m_userEnvironmentChanges != diff) { m_userEnvironmentChanges = diff; @@ -327,7 +326,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * fl->setMargin(0); fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); QLineEdit *argumentsLineEdit = new QLineEdit(); - argumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(cmakeRunConfiguration->commandLineArguments())); + argumentsLineEdit->setText(Utils::Environment::joinArgumentList(cmakeRunConfiguration->commandLineArguments())); connect(argumentsLineEdit, SIGNAL(textChanged(QString)), this, SLOT(setArguments(QString))); fl->addRow(tr("Arguments:"), argumentsLineEdit); @@ -426,7 +425,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * this, SLOT(workingDirectoryChanged(QString))); connect(m_cmakeRunConfiguration, SIGNAL(baseEnvironmentChanged()), this, SLOT(baseEnvironmentChanged())); - connect(m_cmakeRunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)), + connect(m_cmakeRunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), this, SLOT(userEnvironmentChangesChanged())); } diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h index 07d982251efbde395eeeb5b4d8b6a9657e7056ea..0e9198e23db6d1c7d680858d7484cdd0f4e80258 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -31,9 +31,9 @@ #define CMAKERUNCONFIGURATION_H #include <projectexplorer/applicationrunconfiguration.h> -#include <projectexplorer/environment.h> #include <projectexplorer/persistentsettings.h> #include <projectexplorer/environmenteditmodel.h> +#include <utils/environment.h> #include <utils/pathchooser.h> #include <utils/detailswidget.h> @@ -69,7 +69,7 @@ public: RunMode runMode() const; QString workingDirectory() const; QStringList commandLineArguments() const; - ProjectExplorer::Environment environment() const; + Utils::Environment environment() const; QWidget *createConfigurationWidget(); void setExecutable(const QString &executable); @@ -92,7 +92,7 @@ public: signals: void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff); + void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); void workingDirectoryChanged(const QString&); private slots: @@ -111,11 +111,11 @@ private: BuildEnvironmentBase = 2}; void setBaseEnvironmentBase(BaseEnvironmentBase env); BaseEnvironmentBase baseEnvironmentBase() const; - ProjectExplorer::Environment baseEnvironment() const; + Utils::Environment baseEnvironment() const; QString baseEnvironmentText() const; - void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff); - QList<ProjectExplorer::EnvironmentItem> userEnvironmentChanges() const; + void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); + QList<Utils::EnvironmentItem> userEnvironmentChanges() const; RunMode m_runMode; QString m_buildTarget; @@ -123,7 +123,7 @@ private: QString m_userWorkingDirectory; QString m_title; QString m_arguments; - QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges; + QList<Utils::EnvironmentItem> m_userEnvironmentChanges; BaseEnvironmentBase m_baseEnvironmentBase; bool m_enabled; }; diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 115ed1aa91d7dbcc7bc3d465fbf1dbfd9de53852..bc820b5da265379965333a2009896eba0e5566e8 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -238,7 +238,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep) void MakeStepConfigWidget::additionalArgumentsEdited() { - m_makeStep->setAdditionalArguments(Environment::parseCombinedArgString(m_additionalArguments->text())); + m_makeStep->setAdditionalArguments(Utils::Environment::parseCombinedArgString(m_additionalArguments->text())); updateDetails(); } @@ -265,7 +265,7 @@ void MakeStepConfigWidget::init() // and connect again connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); - m_additionalArguments->setText(Environment::joinArgumentList(m_makeStep->additionalArguments())); + m_additionalArguments->setText(Utils::Environment::joinArgumentList(m_makeStep->additionalArguments())); updateDetails(); CMakeProject *pro = m_makeStep->cmakeBuildConfiguration()->cmakeTarget()->cmakeProject(); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 0af9b3d6eb0845a395a0dbef0484b91cc6f59347..b16738ab62f2ea1b0e0019b5188532a8b73b5460 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -53,7 +53,6 @@ #include <coreplugin/progressmanager/futureprogress.h> #include <projectexplorer/debugginghelper.h> -#include <projectexplorer/environment.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/target.h> @@ -64,6 +63,7 @@ #include <texteditor/itexteditor.h> +#include <utils/environment.h> #include <utils/savedaction.h> #include <utils/qtcassert.h> @@ -772,7 +772,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl) ? d->m_startParameters.attachPID : 0; if (d->m_startParameters.environment.empty()) - d->m_startParameters.environment = Environment().toStringList(); + d->m_startParameters.environment = Utils::Environment().toStringList(); if (d->m_startParameters.breakAtMain) breakByFunctionMain(); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index a0ada3aaa3878dd048cbd560698b32cd40e01fbb..41d69fad6e4e66ef928a2bdb7c06d5bef3bd5486 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -46,7 +46,6 @@ #endif #include <projectexplorer/debugginghelper.h> -#include <projectexplorer/environment.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> @@ -54,6 +53,7 @@ #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/applicationrunconfiguration.h> // For LocalApplication* +#include <utils/environment.h> #include <utils/qtcassert.h> #include <utils/fancymainwindow.h> #include <coreplugin/icore.h> @@ -479,7 +479,7 @@ QString DebuggerRunControl::displayName() const return d->m_engine->startParameters().displayName; } -void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env) +void DebuggerRunControl::setCustomEnvironment(Utils::Environment env) { d->m_engine->startParameters().environment = env.toStringList(); } diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index 64ed000425ff4ca7eb4f311426554bff0e473beb..3c7aaf1dd3d92bc130611af6fb5c85d7b50e955a 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -37,7 +37,7 @@ #include <QtCore/QScopedPointer> -namespace ProjectExplorer { +namespace Utils { class Environment; } @@ -104,7 +104,7 @@ public: void createEngine(const DebuggerStartParameters &startParameters); - void setCustomEnvironment(ProjectExplorer::Environment env); + void setCustomEnvironment(Utils::Environment env); void setEnabledEngines(DebuggerEngineType enabledEngines); void startFailed(); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 4545bc3d9b58882f0f6b4273d46a19e904fa2b59..80223489d6146aa6ac8eb60b2edcd00c8b0de808 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -46,9 +46,9 @@ #include "watchutils.h" #include <extensionsystem/pluginmanager.h> -#include <projectexplorer/environment.h> #include <projectexplorer/applicationlauncher.h> +#include <utils/environment.h> #include <utils/qtcassert.h> #include <QtCore/QDateTime> diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp index 6f0740e08f8f8e58ee5fe20390ba775510dfab38..d0fb2088a9390ebf9647796794cc63a1c4e5b40d 100644 --- a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp +++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp @@ -84,9 +84,9 @@ bool GenericBuildConfiguration::fromMap(const QVariantMap &map) return BuildConfiguration::fromMap(map); } -ProjectExplorer::Environment GenericBuildConfiguration::environment() const +Utils::Environment GenericBuildConfiguration::environment() const { - return ProjectExplorer::Environment::systemEnvironment(); + return Utils::Environment::systemEnvironment(); } QString GenericBuildConfiguration::buildDirectory() const diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.h b/src/plugins/genericprojectmanager/genericbuildconfiguration.h index eae5d0e749cbb2cb92509e8bf8e1dac27155f898..92c019bf4f0873862e248410fdec23daa8a9527d 100644 --- a/src/plugins/genericprojectmanager/genericbuildconfiguration.h +++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.h @@ -49,7 +49,7 @@ public: GenericTarget *genericTarget() const; - virtual ProjectExplorer::Environment environment() const; + virtual Utils::Environment environment() const; virtual QString buildDirectory() const; QString rawBuildDirectory() const; diff --git a/src/plugins/genericprojectmanager/genericmakestep.cpp b/src/plugins/genericprojectmanager/genericmakestep.cpp index 51406bf64a7646975aa3e23159bd87b4f994be16..1c727de628c2a0a44c231c54733263821a9ba185 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.cpp +++ b/src/plugins/genericprojectmanager/genericmakestep.cpp @@ -247,7 +247,7 @@ void GenericMakeStepConfigWidget::init() m_ui->makeLineEdit->setText(makeCommand); const QStringList &makeArguments = m_makeStep->m_makeArguments; - m_ui->makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments)); + m_ui->makeArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(makeArguments)); // Disconnect to make the changes to the items disconnect(m_ui->targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); @@ -267,7 +267,7 @@ void GenericMakeStepConfigWidget::updateDetails() { m_summaryText = tr("<b>Make:</b> %1 %2") .arg(m_makeStep->makeCommand(), - ProjectExplorer::Environment::joinArgumentList(m_makeStep->replacedArguments())); + Utils::Environment::joinArgumentList(m_makeStep->replacedArguments())); emit updateSummary(); } @@ -291,7 +291,7 @@ void GenericMakeStepConfigWidget::makeLineEditTextEdited() void GenericMakeStepConfigWidget::makeArgumentsLineEditTextEdited() { m_makeStep->m_makeArguments = - ProjectExplorer::Environment::parseCombinedArgString(m_ui->makeArgumentsLineEdit->text()); + Utils::Environment::parseCombinedArgString(m_ui->makeArgumentsLineEdit->text()); updateDetails(); } diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 8df29c6a4c6e1bc2d7667d12dc91f6c8b7166c5d..d957a1bc0a6149729d1a15879ec36fd26be2d953 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -54,8 +54,6 @@ #include <vcsbase/vcsbaseoutputwindow.h> #include <vcsbase/vcsbaseplugin.h> -#include <projectexplorer/environment.h> - #include <QtCore/QRegExp> #include <QtCore/QTemporaryFile> #include <QtCore/QTime> diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index bc93d08265f752854efe1aef93d199e03eee3263..ceee50083bb5d71ceeae362d99d97212cb2fb0fb 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -124,7 +124,7 @@ void AbstractProcessStep::setIgnoreReturnValue(bool b) m_ignoreReturnValue = b; } -void AbstractProcessStep::setEnvironment(Environment env) +void AbstractProcessStep::setEnvironment(Utils::Environment env) { m_environment = env; } diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 8f5ce79215fff61cb01a6bf801c764d3bfac42ce..b9d951e5a45b86310670e564e7bade4e78d3403a 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -31,7 +31,8 @@ #define ABSTRACTPROCESSSTEP_H #include "buildstep.h" -#include "environment.h" + +#include <utils/environment.h> #include <QtCore/QString> #include <QtCore/QProcess> @@ -104,7 +105,7 @@ public: void setIgnoreReturnValue(bool b); /// Set the Environment for running the command /// should be called from init() - void setEnvironment(Environment env); + void setEnvironment(Utils::Environment env); QString workingDirectory() const; @@ -159,7 +160,7 @@ private: bool m_ignoreReturnValue; QProcess *m_process; QEventLoop *m_eventLoop; - ProjectExplorer::Environment m_environment; + Utils::Environment m_environment; ProjectExplorer::IOutputParser *m_outputParserChain; }; diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.h b/src/plugins/projectexplorer/applicationrunconfiguration.h index 2325841e771702fda37a9e59e6aceeb179dfb479..ca84cce27dd6bc1c1a7fb85fbfd071376b86a4c6 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.h +++ b/src/plugins/projectexplorer/applicationrunconfiguration.h @@ -35,9 +35,11 @@ #include "runconfiguration.h" #include "applicationlauncher.h" -namespace ProjectExplorer { - +namespace Utils { class Environment; +} + +namespace ProjectExplorer { class PROJECTEXPLORER_EXPORT LocalApplicationRunConfiguration : public RunConfiguration { @@ -53,7 +55,7 @@ public: virtual RunMode runMode() const = 0; virtual QString workingDirectory() const = 0; virtual QStringList commandLineArguments() const = 0; - virtual Environment environment() const = 0; + virtual Utils::Environment environment() const = 0; virtual QString dumperLibrary() const = 0; virtual QStringList dumperLibraryLocations() const = 0; virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const = 0; diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 03d28f5635b2ded378558685acebdb0b956604c5..67bbc4db5f2c7f600763ec38a9ef3f7eaa1525e0 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -98,7 +98,7 @@ QVariantMap BuildConfiguration::toMap() const { QVariantMap map(ProjectConfiguration::toMap()); map.insert(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY), m_clearSystemEnvironment); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), EnvironmentItem::toStringList(m_userEnvironmentChanges)); + map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); map.insert(QLatin1String(BUILD_STEP_LIST_COUNT), m_stepLists.count()); for (int i = 0; i < m_stepLists.count(); ++i) @@ -110,7 +110,7 @@ QVariantMap BuildConfiguration::toMap() const bool BuildConfiguration::fromMap(const QVariantMap &map) { m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool(); - m_userEnvironmentChanges = EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); qDeleteAll(m_stepLists); m_stepLists.clear(); @@ -143,11 +143,11 @@ Target *BuildConfiguration::target() const return static_cast<Target *>(parent()); } -Environment BuildConfiguration::baseEnvironment() const +Utils::Environment BuildConfiguration::baseEnvironment() const { - Environment result; + Utils::Environment result; if (useSystemEnvironment()) - result = Environment(QProcess::systemEnvironment()); + result = Utils::Environment(QProcess::systemEnvironment()); result.set(QLatin1String("BUILDDIR"), QDir::toNativeSeparators(target()->project()->projectDirectory())); result.set(QLatin1String("SOURCEDIR"), QDir::toNativeSeparators(target()->project()->projectDirectory())); @@ -163,9 +163,9 @@ QString BuildConfiguration::baseEnvironmentText() const return tr("Clean Environment"); } -Environment BuildConfiguration::environment() const +Utils::Environment BuildConfiguration::environment() const { - Environment env = baseEnvironment(); + Utils::Environment env = baseEnvironment(); env.modify(userEnvironmentChanges()); return env; } @@ -183,12 +183,12 @@ bool BuildConfiguration::useSystemEnvironment() const return !m_clearSystemEnvironment; } -QList<EnvironmentItem> BuildConfiguration::userEnvironmentChanges() const +QList<Utils::EnvironmentItem> BuildConfiguration::userEnvironmentChanges() const { return m_userEnvironmentChanges; } -void BuildConfiguration::setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff) +void BuildConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) { if (m_userEnvironmentChanges == diff) return; diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index ef0f52d3d233d4198384a9fd0c0cc2d920cdfb90..ac6ed8fccc01a166d64e434be4e7317003b11b25 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -31,7 +31,8 @@ #define BUILDCONFIGURATION_H #include "projectexplorer_export.h" -#include "environment.h" + +#include <utils/environment.h> #include <QtCore/QString> #include <QtCore/QStringList> @@ -57,11 +58,11 @@ public: virtual QString buildDirectory() const = 0; // TODO: Maybe the BuildConfiguration is not the best place for the environment - virtual Environment baseEnvironment() const; + virtual Utils::Environment baseEnvironment() const; QString baseEnvironmentText() const; - Environment environment() const; - void setUserEnvironmentChanges(const QList<EnvironmentItem> &diff); - QList<EnvironmentItem> userEnvironmentChanges() const; + Utils::Environment environment() const; + void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); + QList<Utils::EnvironmentItem> userEnvironmentChanges() const; bool useSystemEnvironment() const; void setUseSystemEnvironment(bool b); @@ -93,7 +94,7 @@ protected: private: bool m_clearSystemEnvironment; - QList<EnvironmentItem> m_userEnvironmentChanges; + QList<Utils::EnvironmentItem> m_userEnvironmentChanges; QList<BuildStepList *> m_stepLists; }; diff --git a/src/plugins/projectexplorer/cesdkhandler.cpp b/src/plugins/projectexplorer/cesdkhandler.cpp index 7e035e6ba7dc2b79ba9edd9283663cf50bc46838..a0fcb7cd415ce837302a5536cfac50e799c8edc2 100644 --- a/src/plugins/projectexplorer/cesdkhandler.cpp +++ b/src/plugins/projectexplorer/cesdkhandler.cpp @@ -28,7 +28,8 @@ **************************************************************************/ #include "cesdkhandler.h" -#include "environment.h" + +#include <utils/environment.h> #include <QtCore/QFile> #include <QtCore/QDebug> @@ -36,7 +37,7 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -using ProjectExplorer::Environment; +using Utils::Environment; CeSdkInfo::CeSdkInfo() : m_major(0), m_minor(0) diff --git a/src/plugins/projectexplorer/cesdkhandler.h b/src/plugins/projectexplorer/cesdkhandler.h index ae4cf52a668815ecbf1244379d0d638b33081297..1141bd42d54461511e71cc2278164f1f09281960 100644 --- a/src/plugins/projectexplorer/cesdkhandler.h +++ b/src/plugins/projectexplorer/cesdkhandler.h @@ -38,8 +38,11 @@ #define VCINSTALL_MACRO "$(VCInstallDir)" #define VSINSTALL_MACRO "$(VSInstallDir)" -namespace ProjectExplorer { +namespace Utils { class Environment; +} + +namespace ProjectExplorer { class PROJECTEXPLORER_EXPORT CeSdkInfo { @@ -49,7 +52,7 @@ public: inline QString binPath(); inline QString includePath(); inline QString libPath(); - void addToEnvironment(ProjectExplorer::Environment &env); + void addToEnvironment(Utils::Environment &env); inline bool isValid(); inline int majorVersion(); inline int minorVersion(); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 8dffa826eb0f19e47334fcbd425d75cf5c6c7609..c6886ae8a91d90f148fe5bfc0a02f6c62f867a1e 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -28,7 +28,6 @@ **************************************************************************/ #include "customexecutablerunconfiguration.h" -#include "environment.h" #include <coreplugin/icore.h> #include <projectexplorer/buildconfiguration.h> @@ -37,6 +36,7 @@ #include <projectexplorer/target.h> #include <projectexplorer/project.h> #include <utils/detailswidget.h> +#include <utils/environment.h> #include <utils/pathchooser.h> #include <utils/debuggerlanguagechooser.h> @@ -187,7 +187,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()), this, SLOT(baseEnvironmentChanged())); - connect(m_runConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)), + connect(m_runConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), this, SLOT(userEnvironmentChangesChanged())); } @@ -273,13 +273,12 @@ void CustomExecutableConfigurationWidget::changed() if (!executable.isEmpty()) text = tr("Running executable: <b>%1</b> %2"). arg(executable, - ProjectExplorer::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); - + Utils::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); // We triggered the change, don't update us if (m_ignoreChange) return; m_executableChooser->setPath(executable); - m_commandLineArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); + m_commandLineArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory()); m_useTerminalCheck->setChecked(m_runConfiguration->runMode() == LocalApplicationRunConfiguration::Console); } @@ -347,7 +346,7 @@ QString CustomExecutableRunConfiguration::executable() const { QString exec; if (!m_executable.isEmpty() && QDir::isRelativePath(m_executable)) { - Environment env = environment(); + Utils::Environment env = environment(); exec = env.searchInPath(m_executable); if (exec.isEmpty()) exec = QDir::cleanPath(workingDirectory() + QLatin1Char('/') + m_executable); @@ -431,13 +430,13 @@ QString CustomExecutableRunConfiguration::baseEnvironmentText() const return QString(); } -ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment() const +Utils::Environment CustomExecutableRunConfiguration::baseEnvironment() const { - ProjectExplorer::Environment env; + Utils::Environment env; if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { // Nothing } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { - env = ProjectExplorer::Environment::systemEnvironment(); + env = Utils::Environment::systemEnvironment(); } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { if (activeBuildConfiguration()) env = activeBuildConfiguration()->environment(); @@ -458,19 +457,19 @@ CustomExecutableRunConfiguration::BaseEnvironmentBase CustomExecutableRunConfigu return m_baseEnvironmentBase; } -ProjectExplorer::Environment CustomExecutableRunConfiguration::environment() const +Utils::Environment CustomExecutableRunConfiguration::environment() const { - ProjectExplorer::Environment env = baseEnvironment(); + Utils::Environment env = baseEnvironment(); env.modify(userEnvironmentChanges()); return env; } -QList<ProjectExplorer::EnvironmentItem> CustomExecutableRunConfiguration::userEnvironmentChanges() const +QList<Utils::EnvironmentItem> CustomExecutableRunConfiguration::userEnvironmentChanges() const { return m_userEnvironmentChanges; } -void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff) +void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) { if (m_userEnvironmentChanges != diff) { m_userEnvironmentChanges = diff; @@ -493,7 +492,7 @@ QVariantMap CustomExecutableRunConfiguration::toMap() const map.insert(QLatin1String(ARGUMENTS_KEY), m_cmdArguments); map.insert(QLatin1String(WORKING_DIRECTORY_KEY), m_workingDirectory); map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges)); + map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(m_baseEnvironmentBase)); return map; } @@ -504,7 +503,7 @@ bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map) m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toStringList(); m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString(); m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui; - m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt()); setDefaultDisplayName(defaultDisplayName()); @@ -522,7 +521,7 @@ void CustomExecutableRunConfiguration::setExecutable(const QString &executable) void CustomExecutableRunConfiguration::setCommandLineArguments(const QString &commandLineArguments) { - m_cmdArguments = ProjectExplorer::Environment::parseCombinedArgString(commandLineArguments); + m_cmdArguments = Utils::Environment::parseCombinedArgString(commandLineArguments); emit changed(); } diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index 2ec71a2617691bfd9e257591823b0ba8944d1363..59ce495925c60cecfaee43e660ce96207c0abca6 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -92,7 +92,7 @@ public: QString workingDirectory() const; QString baseWorkingDirectory() const; QStringList commandLineArguments() const; - Environment environment() const; + Utils::Environment environment() const; QWidget *createConfigurationWidget(); QString dumperLibrary() const; @@ -106,7 +106,7 @@ signals: void changed(); void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff); + void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); private slots: void activeBuildConfigurationChanged(); @@ -124,10 +124,10 @@ private: BuildEnvironmentBase = 2}; void setBaseEnvironmentBase(BaseEnvironmentBase env); BaseEnvironmentBase baseEnvironmentBase() const; - ProjectExplorer::Environment baseEnvironment() const; + Utils::Environment baseEnvironment() const; QString baseEnvironmentText() const; - void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff); - QList<ProjectExplorer::EnvironmentItem> userEnvironmentChanges() const; + void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); + QList<Utils::EnvironmentItem> userEnvironmentChanges() const; void setExecutable(const QString &executable); void setCommandLineArguments(const QString &commandLineArguments); @@ -140,7 +140,7 @@ private: RunMode m_runMode; bool m_userSetName; QString m_userName; - QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges; + QList<Utils::EnvironmentItem> m_userEnvironmentChanges; BaseEnvironmentBase m_baseEnvironmentBase; ProjectExplorer::BuildConfiguration *m_lastActiveBuildConfiguration; }; diff --git a/src/plugins/projectexplorer/debugginghelper.cpp b/src/plugins/projectexplorer/debugginghelper.cpp index 235262577d7c1ceaff0cb4ed8b784c9f4819e5a0..8320771dbf69c630b7b965386f5e828d998cbe68 100644 --- a/src/plugins/projectexplorer/debugginghelper.cpp +++ b/src/plugins/projectexplorer/debugginghelper.cpp @@ -43,7 +43,7 @@ using namespace ProjectExplorer; -QString DebuggingHelperLibrary::findSystemQt(const Environment &env) +QString DebuggingHelperLibrary::findSystemQt(const Utils::Environment &env) { QStringList paths = env.path(); foreach (const QString &path, paths) { @@ -194,7 +194,7 @@ QString DebuggingHelperLibrary::copyDebuggingHelperLibrary(const QString &qtInst QString DebuggingHelperLibrary::buildDebuggingHelperLibrary(const QString &directory, const QString &makeCommand, const QString &qmakeCommand, const QString &mkspec, - const Environment &env, const QString &targetMode) + const Utils::Environment &env, const QString &targetMode) { QString output; const QChar newline = QLatin1Char('\n'); diff --git a/src/plugins/projectexplorer/debugginghelper.h b/src/plugins/projectexplorer/debugginghelper.h index ddb6a296b886ecf69e316c1fee56cad3dc0e427a..3121b66eea70b844043f06d1a95ce6963e02d71f 100644 --- a/src/plugins/projectexplorer/debugginghelper.h +++ b/src/plugins/projectexplorer/debugginghelper.h @@ -30,9 +30,10 @@ #ifndef DEBUGGINGHELPER_H #define DEBUGGINGHELPER_H -#include "environment.h" #include "projectexplorer_export.h" +#include <utils/environment.h> + #include <QtCore/QString> #include <QtCore/QStringList> @@ -42,7 +43,7 @@ class PROJECTEXPLORER_EXPORT DebuggingHelperLibrary public: // returns the full path to the first qmake, qmake-qt4, qmake4 that has // at least version 2.0.0 and thus is a qt4 qmake - static QString findSystemQt(const Environment &env); + static QString findSystemQt(const Utils::Environment &env); // returns something like qmake4, qmake, qmake-qt4 or whatever distributions have chosen (used by QtVersion) static QStringList possibleQMakeCommands(); // return true if the qmake at qmakePath is qt4 (used by QtVersion) @@ -53,7 +54,7 @@ public: // Build the helpers and return the output log/errormessage. static QString buildDebuggingHelperLibrary(const QString &directory, const QString &makeCommand, - const QString &qmakeCommand, const QString &mkspec, const Environment &env, const QString &targetMode); + const QString &qmakeCommand, const QString &mkspec, const Utils::Environment &env, const QString &targetMode); // Copy the source files to a target location and return the chosen target location. static QString copyDebuggingHelperLibrary(const QString &qtInstallData, QString *errorMessage); diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index 95dca80f8d8e60856fb2534b7312b955f01e51db..e03a2ee4f4878f219d85a9fbd8a1c608093725b7 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -31,7 +31,8 @@ #define PROJECTEXPLORER_DEPLOYCONFIGURATION_H #include "projectexplorer_export.h" -#include "environment.h" + +#include "projectconfiguration.h" #include "namedwidget.h" #include <QtCore/QString> @@ -39,8 +40,6 @@ #include <QtCore/QList> #include <QtCore/QObject> -#include "projectconfiguration.h" - namespace ProjectExplorer { class BuildStepList; diff --git a/src/plugins/projectexplorer/environmenteditmodel.cpp b/src/plugins/projectexplorer/environmenteditmodel.cpp index 4f8ee9af459b92b4f273364876126e86f09e5aa5..3339927ca1afcc52b97a10d7b878dbbe848164e2 100644 --- a/src/plugins/projectexplorer/environmenteditmodel.cpp +++ b/src/plugins/projectexplorer/environmenteditmodel.cpp @@ -28,9 +28,9 @@ **************************************************************************/ #include "environmenteditmodel.h" -#include "environment.h" #include <utils/detailswidget.h> +#include <utils/environment.h> #include <QtGui/QTextDocument> #include <QtGui/QVBoxLayout> @@ -64,7 +64,7 @@ public: QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QModelIndex addVariable(); - QModelIndex addVariable(const EnvironmentItem &item); + QModelIndex addVariable(const Utils::EnvironmentItem &item); void resetVariable(const QString &name); void unsetVariable(const QString &name); bool canUnset(const QString &name); @@ -72,9 +72,9 @@ public: QString indexToVariable(const QModelIndex &index) const; QModelIndex variableToIndex(const QString &name) const; bool changes(const QString &key) const; - void setBaseEnvironment(const ProjectExplorer::Environment &env); - QList<EnvironmentItem> userChanges() const; - void setUserChanges(QList<EnvironmentItem> list); + void setBaseEnvironment(const Utils::Environment &env); + QList<Utils::EnvironmentItem> userChanges() const; + void setUserChanges(QList<Utils::EnvironmentItem> list); signals: void userChangesChanged(); @@ -89,9 +89,9 @@ private: int findInResultInsertPosition(const QString &name) const; int findInResult(const QString &name) const; - ProjectExplorer::Environment m_baseEnvironment; - ProjectExplorer::Environment m_resultEnvironment; - QList<EnvironmentItem> m_items; + Utils::Environment m_baseEnvironment; + Utils::Environment m_resultEnvironment; + QList<Utils::EnvironmentItem> m_items; }; QString EnvironmentModel::indexToVariable(const QModelIndex &index) const @@ -105,14 +105,14 @@ void EnvironmentModel::updateResultEnvironment() m_resultEnvironment.modify(m_items); // Add removed variables again and mark them as "<UNSET>" so // that the user can actually see those removals: - foreach (const EnvironmentItem &item, m_items) { + foreach (const Utils::EnvironmentItem &item, m_items) { if (item.unset) { m_resultEnvironment.set(item.name, tr("<UNSET>")); } } } -void EnvironmentModel::setBaseEnvironment(const ProjectExplorer::Environment &env) +void EnvironmentModel::setBaseEnvironment(const Utils::Environment &env) { if (m_baseEnvironment == env) return; @@ -206,7 +206,7 @@ QModelIndex EnvironmentModel::variableToIndex(const QString &name) const int EnvironmentModel::findInResult(const QString &name) const { - Environment::const_iterator it; + Utils::Environment::const_iterator it; int i = 0; for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i) if (m_resultEnvironment.key(it) == name) @@ -216,7 +216,7 @@ int EnvironmentModel::findInResult(const QString &name) const int EnvironmentModel::findInResultInsertPosition(const QString &name) const { - Environment::const_iterator it; + Utils::Environment::const_iterator it; int i = 0; for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i) if (m_resultEnvironment.key(it) > name) @@ -248,7 +248,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, if (m_resultEnvironment.hasKey(newName)) return false; - EnvironmentItem newVariable(newName, oldValue); + Utils::EnvironmentItem newVariable(newName, oldValue); if (changesPos != -1) resetVariable(oldName); // restore the original base variable again @@ -271,7 +271,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, } } else { // Add a new change item: - m_items.append(EnvironmentItem(oldName, stringValue)); + m_items.append(Utils::EnvironmentItem(oldName, stringValue)); } updateResultEnvironment(); emit dataChanged(index, index); @@ -283,13 +283,13 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, QModelIndex EnvironmentModel::addVariable() { - return addVariable(EnvironmentItem(tr("<VARIABLE>", - "Name when inserting a new variable"), - tr("<VALUE>", - "Value when inserting a new variable"))); + //: Name when inserting a new variable + return addVariable(Utils::EnvironmentItem(tr("<VARIABLE>"), + //: Value when inserting a new variable + tr("<VALUE>"))); } -QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item) +QModelIndex EnvironmentModel::addVariable(const Utils::EnvironmentItem &item) { int insertPos = findInResultInsertPosition(item.name); @@ -365,7 +365,7 @@ void EnvironmentModel::unsetVariable(const QString &name) emit userChangesChanged(); return; } - EnvironmentItem item(name, QString()); + Utils::EnvironmentItem item(name, QString()); item.unset = true; m_items.append(item); updateResultEnvironment(); @@ -387,12 +387,12 @@ bool EnvironmentModel::canReset(const QString &name) return m_baseEnvironment.hasKey(name); } -QList<EnvironmentItem> EnvironmentModel::userChanges() const +QList<Utils::EnvironmentItem> EnvironmentModel::userChanges() const { return m_items; } -void EnvironmentModel::setUserChanges(QList<EnvironmentItem> list) +void EnvironmentModel::setUserChanges(QList<Utils::EnvironmentItem> list) { // We assume nobody is reordering the items here. if (list == m_items) @@ -517,7 +517,7 @@ void EnvironmentWidget::focusIndex(const QModelIndex &index) d->m_environmentView->setFocus(); } -void EnvironmentWidget::setBaseEnvironment(const ProjectExplorer::Environment &env) +void EnvironmentWidget::setBaseEnvironment(const Utils::Environment &env) { d->m_model->setBaseEnvironment(env); } @@ -528,12 +528,12 @@ void EnvironmentWidget::setBaseEnvironmentText(const QString &text) updateSummaryText(); } -QList<EnvironmentItem> EnvironmentWidget::userChanges() const +QList<Utils::EnvironmentItem> EnvironmentWidget::userChanges() const { return d->m_model->userChanges(); } -void EnvironmentWidget::setUserChanges(const QList<EnvironmentItem> &list) +void EnvironmentWidget::setUserChanges(const QList<Utils::EnvironmentItem> &list) { d->m_model->setUserChanges(list); updateSummaryText(); @@ -542,8 +542,8 @@ void EnvironmentWidget::setUserChanges(const QList<EnvironmentItem> &list) void EnvironmentWidget::updateSummaryText() { QString text; - const QList<EnvironmentItem> &list = d->m_model->userChanges(); - foreach (const EnvironmentItem &item, list) { + const QList<Utils::EnvironmentItem> &list = d->m_model->userChanges(); + foreach (const Utils::EnvironmentItem &item, list) { if (item.name != EnvironmentModel::tr("<VARIABLE>")) { text.append("<br>"); if (item.unset) diff --git a/src/plugins/projectexplorer/environmenteditmodel.h b/src/plugins/projectexplorer/environmenteditmodel.h index 7e256c9c87bd0016ce72c0057d2dd9edcfe23d32..2bb324d8b7f9b992fbdefa7eec8c6de1f2b9ec50 100644 --- a/src/plugins/projectexplorer/environmenteditmodel.h +++ b/src/plugins/projectexplorer/environmenteditmodel.h @@ -36,10 +36,13 @@ QT_FORWARD_DECLARE_CLASS(QModelIndex) +namespace Utils { +class Environment; +class EnvironmentItem; +} + namespace ProjectExplorer { struct EnvironmentWidgetPrivate; -class Environment; -struct EnvironmentItem; class PROJECTEXPLORER_EXPORT EnvironmentWidget : public QWidget { @@ -49,10 +52,10 @@ public: virtual ~EnvironmentWidget(); void setBaseEnvironmentText(const QString &text); - void setBaseEnvironment(const ProjectExplorer::Environment &env); + void setBaseEnvironment(const Utils::Environment &env); - QList<EnvironmentItem> userChanges() const; - void setUserChanges(const QList<EnvironmentItem> &list); + QList<Utils::EnvironmentItem> userChanges() const; + void setUserChanges(const QList<Utils::EnvironmentItem> &list); signals: void userChangesChanged(); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 624a095884fbbf3870ebb53fedc14f41707c4bb7..217d89173daadbdbf63716ab19153f239778d673 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -30,7 +30,6 @@ #include "foldernavigationwidget.h" #include "projectexplorer.h" #include "projectexplorerconstants.h" -#include "environment.h" #include <coreplugin/icore.h> #include <coreplugin/fileiconprovider.h> @@ -38,6 +37,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/coreconstants.h> +#include <utils/environment.h> #include <utils/pathchooser.h> #include <utils/qtcassert.h> #include <utils/unixutils.h> @@ -391,7 +391,7 @@ void FolderNavigationWidget::showInGraphicalShell(QWidget *parent, const QString { // Mac, Windows support folder or file. #if defined(Q_OS_WIN) - const QString explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe")); + const QString explorer = Utils::Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe")); if (explorer.isEmpty()) { QMessageBox::warning(parent, tr("Launching Windows Explorer Failed"), diff --git a/src/plugins/projectexplorer/processstep.h b/src/plugins/projectexplorer/processstep.h index beca8037698e3bd0380575d58be769104660f084..e6c865cc148e6d411f7e95c0df324e2b668ca333 100644 --- a/src/plugins/projectexplorer/processstep.h +++ b/src/plugins/projectexplorer/processstep.h @@ -96,7 +96,7 @@ private: QString m_command; QStringList m_arguments; QString m_workingDirectory; - Environment m_env; + Utils::Environment m_env; bool m_enabled; }; diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index cb353c7fbe301b036f3d1434201d23dc544c505d..2b395948d5f84f4b745633665d197d5887ca6b6d 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -47,7 +47,6 @@ HEADERS += projectexplorer.h \ allprojectsfind.h \ buildstep.h \ buildconfiguration.h \ - environment.h \ iprojectproperties.h \ buildsettingspropertiespage.h \ environmenteditmodel.h \ @@ -126,7 +125,6 @@ SOURCES += projectexplorer.cpp \ pluginfilefactory.cpp \ buildstep.cpp \ buildconfiguration.cpp \ - environment.cpp \ buildsettingspropertiespage.cpp \ environmenteditmodel.cpp \ processstep.cpp \ diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 57318be67b867230f0bf945ff5a1ae7d2892dde6..6775f2343e8635479375e0afdf7eede74879f9e8 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -35,10 +35,12 @@ QT_FORWARD_DECLARE_CLASS(QIcon) -namespace ProjectExplorer { +namespace Utils { +class Environment; +} +namespace ProjectExplorer { class RunConfiguration; -class Environment; class BuildConfiguration; class DeployConfiguration; class IBuildConfigurationFactory; diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 8cc23b421508f093be11655e156a1ab7b2b96f6f..f680c5a8ce407da6f233e3ce0ea0ac03aa1014e1 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -224,14 +224,14 @@ static QByteArray gccPredefinedMacros(const QString &gcc, const QStringList &env QByteArray GccToolChain::predefinedMacros() { if (m_predefinedMacros.isEmpty()) { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); m_predefinedMacros = gccPredefinedMacros(m_gcc, env.toStringList()); } return m_predefinedMacros; } -static QList<HeaderPath> gccSystemHeaderPaths(const QString &gcc, ProjectExplorer::Environment env) +static QList<HeaderPath> gccSystemHeaderPaths(const QString &gcc, Utils::Environment env) { QList<HeaderPath> systemHeaderPaths; QStringList arguments; @@ -300,14 +300,14 @@ static QList<HeaderPath> gccSystemHeaderPaths(const QString &gcc, ProjectExplore QList<HeaderPath> GccToolChain::systemHeaderPaths() { if (m_systemHeaderPaths.isEmpty()) { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); m_systemHeaderPaths = gccSystemHeaderPaths(m_gcc, env); } return m_systemHeaderPaths; } -void GccToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void GccToolChain::addToEnvironment(Utils::Environment &env) { Q_UNUSED(env) } @@ -344,7 +344,7 @@ bool MinGWToolChain::equals(const ToolChain *other) const return (m_mingwPath == o->m_mingwPath && this->GccToolChain::equals(other)); } -void MinGWToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void MinGWToolChain::addToEnvironment(Utils::Environment &env) { if (debug) qDebug() << "MinGWToolChain::addToEnvironment" << m_mingwPath; @@ -696,7 +696,7 @@ static QByteArray msvcPredefinedMacros(const QStringList &env) QByteArray MSVCToolChain::predefinedMacros() { if (m_predefinedMacros.isEmpty()) { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); m_predefinedMacros = msvcPredefinedMacros(env.toStringList()); } @@ -706,7 +706,7 @@ QByteArray MSVCToolChain::predefinedMacros() QList<HeaderPath> MSVCToolChain::systemHeaderPaths() { //TODO fix this code - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); QList<HeaderPath> headerPaths; foreach(const QString &path, env.value("INCLUDE").split(QLatin1Char(';'))) { @@ -717,7 +717,7 @@ QList<HeaderPath> MSVCToolChain::systemHeaderPaths() MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSetting(const QString &varsBat, const QStringList &args, - const ProjectExplorer::Environment &env) + const Utils::Environment &env) { const StringStringPairList rc = readEnvironmentSettingI(varsBat, args, env); if (debug) { @@ -736,7 +736,7 @@ MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSetting(const // Windows: Expand the delayed evaluation references returned by the // SDK setup scripts: "PATH=!Path!;foo". Some values might expand // to empty and should not be added -static inline QString winExpandDelayedEnvReferences(QString in, const ProjectExplorer::Environment &env) +static inline QString winExpandDelayedEnvReferences(QString in, const Utils::Environment &env) { const QChar exclamationMark = QLatin1Char('!'); for (int pos = 0; pos < in.size(); ) { @@ -757,7 +757,7 @@ static inline QString winExpandDelayedEnvReferences(QString in, const ProjectExp MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSettingI(const QString &varsBat, const QStringList &args, - const ProjectExplorer::Environment &env) + const Utils::Environment &env) { // Run the setup script and extract the variables if (!QFileInfo(varsBat).exists()) @@ -818,7 +818,7 @@ MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSettingI(const return rc; } -void MSVCToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void MSVCToolChain::addToEnvironment(Utils::Environment &env) { if (debug) qDebug() << "MSVCToolChain::addToEnvironment" << m_installation.name; @@ -890,7 +890,7 @@ QByteArray WinCEToolChain::predefinedMacros() QList<HeaderPath> WinCEToolChain::systemHeaderPaths() { //TODO fix this code - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); QList<HeaderPath> headerPaths; @@ -905,7 +905,7 @@ QList<HeaderPath> WinCEToolChain::systemHeaderPaths() return headerPaths; } -void WinCEToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void WinCEToolChain::addToEnvironment(Utils::Environment &env) { MSVCToolChain::addToEnvironment(env); QSettings registry(MSVC_RegKey, QSettings::NativeFormat); diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 1aa2341545339c7979a9c36f20053eac4da0cdaf..7a633611c802a79d6bc6e5258cd2f616059da760 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -31,7 +31,8 @@ #define TOOLCHAIN_H #include "projectexplorer_export.h" -#include "environment.h" + +#include <utils/environment.h> #include <QtCore/QString> #include <QtCore/QPair> @@ -39,7 +40,6 @@ namespace ProjectExplorer { -class Environment; class IOutputParser; class Project; @@ -95,7 +95,7 @@ public: virtual QByteArray predefinedMacros() = 0; virtual QList<HeaderPath> systemHeaderPaths() = 0; - virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0; + virtual void addToEnvironment(Utils::Environment &env) = 0; virtual ToolChainType type() const = 0; virtual QString makeCommand() const = 0; virtual IOutputParser *outputParser() const = 0; @@ -126,7 +126,7 @@ public: GccToolChain(const QString &gcc); virtual QByteArray predefinedMacros(); virtual QList<HeaderPath> systemHeaderPaths(); - virtual void addToEnvironment(ProjectExplorer::Environment &env); + virtual void addToEnvironment(Utils::Environment &env); virtual ToolChainType type() const; virtual QString makeCommand() const; virtual IOutputParser *outputParser() const; @@ -146,7 +146,7 @@ class PROJECTEXPLORER_EXPORT MinGWToolChain : public GccToolChain { public: MinGWToolChain(const QString &gcc, const QString &mingwPath); - virtual void addToEnvironment(ProjectExplorer::Environment &env); + virtual void addToEnvironment(Utils::Environment &env); virtual ToolChainType type() const; virtual QString makeCommand() const; virtual IOutputParser *outputParser() const; @@ -205,7 +205,7 @@ public: bool amd64 = false); virtual QByteArray predefinedMacros(); virtual QList<HeaderPath> systemHeaderPaths(); - virtual void addToEnvironment(ProjectExplorer::Environment &env); + virtual void addToEnvironment(Utils::Environment &env); virtual ToolChainType type() const; virtual QString makeCommand() const; virtual IOutputParser *outputParser() const; @@ -219,7 +219,7 @@ protected: virtual bool equals(const ToolChain *other) const; static StringStringPairList readEnvironmentSetting(const QString &varsBat, const QStringList &args, - const ProjectExplorer::Environment &env); + const Utils::Environment &env); QByteArray m_predefinedMacros; const Installation m_installation; @@ -227,11 +227,11 @@ protected: private: static StringStringPairList readEnvironmentSettingI(const QString &varsBat, const QStringList &args, - const ProjectExplorer::Environment &env); + const Utils::Environment &env); mutable StringStringPairList m_values; mutable bool m_valuesSet; - mutable ProjectExplorer::Environment m_lastEnvironment; + mutable Utils::Environment m_lastEnvironment; }; PROJECTEXPLORER_EXPORT QDebug operator<<(QDebug in, const MSVCToolChain::Installation &i); @@ -244,7 +244,7 @@ public: virtual QByteArray predefinedMacros(); virtual QList<HeaderPath> systemHeaderPaths(); - virtual void addToEnvironment(ProjectExplorer::Environment &env); + virtual void addToEnvironment(Utils::Environment &env); virtual ToolChainType type() const; protected: diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.cpp b/src/plugins/qmljseditor/qmljspreviewrunner.cpp index bd22e9c9d5d00a43e36e510069b02eb55faa2621..585b2e3b18ce0fd1c4ed7cc6a7a587d6f7a2dd8e 100644 --- a/src/plugins/qmljseditor/qmljspreviewrunner.cpp +++ b/src/plugins/qmljseditor/qmljspreviewrunner.cpp @@ -29,7 +29,7 @@ #include "qmljspreviewrunner.h" -#include <projectexplorer/environment.h> +#include <utils/environment.h> #include <utils/synchronousprocess.h> #include <QtGui/QMessageBox> @@ -49,7 +49,7 @@ QmlJSPreviewRunner::QmlJSPreviewRunner(QObject *parent) : + QString(qgetenv("PATH")); m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qmlviewer")); - ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment environment = Utils::Environment::systemEnvironment(); m_applicationLauncher.setEnvironment(environment.toStringList()); } diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index f55bbd12fae72cb8ef9620058612365e46edad94..8c6d4bfb40ad981e88a90929b58640337fe000d6 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -32,9 +32,9 @@ #include "qmlprojectconstants.h" #include <coreplugin/icore.h> #include <coreplugin/modemanager.h> -#include <projectexplorer/environment.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/applicationlauncher.h> +#include <utils/environment.h> #include <utils/qtcassert.h> #include <debugger/debuggerrunner.h> @@ -56,7 +56,7 @@ namespace Internal { QmlRunControl::QmlRunControl(QmlProjectRunConfiguration *runConfiguration, QString mode) : RunControl(runConfiguration, mode) { - ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment environment = Utils::Environment::systemEnvironment(); m_applicationLauncher.setEnvironment(environment.toStringList()); m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory()); @@ -173,7 +173,7 @@ QWidget *QmlRunControlFactory::createConfigurationWidget(RunConfiguration *runCo ProjectExplorer::RunControl *QmlRunControlFactory::createDebugRunControl(QmlProjectRunConfiguration *runConfig) { - ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment environment = Utils::Environment::systemEnvironment(); Debugger::DebuggerStartParameters params; params.startMode = Debugger::StartInternal; params.executable = runConfig->viewerPath(); diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index ed093269c5d887bc9506ea14c7594b2a7c3e5992..4a42a65633f2718a8fd6f244c244c80c1887ea07 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -46,7 +46,6 @@ #include <QtCore/QDir> #include <QtCore/QFileInfo> -using ProjectExplorer::Environment; using ExtensionSystem::PluginManager; using namespace Qt4ProjectManager; using namespace Qt4ProjectManager::Internal; @@ -122,7 +121,7 @@ bool MakeStep::fromMap(const QVariantMap &map) bool MakeStep::init() { Qt4BuildConfiguration *bc = qt4BuildConfiguration(); - Environment environment = bc->environment(); + Utils::Environment environment = bc->environment(); setEnvironment(environment); QString workingDirectory; @@ -284,7 +283,7 @@ void MakeStepConfigWidget::updateDetails() if (!m_makeStep->m_makeCmd.isEmpty()) makeCmd = m_makeStep->m_makeCmd; if (!QFileInfo(makeCmd).isAbsolute()) { - Environment environment = bc->environment(); + Utils::Environment environment = bc->environment(); // Try to detect command in environment const QString tmp = environment.searchInPath(makeCmd); if (tmp.isEmpty()) { @@ -328,7 +327,7 @@ void MakeStepConfigWidget::userArgumentsChanged() if (m_ignoreChange) return; const QStringList &makeArguments = m_makeStep->userArguments(); - m_ui->makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments)); + m_ui->makeArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(makeArguments)); updateDetails(); } @@ -340,7 +339,7 @@ void MakeStepConfigWidget::init() m_ui->makeLineEdit->setText(makeCmd); const QStringList &makeArguments = m_makeStep->userArguments(); - m_ui->makeArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(makeArguments)); + m_ui->makeArgumentsLineEdit->setText(Utils::Environment::joinArgumentList(makeArguments)); updateDetails(); } @@ -354,7 +353,7 @@ void MakeStepConfigWidget::makeArgumentsLineEdited() { m_ignoreChange = true; m_makeStep->setUserArguments( - ProjectExplorer::Environment::parseCombinedArgString(m_ui->makeArgumentsLineEdit->text())); + Utils::Environment::parseCombinedArgString(m_ui->makeArgumentsLineEdit->text())); m_ignoreChange = false; updateDetails(); } diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 0e71f4e26a05db842256c4dbd050c442b136d27f..df002105e1e6031f672fe5336c502f44ceab0aa7 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -329,7 +329,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) void QMakeStepConfigWidget::init() { - QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments()); + QString qmakeArgs = Utils::Environment::joinArgumentList(m_step->userArguments()); m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs); qmakeBuildConfigChanged(); @@ -373,7 +373,7 @@ void QMakeStepConfigWidget::userArgumentsChanged() { if (m_ignoreChange) return; - QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments()); + QString qmakeArgs = Utils::Environment::joinArgumentList(m_step->userArguments()); m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs); updateSummaryLabel(); updateEffectiveQMakeCall(); @@ -383,7 +383,7 @@ void QMakeStepConfigWidget::qmakeArgumentsLineEdited() { m_ignoreChange = true; m_step->setUserArguments( - ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text())); + Utils::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text())); m_ignoreChange = false; updateSummaryLabel(); @@ -445,7 +445,7 @@ void QMakeStepConfigWidget::updateEffectiveQMakeCall() Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration(); const QtVersion *qtVersion = qt4bc->qtVersion(); QString program = QFileInfo(qtVersion->qmakeCommand()).fileName(); - m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + ProjectExplorer::Environment::joinArgumentList(m_step->allArguments())); + m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + Utils::Environment::joinArgumentList(m_step->allArguments())); } //// diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp index df1202af27a9d17154bd786db183f780e91e7964..bc3938f883865824e4b270f08616570a5afbb700 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp @@ -312,10 +312,10 @@ int MaemoDebugSupport::qmlServerPort(const MaemoRunConfiguration *rc) QString MaemoDebugSupport::environment(const MaemoRunConfiguration *rc) { - QList<EnvironmentItem> env = rc->userEnvironmentChanges(); + QList<Utils::EnvironmentItem> env = rc->userEnvironmentChanges(); // FIXME: this must use command line argument instead: -qmljsdebugger=port:1234. if (rc->useQmlDebugger()) { -// env << EnvironmentItem(QLatin1String(Debugger::Constants::E_QML_DEBUG_SERVER_PORT), +// env << Utils::EnvironmentItem(QLatin1String(Debugger::Constants::E_QML_DEBUG_SERVER_PORT), // QString::number(qmlServerPort(rc))); } return MaemoGlobal::remoteEnvironment(env); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp index b562aea94cece1c71966bc37a47b2140b6869ba0..0ea53fa3696baa4f9d29a49b50b621e7ee1a567c 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.cpp @@ -93,7 +93,7 @@ void MaemoDeviceEnvReader::setEnvironment() { if (m_remoteOutput.isEmpty()) return; - m_env = ProjectExplorer::Environment(m_remoteOutput.split(QLatin1Char('\n'), + m_env = Utils::Environment(m_remoteOutput.split(QLatin1Char('\n'), QString::SkipEmptyParts)); } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h index b8ae353d698b08781404dce219553edb1b351d64..3d53e93ba0ffcbd9061e0c6dc01330717165e75a 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceenvreader.h @@ -37,7 +37,7 @@ #include "maemodeviceconfigurations.h" -#include <projectexplorer/environment.h> +#include <utils/environment.h> #include <QtCore/QObject> @@ -61,7 +61,7 @@ public: void start(); void stop(); - ProjectExplorer::Environment deviceEnvironment() const { return m_env; } + Utils::Environment deviceEnvironment() const { return m_env; } signals: void finished(); @@ -81,7 +81,7 @@ private slots: private: bool m_stop; QString m_remoteOutput; - ProjectExplorer::Environment m_env; + Utils::Environment m_env; MaemoDeviceConfig m_devConfig; QSharedPointer<Core::SshConnection> m_connection; QSharedPointer<Core::SshRemoteProcess> m_remoteProcess; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp index c07fd5cd59fe303b0d859a48b81881171652b0b1..cbd3ebf5416a6e1fb26e0fed212479d37ab15eaa 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp @@ -62,11 +62,11 @@ QString MaemoGlobal::remoteSourceProfilesCommand() return QString::fromAscii(remoteCall); } -QString MaemoGlobal::remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list) +QString MaemoGlobal::remoteEnvironment(const QList<Utils::EnvironmentItem> &list) { QString env; QString placeHolder = QLatin1String("%1=%2 "); - foreach (const ProjectExplorer::EnvironmentItem &item, list) + foreach (const Utils::EnvironmentItem &item, list) env.append(placeHolder.arg(item.name).arg(item.value)); return env.mid(0, env.size() - 1); } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h index 762b67c4f4ee3449f6c268fb09653ce48b1832fc..7305dd342869ec7a8d215722076acae85568f6cd 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h @@ -30,8 +30,9 @@ #ifndef MAEMOGLOBAL_H #define MAEMOGLOBAL_H +#include <utils/environment.h> + #include <projectexplorer/deployconfiguration.h> -#include <projectexplorer/environment.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/projectexplorerconstants.h> @@ -50,7 +51,7 @@ public: static QString homeDirOnDevice(const QString &uname); static QString remoteSudo(); static QString remoteCommandPrefix(const QString &commandFilePath); - static QString remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list); + static QString remoteEnvironment(const QList<Utils::EnvironmentItem> &list); static QString remoteProjectSourcesMountPoint(); static QString remoteSourceProfilesCommand(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp index 959cf6806d3ae7b1b0de8cb4ec774bb87a9c5a29..724d2d191e03e275ecb1e81f2a86b0a7228a83cc 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp @@ -149,7 +149,7 @@ QVariantMap MaemoRunConfiguration::toMap() const map.insert(UseRemoteGdbKey, useRemoteGdb()); map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase); map.insert(UserEnvironmentChangesKey, - ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges)); + Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); map.unite(m_remoteMounts->toMap()); return map; } @@ -164,7 +164,7 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map) m_proFilePath = dir.filePath(map.value(ProFileKey).toString()); m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool(); m_userEnvironmentChanges = - ProjectExplorer::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey) + Utils::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey) .toStringList()); m_baseEnvironmentBase = static_cast<BaseEnvironmentBase> (map.value(BaseEnvironmentBaseKey, SystemEnvironmentBase).toInt()); @@ -355,26 +355,26 @@ void MaemoRunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env) } } -ProjectExplorer::Environment MaemoRunConfiguration::environment() const +Utils::Environment MaemoRunConfiguration::environment() const { - ProjectExplorer::Environment env = baseEnvironment(); + Utils::Environment env = baseEnvironment(); env.modify(userEnvironmentChanges()); return env; } -ProjectExplorer::Environment MaemoRunConfiguration::baseEnvironment() const +Utils::Environment MaemoRunConfiguration::baseEnvironment() const { return (m_baseEnvironmentBase == SystemEnvironmentBase ? systemEnvironment() - : ProjectExplorer::Environment()); + : Utils::Environment()); } -QList<ProjectExplorer::EnvironmentItem> MaemoRunConfiguration::userEnvironmentChanges() const +QList<Utils::EnvironmentItem> MaemoRunConfiguration::userEnvironmentChanges() const { return m_userEnvironmentChanges; } void MaemoRunConfiguration::setUserEnvironmentChanges( - const QList<ProjectExplorer::EnvironmentItem> &diff) + const QList<Utils::EnvironmentItem> &diff) { if (m_userEnvironmentChanges != diff) { m_userEnvironmentChanges = diff; @@ -382,12 +382,12 @@ void MaemoRunConfiguration::setUserEnvironmentChanges( } } -ProjectExplorer::Environment MaemoRunConfiguration::systemEnvironment() const +Utils::Environment MaemoRunConfiguration::systemEnvironment() const { return m_systemEnvironment; } -void MaemoRunConfiguration::setSystemEnvironment(const ProjectExplorer::Environment &environment) +void MaemoRunConfiguration::setSystemEnvironment(const Utils::Environment &environment) { if (m_systemEnvironment.size() == 0 || m_systemEnvironment != environment) { m_systemEnvironment = environment; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h index 5aee628d64c54623764cf3ffe3727ec683a12305..b25848b92a4168c9c6ee3051cdd5d00106a9e3f5 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h @@ -34,7 +34,8 @@ #include "maemodeviceconfigurations.h" #include "maemodeployable.h" -#include <projectexplorer/environment.h> +#include <utils/environment.h> + #include <projectexplorer/runconfiguration.h> #include <QtCore/QDateTime> @@ -106,14 +107,14 @@ public: BaseEnvironmentBase baseEnvironmentBase() const; void setBaseEnvironmentBase(BaseEnvironmentBase env); - ProjectExplorer::Environment environment() const; - ProjectExplorer::Environment baseEnvironment() const; + Utils::Environment environment() const; + Utils::Environment baseEnvironment() const; - QList<ProjectExplorer::EnvironmentItem> userEnvironmentChanges() const; - void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff); + QList<Utils::EnvironmentItem> userEnvironmentChanges() const; + void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); - ProjectExplorer::Environment systemEnvironment() const; - void setSystemEnvironment(const ProjectExplorer::Environment &environment); + Utils::Environment systemEnvironment() const; + void setSystemEnvironment(const Utils::Environment &environment); int portsUsedByDebuggers() const { return useCppDebugger() + useQmlDebugger(); } @@ -123,7 +124,7 @@ signals: void baseEnvironmentChanged(); void systemEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff); + void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); protected: MaemoRunConfiguration(Qt4Target *parent, MaemoRunConfiguration *source); @@ -146,8 +147,8 @@ private: bool m_useRemoteGdb; BaseEnvironmentBase m_baseEnvironmentBase; - ProjectExplorer::Environment m_systemEnvironment; - QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges; + Utils::Environment m_systemEnvironment; + QList<Utils::EnvironmentItem> m_userEnvironmentChanges; }; } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp index d732991918fcae8965a44a3f53d1930233027b21..4bc9cb34c6c1a7695fe4cc86da68fe81712092a7 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp @@ -263,8 +263,8 @@ void MaemoRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout) connect(m_runConfiguration, SIGNAL(systemEnvironmentChanged()), this, SLOT(systemEnvironmentChanged())); connect(m_runConfiguration, - SIGNAL(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)), - this, SLOT(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>))); + SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), + this, SLOT(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>))); connect(m_fetchEnv, SIGNAL(pressed()), this, SLOT(fetchEnvironment())); connect(m_deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished())); } @@ -421,7 +421,7 @@ void MaemoRunConfigurationWidget::systemEnvironmentChanged() m_environmentWidget->setBaseEnvironment(m_runConfiguration->systemEnvironment()); } -void MaemoRunConfigurationWidget::userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges) +void MaemoRunConfigurationWidget::userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges) { if (m_ignoreChange) return; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.h b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.h index e27bada08238dd665d6dd7f42762cda5423d3246..2fb92edefdeaffe8635d334ad3d371fc96d725f5 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.h @@ -49,9 +49,12 @@ class QToolButton; class QVBoxLayout; QT_END_NAMESPACE +namespace Utils { +class EnvironmentItem; +} + namespace ProjectExplorer { - struct EnvironmentItem; - class EnvironmentWidget; +class EnvironmentWidget; } namespace Utils { class DetailsWidget; } @@ -86,7 +89,7 @@ private slots: void baseEnvironmentSelected(int index); void baseEnvironmentChanged(); void systemEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges); + void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges); void handleRemoteMountsChanged(); void handleDebuggingTypeChanged(); void handleDeploySpecsChanged(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp index 974387473e987b933ee47fa263c4719bd6cadf67..1e320b8e961850a6176df17275f898489af247e8 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp @@ -54,7 +54,7 @@ ToolChain::ToolChainType MaemoToolChain::type() const return ToolChain::GCC_MAEMO; } -void MaemoToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void MaemoToolChain::addToEnvironment(Utils::Environment &env) { env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin") .arg(maddeRoot()))); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h index 71a0792ab293ac66a3e2e02a7985fea86dbf8471..7589b1e24256df194fc8075b7c75cb424b4948a5 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h @@ -42,7 +42,7 @@ public: MaemoToolChain(const QString &targetRoot); virtual ~MaemoToolChain(); - void addToEnvironment(ProjectExplorer::Environment &env); + void addToEnvironment(Utils::Environment &env); ProjectExplorer::ToolChain::ToolChainType type() const; QString makeCommand() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp index ea3d1b39f01bdb4363c92cc7e3854487a7d182c4..01bc3307d3b52410aa3ba2b7692e37588ccd56f8 100644 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp @@ -45,7 +45,7 @@ using namespace Qt4ProjectManager::Internal; // Locate the compiler via path. static QString gcceCommand(const QString &dir) { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); if (!dir.isEmpty()) { env.prependOrSetPath(dir + QLatin1String("/bin")); env.prependOrSetPath(dir); @@ -123,7 +123,7 @@ QList<HeaderPath> GCCEToolChain::systemHeaderPaths() return m_systemHeaderPaths; } -void GCCEToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void GCCEToolChain::addToEnvironment(Utils::Environment &env) { if (debug) qDebug() << "GCCEToolChain::addToEnvironment" << m_type << gcc() << m_gcceBinPath<< m_mixin.device(); @@ -170,7 +170,7 @@ QString GCCEToolChain::gcceVersion() const QProcess gxx; QStringList arguments; arguments << QLatin1String("-dumpversion"); - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); env.set(QLatin1String("LC_ALL"), QLatin1String("C")); //override current locale settings gxx.setEnvironment(env.toStringList()); gxx.setReadChannelMode(QProcess::MergedChannels); diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h index a701454c4899ac597863b3c13f8b33f04d76deb3..9ce1228a88c8d519c3e48dad2d2bc1bf364aeb70 100644 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h @@ -50,7 +50,7 @@ public: QByteArray predefinedMacros(); virtual QList<ProjectExplorer::HeaderPath> systemHeaderPaths(); - virtual void addToEnvironment(ProjectExplorer::Environment &env); + virtual void addToEnvironment(Utils::Environment &env); virtual ProjectExplorer::ToolChain::ToolChainType type() const; virtual QString makeCommand() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp index eaa7a0a4e75564a40015a23ee9ab376e0ebaa22f..b72a95637a785f9cfc7a50ea74e0029b1107d9b4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp @@ -117,7 +117,7 @@ void RVCTToolChain::updateVersion() m_minor = 0; m_build = 0; QProcess armcc; - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); armcc.setEnvironment(env.toStringList()); const QString binary = rvctBinary(); @@ -180,7 +180,7 @@ QList<HeaderPath> RVCTToolChain::systemHeaderPaths() { if (m_systemHeaderPaths.isEmpty()) { updateVersion(); - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); QString rvctInclude = env.value(QString::fromLatin1("RVCT%1%2INC").arg(m_major).arg(m_minor)); if (!rvctInclude.isEmpty()) m_systemHeaderPaths.append(HeaderPath(rvctInclude, HeaderPath::GlobalHeaderPath)); @@ -206,7 +206,7 @@ static inline QStringList headerPathToStringList(const QList<ProjectExplorer::He // Expand an RVCT variable, such as RVCT22BIN, by some new values void RVCTToolChain::addToRVCTPathVariable(const QString &postfix, const QStringList &values, - ProjectExplorer::Environment &env) const + Utils::Environment &env) const { // get old values const QChar separator = QLatin1Char(','); @@ -237,7 +237,7 @@ QStringList RVCTToolChain::libPaths() return rc; } -void RVCTToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void RVCTToolChain::addToEnvironment(Utils::Environment &env) { updateVersion(); switch (m_type) { diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h index fc985a983084e92325759be0326c2d59fcf508a2..d6481b80dda8a58f1420e15c140531cafd55ee68 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h @@ -44,7 +44,7 @@ public: ProjectExplorer::ToolChain::ToolChainType type); virtual QByteArray predefinedMacros(); QList<ProjectExplorer::HeaderPath> systemHeaderPaths(); - void addToEnvironment(ProjectExplorer::Environment &env); + void addToEnvironment(Utils::Environment &env); ProjectExplorer::ToolChain::ToolChainType type() const; QString makeCommand() const; ProjectExplorer::IOutputParser *outputParser() const; @@ -60,7 +60,7 @@ protected: private: void addToRVCTPathVariable(const QString &postfix, const QStringList &values, - ProjectExplorer::Environment &env) const; + Utils::Environment &env) const; static QStringList libPaths(); void updateVersion(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h index e69c8a8044d1870e46cfbcb9640559a168ccd0b1..8cdc5ecb91c2dd7bad4802b9352478b713cb8bb9 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h @@ -141,7 +141,7 @@ private: QStringList m_workingDirectories; QString m_makeCmd; - ProjectExplorer::Environment m_environment; + Utils::Environment m_environment; QStringList m_args; void ctor_package(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp index bf86f3fc341ff186ba7deedd31ca4984bf345522..3631c3bf577e30a28422b985f92745f4635f26ac 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp @@ -30,7 +30,8 @@ #include "s60devices.h" #include "gccetoolchain.h" -#include <projectexplorer/environment.h> +#include <utils/environment.h> + #include <coreplugin/icore.h> #include <QtCore/QSettings> @@ -563,7 +564,7 @@ QList<ProjectExplorer::HeaderPath> S60ToolChainMixin::epocHeaderPaths() const return rc; } -void S60ToolChainMixin::addEpocToEnvironment(ProjectExplorer::Environment *env) const +void S60ToolChainMixin::addEpocToEnvironment(Utils::Environment *env) const { QString epocRootPath(m_device.epocRoot); if (!epocRootPath.endsWith(QChar('/'))) @@ -615,7 +616,7 @@ QList<ProjectExplorer::HeaderPath> S60ToolChainMixin::gnuPocRvctHeaderPaths(int return rc; } -void S60ToolChainMixin::addGnuPocToEnvironment(ProjectExplorer::Environment *env) const +void S60ToolChainMixin::addGnuPocToEnvironment(Utils::Environment *env) const { env->prependOrSetPath(QDir::toNativeSeparators(m_device.toolsRoot + QLatin1String("/epoc32/tools"))); const QString epocRootVar = QLatin1String("EPOCROOT"); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devices.h b/src/plugins/qt4projectmanager/qt-s60/s60devices.h index 076c81184c2c435a49bc8c1396f704635f3c67af..69d2a1a5e1e3995a984c02525e6f488173ab1b8b 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devices.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devices.h @@ -176,13 +176,13 @@ public: // Epoc QList<ProjectExplorer::HeaderPath> epocHeaderPaths() const; - void addEpocToEnvironment(ProjectExplorer::Environment *env) const; + void addEpocToEnvironment(Utils::Environment *env) const; // GnuPoc QList<ProjectExplorer::HeaderPath> gnuPocHeaderPaths() const; QList<ProjectExplorer::HeaderPath> gnuPocRvctHeaderPaths(int major, int minor) const; QStringList gnuPocRvctLibPaths(int armver, bool debug) const; - void addGnuPocToEnvironment(ProjectExplorer::Environment *env) const; + void addGnuPocToEnvironment(Utils::Environment *env) const; bool equals(const S60ToolChainMixin &rhs) const; diff --git a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp index 7ffcdfb9840a4c1575bdc1b634f98601a519d396..3ffa86e413c6ce9e7961342e2020f89318ed171e 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp @@ -296,7 +296,7 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon : RunControl(runConfiguration, mode) { // stuff like the EPOCROOT and EPOCDEVICE env variable - Environment env = Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); runConfiguration->qt4Target()->activeBuildConfiguration()->toolChain()->addToEnvironment(env); m_applicationLauncher.setEnvironment(env.toStringList()); diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp index 89d0a357291c24634232c671caa31d3d3c596b06..5765fc1a55294aa5a43f93e1d406f8238aa55683 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp @@ -71,7 +71,7 @@ QList<HeaderPath> WINSCWToolChain::systemHeaderPaths() QStringList WINSCWToolChain::systemIncludes() const { if (m_carbidePath.isEmpty()) { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); QString symIncludesValue = env.value("MWCSYM2INCLUDES"); if (!symIncludesValue.isEmpty()) return symIncludesValue.split(QLatin1Char(';')); @@ -91,7 +91,7 @@ QStringList WINSCWToolChain::systemIncludes() const return QStringList(); } -void WINSCWToolChain::addToEnvironment(ProjectExplorer::Environment &env) +void WINSCWToolChain::addToEnvironment(Utils::Environment &env) { if (!m_carbidePath.isEmpty()) { env.set("MWCSYM2INCLUDES", systemIncludes().join(QString(QLatin1Char(';')))); diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h index 8f5fbab5fca3fc368d393166e83559f584e20ccf..27edf0b53cf79890b529e556e8f088308a66d561 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h @@ -43,7 +43,7 @@ public: explicit WINSCWToolChain(const S60Devices::Device &device, const QString &mwcDirectory); QByteArray predefinedMacros(); QList<ProjectExplorer::HeaderPath> systemHeaderPaths(); - void addToEnvironment(ProjectExplorer::Environment &env); + void addToEnvironment(Utils::Environment &env); ProjectExplorer::ToolChain::ToolChainType type() const; QString makeCommand() const; ProjectExplorer::IOutputParser *outputParser() const; diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp index 0517dd06a868fba380fbb5010feee37face0d81b..1b783a7233814ac94af4969a0f8104e093e474e0 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp @@ -194,9 +194,9 @@ Qt4Target *Qt4BuildConfiguration::qt4Target() const return static_cast<Qt4Target *>(target()); } -ProjectExplorer::Environment Qt4BuildConfiguration::baseEnvironment() const +Utils::Environment Qt4BuildConfiguration::baseEnvironment() const { - Environment env = BuildConfiguration::baseEnvironment(); + Utils::Environment env = BuildConfiguration::baseEnvironment(); qtVersion()->addToEnvironment(env); env.set(QLatin1String("BUILDDIR"), QDir::toNativeSeparators(buildDirectory())); diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.h b/src/plugins/qt4projectmanager/qt4buildconfiguration.h index 849e0852eee8790e5be393a347f022670d98bd5a..135518558c3bdaee96a3c1081d62af88170c54a3 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.h +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.h @@ -56,7 +56,7 @@ public: Qt4Target *qt4Target() const; - virtual ProjectExplorer::Environment baseEnvironment() const; + virtual Utils::Environment baseEnvironment() const; virtual QString buildDirectory() const; bool shadowBuild() const; diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index 0c672b209135004c7c221e522295dcdea0a27b14..1ab6c4c0412c3e53bc0afedf4b2658dffbe00148 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -201,7 +201,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run toplayout->addRow(tr("Executable:"), m_executableLineEdit); QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this); - m_argumentsLineEdit = new QLineEdit(ProjectExplorer::Environment::joinArgumentList(qt4RunConfiguration->commandLineArguments()), this); + m_argumentsLineEdit = new QLineEdit(Utils::Environment::joinArgumentList(qt4RunConfiguration->commandLineArguments()), this); argumentsLabel->setBuddy(m_argumentsLineEdit); toplayout->addRow(argumentsLabel, m_argumentsLineEdit); @@ -313,8 +313,8 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run connect(qt4RunConfiguration, SIGNAL(effectiveTargetInformationChanged()), this, SLOT(effectiveTargetInformationChanged()), Qt::QueuedConnection); - connect(qt4RunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)), - this, SLOT(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>))); + connect(qt4RunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), + this, SLOT(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>))); connect(qt4RunConfiguration, SIGNAL(baseEnvironmentChanged()), this, SLOT(baseEnvironmentChanged())); @@ -359,7 +359,7 @@ void Qt4RunConfigurationWidget::baseEnvironmentChanged() m_environmentWidget->setBaseEnvironmentText(m_qt4RunConfiguration->baseEnvironmentText()); } -void Qt4RunConfigurationWidget::userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges) +void Qt4RunConfigurationWidget::userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges) { if (m_ignoreChange) return; @@ -473,7 +473,7 @@ QVariantMap Qt4RunConfiguration::toMap() const map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath)); map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); map.insert(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), m_isUsingDyldImageSuffix); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges)); + map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), m_baseEnvironmentBase); map.insert(QLatin1String(USER_SET_WORKING_DIRECTORY_KEY), m_userSetWokingDirectory); map.insert(QLatin1String(USER_WORKING_DIRECTORY_KEY), m_userWorkingDirectory); @@ -491,7 +491,7 @@ bool Qt4RunConfiguration::fromMap(const QVariantMap &map) m_userSetWokingDirectory = map.value(QLatin1String(USER_SET_WORKING_DIRECTORY_KEY), false).toBool(); m_userWorkingDirectory = map.value(QLatin1String(USER_WORKING_DIRECTORY_KEY)).toString(); - m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); + m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(Qt4RunConfiguration::BuildEnvironmentBase)).toInt()); return RunConfiguration::fromMap(map); @@ -552,13 +552,13 @@ QString Qt4RunConfiguration::baseEnvironmentText() const return QString(); } -ProjectExplorer::Environment Qt4RunConfiguration::baseEnvironment() const +Utils::Environment Qt4RunConfiguration::baseEnvironment() const { - ProjectExplorer::Environment env; + Utils::Environment env; if (m_baseEnvironmentBase == Qt4RunConfiguration::CleanEnvironmentBase) { // Nothing } else if (m_baseEnvironmentBase == Qt4RunConfiguration::SystemEnvironmentBase) { - env = ProjectExplorer::Environment::systemEnvironment(); + env = Utils::Environment::systemEnvironment(); } else if (m_baseEnvironmentBase == Qt4RunConfiguration::BuildEnvironmentBase) { env = target()->activeBuildConfiguration()->environment(); } @@ -578,19 +578,19 @@ ProjectExplorer::Environment Qt4RunConfiguration::baseEnvironment() const return env; } -ProjectExplorer::Environment Qt4RunConfiguration::environment() const +Utils::Environment Qt4RunConfiguration::environment() const { - ProjectExplorer::Environment env = baseEnvironment(); + Utils::Environment env = baseEnvironment(); env.modify(userEnvironmentChanges()); return env; } -QList<ProjectExplorer::EnvironmentItem> Qt4RunConfiguration::userEnvironmentChanges() const +QList<Utils::EnvironmentItem> Qt4RunConfiguration::userEnvironmentChanges() const { return m_userEnvironmentChanges; } -void Qt4RunConfiguration::setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff) +void Qt4RunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) { if (m_userEnvironmentChanges != diff) { m_userEnvironmentChanges = diff; @@ -613,7 +613,7 @@ void Qt4RunConfiguration::setWorkingDirectory(const QString &wd) void Qt4RunConfiguration::setArguments(const QString &argumentsString) { - m_commandLineArguments = ProjectExplorer::Environment::parseCombinedArgString(argumentsString); + m_commandLineArguments = Utils::Environment::parseCombinedArgString(argumentsString); emit commandLineArgumentsChanged(argumentsString); } diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt4runconfiguration.h index 9c4903404cdcb0734f13f9e01c52bc5df8bb0aa7..92db66160056f166c8e3d8bf66b639171f7c6aab 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.h @@ -81,7 +81,7 @@ public: virtual RunMode runMode() const; virtual QString workingDirectory() const; virtual QStringList commandLineArguments() const; - virtual ProjectExplorer::Environment environment() const; + virtual Utils::Environment environment() const; virtual QString dumperLibrary() const; virtual QStringList dumperLibraryLocations() const; virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const; @@ -102,7 +102,7 @@ signals: void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); void usingDyldImageSuffixChanged(bool); void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff); + void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); // Note: These signals might not get emitted for every change! void effectiveTargetInformationChanged(); @@ -127,10 +127,10 @@ private: void ctor(); - ProjectExplorer::Environment baseEnvironment() const; + Utils::Environment baseEnvironment() const; QString baseEnvironmentText() const; - void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff); - QList<ProjectExplorer::EnvironmentItem> userEnvironmentChanges() const; + void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); + QList<Utils::EnvironmentItem> userEnvironmentChanges() const; void updateTarget(); QStringList m_commandLineArguments; @@ -142,7 +142,7 @@ private: bool m_isUsingDyldImageSuffix; bool m_userSetWokingDirectory; QString m_userWorkingDirectory; - QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges; + QList<Utils::EnvironmentItem> m_userEnvironmentChanges; BaseEnvironmentBase m_baseEnvironmentBase; }; @@ -166,7 +166,7 @@ private slots: void workingDirectoryChanged(const QString &workingDirectory); void commandLineArgumentsChanged(const QString &args); void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); - void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges); + void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges); void baseEnvironmentChanged(); void effectiveTargetInformationChanged(); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index c0fa67a0af049254f026c7971f785aced783d4b1..ed03e55b96f378d0a294ea60feb8679b3c218f4f 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -391,7 +391,7 @@ void QtVersionManager::addNewVersionsFromInstaller() void QtVersionManager::updateSystemVersion() { bool haveSystemVersion = false; - QString systemQMakePath = DebuggingHelperLibrary::findSystemQt(ProjectExplorer::Environment::systemEnvironment()); + QString systemQMakePath = DebuggingHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment()); if (systemQMakePath.isNull()) systemQMakePath = tr("<not found>"); @@ -1452,7 +1452,7 @@ void QtVersion::updateToolChainAndMkspec() const ProjectExplorer::ToolChain::createMSVCToolChain(m_msvcVersion, isQt64Bit())); m_targetIds.insert(QLatin1String(Constants::DESKTOP_TARGET_ID)); } else if (qmakeCXX == "g++" && makefileGenerator == "MINGW") { - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); //addToEnvironment(env); env.prependOrSetPath(mingwDirectory() + "/bin"); qmakeCXX = env.searchInPath(qmakeCXX); @@ -1461,7 +1461,7 @@ void QtVersion::updateToolChainAndMkspec() const m_targetIds.insert(QLatin1String(Constants::DESKTOP_TARGET_ID)); } else if (qmakeCXX.contains("g++")) { // All g++ variants are treated as desktop g++ // we should try to do a better job, but for now that's good enough - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); //addToEnvironment(env); qmakeCXX = env.searchInPath(qmakeCXX); m_toolChains << ToolChainPtr(ProjectExplorer::ToolChain::createGccToolChain(qmakeCXX)); @@ -1549,7 +1549,7 @@ void QtVersion::setMsvcVersion(const QString &version) m_toolChainUpToDate = false; } -void QtVersion::addToEnvironment(ProjectExplorer::Environment &env) const +void QtVersion::addToEnvironment(Utils::Environment &env) const { env.set("QTDIR", QDir::toNativeSeparators(versionInfo().value("QT_INSTALL_DATA"))); env.prependOrSetPath(versionInfo().value("QT_INSTALL_BINS")); @@ -1707,7 +1707,7 @@ QString QtVersion::buildDebuggingHelperLibrary() QString qtInstallData = versionInfo().value("QT_INSTALL_DATA"); if (qtInstallData.isEmpty()) return QString(); - ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); + Utils::Environment env = Utils::Environment::systemEnvironment(); addToEnvironment(env); // TODO: the debugging helper doesn't comply to actual tool chain yet diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index 2352119767422ea434f1dd84f1473ae8a2eabcf0..2ce5a6fbc359b1b9609bb6fc4711795b90af40be 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -107,7 +107,7 @@ public: void setMingwDirectory(const QString &directory); QString msvcVersion() const; void setMsvcVersion(const QString &version); - void addToEnvironment(ProjectExplorer::Environment &env) const; + void addToEnvironment(Utils::Environment &env) const; bool hasDebuggingHelper() const; QString debuggingHelperLibrary() const;