diff --git a/src/plugins/remotelinux/abstractremotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/abstractremotelinuxrunconfiguration.cpp new file mode 100644 index 00000000000..5367360edfa --- /dev/null +++ b/src/plugins/remotelinux/abstractremotelinuxrunconfiguration.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Canonical Ltd. +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +#include "abstractremotelinuxrunconfiguration.h" + +namespace RemoteLinux { + +AbstractRemoteLinuxRunConfiguration::AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, + Core::Id id): RunConfiguration(parent, id) +{ + +} + +AbstractRemoteLinuxRunConfiguration::~AbstractRemoteLinuxRunConfiguration() +{ + +} + +AbstractRemoteLinuxRunConfiguration::AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, + AbstractRemoteLinuxRunConfiguration *source): RunConfiguration(parent, source) +{ + +} + +} // namespace RemoteLinux diff --git a/src/plugins/remotelinux/abstractremotelinuxrunconfiguration.h b/src/plugins/remotelinux/abstractremotelinuxrunconfiguration.h new file mode 100644 index 00000000000..a9fdbeec51a --- /dev/null +++ b/src/plugins/remotelinux/abstractremotelinuxrunconfiguration.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Canonical Ltd. +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +#ifndef REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H +#define REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H + +#include "remotelinux_export.h" +#include + +QT_FORWARD_DECLARE_CLASS(QStringList) + +namespace Utils { class Environment; } + +namespace RemoteLinux { + +class REMOTELINUX_EXPORT AbstractRemoteLinuxRunConfiguration : + public ProjectExplorer::RunConfiguration +{ + Q_OBJECT + Q_DISABLE_COPY(AbstractRemoteLinuxRunConfiguration) + +public: + AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, Core::Id id); + + ~AbstractRemoteLinuxRunConfiguration(); + + virtual QString localExecutableFilePath() const = 0; + virtual QString remoteExecutableFilePath() const = 0; + virtual QStringList arguments() const = 0; + virtual QString workingDirectory() const = 0; + virtual Utils::Environment environment() const = 0; + +protected: + AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, + AbstractRemoteLinuxRunConfiguration *source); +}; + +} // namespace RemoteLinux + +#endif // REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp index c221b1ad68c..edd424af00c 100644 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp @@ -28,7 +28,7 @@ ****************************************************************************/ #include "abstractremotelinuxrunsupport.h" -#include "remotelinuxrunconfiguration.h" +#include "abstractremotelinuxrunconfiguration.h" #include #include @@ -45,7 +45,7 @@ namespace Internal { class AbstractRemoteLinuxRunSupportPrivate { public: - AbstractRemoteLinuxRunSupportPrivate(const RemoteLinuxRunConfiguration *runConfig) + AbstractRemoteLinuxRunSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig) : state(AbstractRemoteLinuxRunSupport::Inactive), device(DeviceKitInformation::device(runConfig->target()->kit())), remoteFilePath(runConfig->remoteExecutableFilePath()), @@ -70,7 +70,7 @@ public: using namespace Internal; -AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(RemoteLinuxRunConfiguration *runConfig, QObject *parent) +AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(AbstractRemoteLinuxRunConfiguration *runConfig, QObject *parent) : QObject(parent), d(new AbstractRemoteLinuxRunSupportPrivate(runConfig)) { diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h index 7daa30ceb21..be805f41e33 100644 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h +++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h @@ -42,7 +42,7 @@ namespace Utils { class Environment; } namespace RemoteLinux { -class RemoteLinuxRunConfiguration; +class AbstractRemoteLinuxRunConfiguration; namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; } @@ -58,7 +58,7 @@ protected: Running }; public: - AbstractRemoteLinuxRunSupport(RemoteLinuxRunConfiguration *runConfig, + AbstractRemoteLinuxRunSupport(AbstractRemoteLinuxRunConfiguration *runConfig, QObject *parent = 0); ~AbstractRemoteLinuxRunSupport(); diff --git a/src/plugins/remotelinux/remotelinux.pro b/src/plugins/remotelinux/remotelinux.pro index 2840dbfa877..e511ac36b97 100644 --- a/src/plugins/remotelinux/remotelinux.pro +++ b/src/plugins/remotelinux/remotelinux.pro @@ -10,6 +10,7 @@ HEADERS += \ remotelinuxplugin.h \ remotelinux_export.h \ linuxdevice.h \ + abstractremotelinuxrunconfiguration.h \ remotelinuxrunconfiguration.h \ publickeydeploymentdialog.h \ genericlinuxdeviceconfigurationwizard.h \ @@ -56,6 +57,7 @@ SOURCES += \ remotelinuxenvironmentaspectwidget.cpp \ remotelinuxplugin.cpp \ linuxdevice.cpp \ + abstractremotelinuxrunconfiguration.cpp \ remotelinuxrunconfiguration.cpp \ publickeydeploymentdialog.cpp \ genericlinuxdeviceconfigurationwizard.cpp \ diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index 48d22815448..3f661787f22 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -25,6 +25,8 @@ QtcPlugin { "abstractremotelinuxdeploystep.h", "abstractremotelinuxrunsupport.cpp", "abstractremotelinuxrunsupport.h", + "abstractremotelinuxrunconfiguration.h", + "abstractremotelinuxrunconfiguration.cpp", "abstractuploadandinstallpackageservice.cpp", "abstractuploadandinstallpackageservice.h", "embeddedlinuxqtversion.cpp", @@ -109,7 +111,7 @@ QtcPlugin { "typespecificdeviceconfigurationlistmodel.h", "uploadandinstalltarpackagestep.cpp", "uploadandinstalltarpackagestep.h", - "images/embeddedtarget.png", + "images/embeddedtarget.png" ] Export { diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp index d72d455b4d4..0ccae8ae7bb 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp @@ -73,7 +73,7 @@ public: using namespace Internal; -AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig, +AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig, RunMode runMode) { AnalyzerStartParameters params; @@ -88,7 +88,7 @@ AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RemoteL return params; } -RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(RemoteLinuxRunConfiguration *runConfig, +RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig, AnalyzerRunControl *engine, RunMode runMode) : AbstractRemoteLinuxRunSupport(runConfig, engine), d(new RemoteLinuxAnalyzeSupportPrivate(engine, runMode)) diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.h b/src/plugins/remotelinux/remotelinuxanalyzesupport.h index 0d515dba31f..82b0b00b882 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.h +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.h @@ -41,7 +41,7 @@ class AnalyzerRunControl; } namespace RemoteLinux { -class RemoteLinuxRunConfiguration; +class AbstractRemoteLinuxRunConfiguration; namespace Internal { class RemoteLinuxAnalyzeSupportPrivate; } @@ -49,10 +49,10 @@ class REMOTELINUX_EXPORT RemoteLinuxAnalyzeSupport : public AbstractRemoteLinuxR { Q_OBJECT public: - static Analyzer::AnalyzerStartParameters startParameters(const RemoteLinuxRunConfiguration *runConfig, + static Analyzer::AnalyzerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig, ProjectExplorer::RunMode runMode); - RemoteLinuxAnalyzeSupport(RemoteLinuxRunConfiguration *runConfig, + RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig, Analyzer::AnalyzerRunControl *engine, ProjectExplorer::RunMode runMode); ~RemoteLinuxAnalyzeSupport(); diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 805fbed6af5..f5264d1844f 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -55,7 +55,7 @@ namespace Internal { class LinuxDeviceDebugSupportPrivate { public: - LinuxDeviceDebugSupportPrivate(const RemoteLinuxRunConfiguration *runConfig, + LinuxDeviceDebugSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig, DebuggerEngine *engine) : engine(engine), qmlDebugging(runConfig->extraAspect()->useQmlDebugger()), @@ -76,7 +76,7 @@ public: using namespace Internal; -DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig) +DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig) { DebuggerStartParameters params; Target *target = runConfig->target(); @@ -118,10 +118,10 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const RemoteLin return params; } -LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RemoteLinuxRunConfiguration *runConfig, +LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig, DebuggerEngine *engine) : AbstractRemoteLinuxRunSupport(runConfig, engine), - d(new LinuxDeviceDebugSupportPrivate(static_cast(runConfig), engine)) + d(new LinuxDeviceDebugSupportPrivate(static_cast(runConfig), engine)) { connect(d->engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested())); } diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.h b/src/plugins/remotelinux/remotelinuxdebugsupport.h index 250daddbce3..fee405067e9 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.h +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.h @@ -38,7 +38,7 @@ class DebuggerStartParameters; } namespace RemoteLinux { -class RemoteLinuxRunConfiguration; +class AbstractRemoteLinuxRunConfiguration; namespace Internal { class LinuxDeviceDebugSupportPrivate; } @@ -46,9 +46,9 @@ class REMOTELINUX_EXPORT LinuxDeviceDebugSupport : public AbstractRemoteLinuxRun { Q_OBJECT public: - static Debugger::DebuggerStartParameters startParameters(const RemoteLinuxRunConfiguration *runConfig); + static Debugger::DebuggerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig); - LinuxDeviceDebugSupport(RemoteLinuxRunConfiguration *runConfig, + LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig, Debugger::DebuggerEngine *engine); ~LinuxDeviceDebugSupport(); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index e9c1935d8fc..d06c6d88134 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -73,9 +73,9 @@ Utils::Environment RemoteLinuxEnvironmentAspect::baseEnvironment() const return Utils::Environment(); } -RemoteLinuxRunConfiguration *RemoteLinuxEnvironmentAspect::runConfiguration() const +AbstractRemoteLinuxRunConfiguration *RemoteLinuxEnvironmentAspect::runConfiguration() const { - return qobject_cast(EnvironmentAspect::runConfiguration()); + return qobject_cast(EnvironmentAspect::runConfiguration()); } Utils::Environment RemoteLinuxEnvironmentAspect::remoteEnvironment() const diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index ec50479adc1..5cb34b453dc 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -30,7 +30,7 @@ #ifndef REMOTELINUXENVIRONMENTASPECT_H #define REMOTELINUXENVIRONMENTASPECT_H -#include "remotelinuxrunconfiguration.h" +#include "abstractremotelinuxrunconfiguration.h" #include "remotelinux_export.h" @@ -38,7 +38,7 @@ namespace RemoteLinux { class RemoteLinuxEnvironmentAspectWidget; -class RemoteLinuxRunConfiguration; +class AbstractRemoteLinuxRunConfiguration; class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer::EnvironmentAspect { @@ -53,7 +53,7 @@ public: QString baseEnvironmentDisplayName(int base) const; Utils::Environment baseEnvironment() const; - RemoteLinuxRunConfiguration *runConfiguration() const; + AbstractRemoteLinuxRunConfiguration *runConfiguration() const; Utils::Environment remoteEnvironment() const; void setRemoteEnvironment(const Utils::Environment &env); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 90bfa3123ea..460b53f6d07 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -84,7 +84,7 @@ using namespace Internal; RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *parent, const Core::Id id, const QString &proFilePath) - : RunConfiguration(parent, id), + : AbstractRemoteLinuxRunConfiguration(parent, id), d(new RemoteLinuxRunConfigurationPrivate(proFilePath)) { init(); @@ -92,7 +92,7 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *parent, const C RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, RemoteLinuxRunConfiguration *source) - : RunConfiguration(parent, source), + : AbstractRemoteLinuxRunConfiguration(parent, source), d(new RemoteLinuxRunConfigurationPrivate(source->d)) { init(); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.h b/src/plugins/remotelinux/remotelinuxrunconfiguration.h index 7aaa83c68ef..4f48dcccf81 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.h +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.h @@ -31,6 +31,7 @@ #define REMOTELINUXRUNCONFIGURATION_H #include "remotelinux_export.h" +#include "abstractremotelinuxrunconfiguration.h" #include @@ -50,7 +51,7 @@ class RemoteLinuxRunConfigurationPrivate; class RemoteLinuxRunConfigurationFactory; } // namespace Internal -class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration +class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public AbstractRemoteLinuxRunConfiguration { Q_OBJECT Q_DISABLE_COPY(RemoteLinuxRunConfiguration) diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.cpp b/src/plugins/remotelinux/remotelinuxruncontrol.cpp index cae83697547..9a1141f167e 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrol.cpp @@ -29,7 +29,7 @@ #include "remotelinuxruncontrol.h" -#include "remotelinuxrunconfiguration.h" +#include "abstractremotelinuxrunconfiguration.h" #include #include @@ -60,7 +60,7 @@ RemoteLinuxRunControl::RemoteLinuxRunControl(RunConfiguration *rc) { d->running = false; d->device = DeviceKitInformation::device(rc->target()->kit()); - const RemoteLinuxRunConfiguration * const lrc = qobject_cast(rc); + const AbstractRemoteLinuxRunConfiguration * const lrc = qobject_cast(rc); d->remoteExecutable = lrc->remoteExecutableFilePath(); d->arguments = lrc->arguments(); d->environment = lrc->environment(); diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.cpp b/src/plugins/valgrind/valgrindruncontrolfactory.cpp index fe4f62b573d..e3f0d925b12 100644 --- a/src/plugins/valgrind/valgrindruncontrolfactory.cpp +++ b/src/plugins/valgrind/valgrindruncontrolfactory.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -94,8 +94,8 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration sp.connParams.host = server.serverAddress().toString(); sp.connParams.port = server.serverPort(); sp.startMode = StartLocal; - } else if (RemoteLinux::RemoteLinuxRunConfiguration *rc2 = - qobject_cast(runConfiguration)) { + } else if (RemoteLinux::AbstractRemoteLinuxRunConfiguration *rc2 = + qobject_cast(runConfiguration)) { sp.startMode = StartRemote; sp.debuggee = rc2->remoteExecutableFilePath(); sp.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters();