diff options
author | hjk <hjk@qt.io> | 2019-03-07 09:08:40 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-03-07 16:06:46 +0000 |
commit | ac1b0facc0dd91c5551c4bd1f36c16fe388aa541 (patch) | |
tree | 71b4cb83bfce2ef64bd12b205f39194e279fb3cd /src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.cpp | |
parent | 2f02dcf994d7ef29ba3bbaa97c827db2d7d6bf63 (diff) | |
download | qt-creator-ac1b0facc0dd91c5551c4bd1f36c16fe388aa541.tar.gz |
ProjectExplorer: De-virtualize EnvironmentAspect::baseEnvironment
Will help to streamline *EnvironmentAspect constructor signature,
which in turn will help to have a generic cloning mechanism to
clone aspect data, which in turn will help to finally execute on
the idea that RunControls should be re-runnable in their original
setup and also resilient to changes in the setup while they are
running.
Change-Id: Ibdaca487c1f7ce043e675fd014fe923a70273639
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.cpp')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.cpp | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.cpp b/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.cpp deleted file mode 100644 index 2502747f2e..0000000000 --- a/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "qmlprojectenvironmentaspect.h" - -#include "qmlproject.h" - -#include <projectexplorer/kit.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/target.h> - -using namespace ProjectExplorer; -using namespace Utils; - -namespace QmlProjectManager { - -enum BaseEnvironmentBase { - SystemEnvironmentBase = 0, - CleanEnvironmentBase -}; - -Environment QmlProjectEnvironmentAspect::baseEnvironment() const -{ - Environment env = baseEnvironmentBase() == SystemEnvironmentBase - ? Environment::systemEnvironment() - : Environment(); - - if (auto project = qobject_cast<const QmlProject *>(m_target->project())) - env.modify(project->environment()); - - return env; -} - -QmlProjectEnvironmentAspect::QmlProjectEnvironmentAspect(Target *target) - : m_target(target) -{ - if (DeviceTypeKitAspect::deviceTypeId(target->kit()) - == Constants::DESKTOP_DEVICE_TYPE) - addPreferredBaseEnvironment(SystemEnvironmentBase, tr("System Environment")); - - addSupportedBaseEnvironment(CleanEnvironmentBase, tr("Clean Environment")); -} - -} // namespace QmlProjectManager |