forked from qt-creator/qt-creator
RemoteLinux: Modernize
modernize-* Change-Id: Ifdf0e781c63941625ca032a8e1752082f4abc3ce Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -74,7 +74,7 @@ AbstractPackagingStep::~AbstractPackagingStep()
|
||||
void AbstractPackagingStep::handleBuildConfigurationChanged()
|
||||
{
|
||||
if (d->currentBuildConfiguration)
|
||||
disconnect(d->currentBuildConfiguration, 0, this, 0);
|
||||
disconnect(d->currentBuildConfiguration, nullptr, this, nullptr);
|
||||
d->currentBuildConfiguration = buildConfiguration();
|
||||
if (d->currentBuildConfiguration) {
|
||||
connect(d->currentBuildConfiguration, &BuildConfiguration::buildDirectoryChanged,
|
||||
|
||||
@@ -51,16 +51,13 @@ enum State { Inactive, SettingUpDevice, Connecting, Deploying };
|
||||
class AbstractRemoteLinuxDeployServicePrivate
|
||||
{
|
||||
public:
|
||||
AbstractRemoteLinuxDeployServicePrivate()
|
||||
: connection(0), state(Inactive), stopRequested(false) {}
|
||||
|
||||
IDevice::ConstPtr deviceConfiguration;
|
||||
QPointer<Target> target;
|
||||
|
||||
DeploymentTimeInfo deployTimes;
|
||||
SshConnection *connection;
|
||||
State state;
|
||||
bool stopRequested;
|
||||
SshConnection *connection = nullptr;
|
||||
State state = Inactive;
|
||||
bool stopRequested = false;
|
||||
};
|
||||
} // namespace Internal
|
||||
|
||||
@@ -260,9 +257,9 @@ void AbstractRemoteLinuxDeployService::setFinished()
|
||||
{
|
||||
d->state = Inactive;
|
||||
if (d->connection) {
|
||||
disconnect(d->connection, 0, this, 0);
|
||||
disconnect(d->connection, nullptr, this, nullptr);
|
||||
QSsh::releaseConnection(d->connection);
|
||||
d->connection = 0;
|
||||
d->connection = nullptr;
|
||||
}
|
||||
d->stopRequested = false;
|
||||
emit finished();
|
||||
|
||||
@@ -144,7 +144,7 @@ void AbstractRemoteLinuxDeployStep::handleFinished()
|
||||
emit addOutput(tr("Deploy step failed."), OutputFormat::ErrorMessage);
|
||||
else
|
||||
emit addOutput(tr("Deploy step finished."), OutputFormat::NormalMessage);
|
||||
disconnect(deployService(), 0, this, 0);
|
||||
disconnect(deployService(), nullptr, this, nullptr);
|
||||
reportRunResult(d->future, !d->hasError);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,8 +176,8 @@ void AbstractUploadAndInstallPackageService::handleInstallationFinished(const QS
|
||||
void AbstractUploadAndInstallPackageService::setFinished()
|
||||
{
|
||||
d->state = Inactive;
|
||||
disconnect(d->uploader, 0, this, 0);
|
||||
disconnect(packageInstaller(), 0, this, 0);
|
||||
disconnect(d->uploader, nullptr, this, nullptr);
|
||||
disconnect(packageInstaller(), nullptr, this, nullptr);
|
||||
handleDeploymentDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
protected:
|
||||
explicit AbstractUploadAndInstallPackageService(QObject *parent);
|
||||
~AbstractUploadAndInstallPackageService();
|
||||
~AbstractUploadAndInstallPackageService() override;
|
||||
|
||||
QString packageFilePath() const;
|
||||
|
||||
@@ -53,11 +53,11 @@ private:
|
||||
virtual AbstractRemoteLinuxPackageInstaller *packageInstaller() const = 0;
|
||||
virtual QString uploadDir() const; // Defaults to remote user's home directory.
|
||||
|
||||
bool isDeploymentNecessary() const;
|
||||
void doDeviceSetup();
|
||||
void stopDeviceSetup();
|
||||
void doDeploy();
|
||||
void stopDeployment();
|
||||
bool isDeploymentNecessary() const override;
|
||||
void doDeviceSetup() override;
|
||||
void stopDeviceSetup() override;
|
||||
void doDeploy() override;
|
||||
void stopDeployment() override;
|
||||
|
||||
void setFinished();
|
||||
|
||||
|
||||
@@ -35,16 +35,16 @@ class EmbeddedLinuxQtVersion : public QtSupport::BaseQtVersion
|
||||
public:
|
||||
EmbeddedLinuxQtVersion() = default;
|
||||
EmbeddedLinuxQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
|
||||
~EmbeddedLinuxQtVersion() = default;
|
||||
EmbeddedLinuxQtVersion *clone() const;
|
||||
~EmbeddedLinuxQtVersion() override = default;
|
||||
EmbeddedLinuxQtVersion *clone() const override;
|
||||
|
||||
QString type() const;
|
||||
QString type() const override;
|
||||
|
||||
QList<ProjectExplorer::Abi> detectQtAbis() const;
|
||||
QList<ProjectExplorer::Abi> detectQtAbis() const override;
|
||||
|
||||
QString description() const;
|
||||
QString description() const override;
|
||||
|
||||
QSet<Core::Id> targetDeviceTypes() const;
|
||||
QSet<Core::Id> targetDeviceTypes() const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -36,8 +36,7 @@ namespace Internal {
|
||||
EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory(QObject *parent) : QtSupport::QtVersionFactory(parent)
|
||||
{ }
|
||||
|
||||
EmbeddedLinuxQtVersionFactory::~EmbeddedLinuxQtVersionFactory()
|
||||
{ }
|
||||
EmbeddedLinuxQtVersionFactory::~EmbeddedLinuxQtVersionFactory() = default;
|
||||
|
||||
bool EmbeddedLinuxQtVersionFactory::canRestore(const QString &type)
|
||||
{
|
||||
@@ -47,8 +46,8 @@ bool EmbeddedLinuxQtVersionFactory::canRestore(const QString &type)
|
||||
QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::restore(const QString &type, const QVariantMap &data)
|
||||
{
|
||||
if (!canRestore(type))
|
||||
return 0;
|
||||
EmbeddedLinuxQtVersion *v = new EmbeddedLinuxQtVersion;
|
||||
return nullptr;
|
||||
auto v = new EmbeddedLinuxQtVersion;
|
||||
v->fromMap(data);
|
||||
return v;
|
||||
}
|
||||
@@ -67,9 +66,9 @@ QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::create(const Utils::Fil
|
||||
|
||||
QFileInfo fi = qmakePath.toFileInfo();
|
||||
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
EmbeddedLinuxQtVersion *version = new EmbeddedLinuxQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
||||
auto version = new EmbeddedLinuxQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
||||
|
||||
QList<ProjectExplorer::Abi> abis = version->qtAbis();
|
||||
// Note: This fails for e.g. intel/meego cross builds on x86 linux machines.
|
||||
@@ -79,7 +78,7 @@ QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::create(const Utils::Fil
|
||||
return version;
|
||||
|
||||
delete version;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -33,16 +33,16 @@ namespace Internal {
|
||||
class EmbeddedLinuxQtVersionFactory : public QtSupport::QtVersionFactory
|
||||
{
|
||||
public:
|
||||
explicit EmbeddedLinuxQtVersionFactory(QObject *parent = 0);
|
||||
~EmbeddedLinuxQtVersionFactory();
|
||||
explicit EmbeddedLinuxQtVersionFactory(QObject *parent = nullptr);
|
||||
~EmbeddedLinuxQtVersionFactory() override;
|
||||
|
||||
bool canRestore(const QString &type);
|
||||
QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
|
||||
bool canRestore(const QString &type) override;
|
||||
QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data) override;
|
||||
|
||||
int priority() const;
|
||||
int priority() const override;
|
||||
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,
|
||||
bool isAutoDetected = false,
|
||||
const QString &autoDetectionSource = QString());
|
||||
const QString &autoDetectionSource = QString()) override;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
||||
@@ -71,13 +71,10 @@ struct Job
|
||||
class GenericDirectUploadServicePrivate
|
||||
{
|
||||
public:
|
||||
GenericDirectUploadServicePrivate()
|
||||
: incremental(false), ignoreMissingFiles(false), state(Inactive) {}
|
||||
|
||||
bool incremental;
|
||||
bool ignoreMissingFiles;
|
||||
bool incremental = false;
|
||||
bool ignoreMissingFiles = false;
|
||||
bool uploadJobRunning = false;
|
||||
State state;
|
||||
State state = Inactive;
|
||||
|
||||
QList<DeployableFile> filesToUpload;
|
||||
|
||||
@@ -373,21 +370,21 @@ void GenericDirectUploadService::handleMkdirFinished(int exitStatus)
|
||||
|
||||
void GenericDirectUploadService::handleStdOutData()
|
||||
{
|
||||
SshRemoteProcess * const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
auto const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
if (process)
|
||||
emit stdOutData(QString::fromUtf8(process->readAllStandardOutput()));
|
||||
}
|
||||
|
||||
void GenericDirectUploadService::handleStdErrData()
|
||||
{
|
||||
SshRemoteProcess * const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
auto const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
if (process)
|
||||
emit stdErrData(QString::fromUtf8(process->readAllStandardError()));
|
||||
}
|
||||
|
||||
void GenericDirectUploadService::handleReadChannelFinished()
|
||||
{
|
||||
SshRemoteProcess * const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
auto const process = qobject_cast<SshRemoteProcess *>(sender());
|
||||
if (process && process->atEnd())
|
||||
process->close();
|
||||
}
|
||||
@@ -479,7 +476,7 @@ void GenericDirectUploadService::queryFiles()
|
||||
{
|
||||
QTC_ASSERT(d->state == Uploading, return);
|
||||
|
||||
for (const DeployableFile &file : d->deployableFiles) {
|
||||
for (const DeployableFile &file : qAsConst(d->deployableFiles)) {
|
||||
if (!d->incremental || hasLocalFileChanged(file)) {
|
||||
d->filesToUpload.append(file);
|
||||
continue;
|
||||
|
||||
@@ -40,8 +40,8 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWidget
|
||||
|
||||
public:
|
||||
explicit GenericLinuxDeviceConfigurationWidget(
|
||||
const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent = 0);
|
||||
~GenericLinuxDeviceConfigurationWidget();
|
||||
const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent = nullptr);
|
||||
~GenericLinuxDeviceConfigurationWidget() override;
|
||||
|
||||
private:
|
||||
void authenticationTypeChanged();
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
void createNewKey();
|
||||
void hostKeyCheckingChanged(bool doCheck);
|
||||
|
||||
void updateDeviceFromUi();
|
||||
void updateDeviceFromUi() override;
|
||||
void updatePortsWarningLabel();
|
||||
void initGui();
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizard : public Utils::W
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GenericLinuxDeviceConfigurationWizard(QWidget *parent = 0);
|
||||
~GenericLinuxDeviceConfigurationWizard();
|
||||
GenericLinuxDeviceConfigurationWizard(QWidget *parent = nullptr);
|
||||
~GenericLinuxDeviceConfigurationWizard() override;
|
||||
|
||||
ProjectExplorer::IDevice::Ptr device();
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ GenericLinuxDeviceConfigurationWizardFinalPage::GenericLinuxDeviceConfigurationW
|
||||
setTitle(tr("Summary"));
|
||||
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
|
||||
d->infoLabel.setWordWrap(true);
|
||||
QVBoxLayout * const layout = new QVBoxLayout(this);
|
||||
auto const layout = new QVBoxLayout(this);
|
||||
layout->addWidget(&d->infoLabel);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
QString listProcessesCommandLine() const
|
||||
QString listProcessesCommandLine() const override
|
||||
{
|
||||
return QString::fromLatin1(
|
||||
"for dir in `ls -d /proc/[0123456789]*`; do "
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
"done").arg(QLatin1String(Delimiter0)).arg(QLatin1String(Delimiter1));
|
||||
}
|
||||
|
||||
QList<DeviceProcessItem> buildProcessList(const QString &listProcessesReply) const
|
||||
QList<DeviceProcessItem> buildProcessList(const QString &listProcessesReply) const override
|
||||
{
|
||||
QList<DeviceProcessItem> processes;
|
||||
const QStringList lines = listProcessesReply.split(QString::fromLatin1(Delimiter0)
|
||||
@@ -123,7 +123,7 @@ private:
|
||||
|
||||
class LinuxPortsGatheringMethod : public PortsGatheringMethod
|
||||
{
|
||||
Runnable runnable(QAbstractSocket::NetworkLayerProtocol protocol) const
|
||||
Runnable runnable(QAbstractSocket::NetworkLayerProtocol protocol) const override
|
||||
{
|
||||
// We might encounter the situation that protocol is given IPv6
|
||||
// but the consumer of the free port information decides to open
|
||||
@@ -142,7 +142,7 @@ class LinuxPortsGatheringMethod : public PortsGatheringMethod
|
||||
return runnable;
|
||||
}
|
||||
|
||||
QList<Utils::Port> usedPorts(const QByteArray &output) const
|
||||
QList<Utils::Port> usedPorts(const QByteArray &output) const override
|
||||
{
|
||||
QList<Utils::Port> ports;
|
||||
QList<QByteArray> portStrings = output.split('\n');
|
||||
@@ -198,7 +198,7 @@ void LinuxDevice::executeAction(Core::Id actionId, QWidget *parent)
|
||||
{
|
||||
QTC_ASSERT(actionIds().contains(actionId), return);
|
||||
|
||||
QDialog *d = 0;
|
||||
QDialog *d = nullptr;
|
||||
const LinuxDevice::ConstPtr device = sharedFromThis().staticCast<const LinuxDevice>();
|
||||
if (actionId == Constants::GenericDeployKeyToDeviceActionId)
|
||||
d = PublicKeyDeploymentDialog::createDialog(device, parent);
|
||||
@@ -219,10 +219,7 @@ LinuxDevice::LinuxDevice(const QString &name, Core::Id type, MachineType machine
|
||||
setDisplayName(name);
|
||||
}
|
||||
|
||||
LinuxDevice::LinuxDevice(const LinuxDevice &other)
|
||||
: IDevice(other)
|
||||
{
|
||||
}
|
||||
LinuxDevice::LinuxDevice(const LinuxDevice &other) = default;
|
||||
|
||||
LinuxDevice::Ptr LinuxDevice::create()
|
||||
{
|
||||
|
||||
@@ -39,8 +39,8 @@ class REMOTELINUX_EXPORT LinuxDevice : public ProjectExplorer::IDevice
|
||||
Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::LinuxDevice)
|
||||
|
||||
public:
|
||||
typedef QSharedPointer<LinuxDevice> Ptr;
|
||||
typedef QSharedPointer<const LinuxDevice> ConstPtr;
|
||||
using Ptr = QSharedPointer<LinuxDevice>;
|
||||
using ConstPtr = QSharedPointer<const LinuxDevice>;
|
||||
|
||||
static Ptr create();
|
||||
static Ptr create(const QString &name, Core::Id type, MachineType machineType,
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
ProjectExplorer::DeviceEnvironmentFetcher::Ptr environmentFetcher() const override;
|
||||
|
||||
protected:
|
||||
LinuxDevice() {}
|
||||
LinuxDevice() = default;
|
||||
LinuxDevice(const QString &name, Core::Id type,
|
||||
MachineType machineType, Origin origin, Core::Id id);
|
||||
LinuxDevice(const LinuxDevice &other);
|
||||
|
||||
@@ -203,11 +203,11 @@ void GenericLinuxDeviceTester::handleSftpError(const QString &message)
|
||||
void GenericLinuxDeviceTester::setFinished(TestResult result)
|
||||
{
|
||||
d->state = Inactive;
|
||||
disconnect(&d->portsGatherer, 0, this, 0);
|
||||
disconnect(&d->portsGatherer, nullptr, this, nullptr);
|
||||
if (d->connection) {
|
||||
disconnect(d->connection, 0, this, 0);
|
||||
disconnect(d->connection, nullptr, this, nullptr);
|
||||
d->connection->deleteLater();
|
||||
d->connection = 0;
|
||||
d->connection = nullptr;
|
||||
}
|
||||
emit finished(result);
|
||||
}
|
||||
|
||||
@@ -35,13 +35,11 @@ namespace RemoteLinux {
|
||||
namespace Internal {
|
||||
|
||||
PackageUploader::PackageUploader(QObject *parent) :
|
||||
QObject(parent), m_state(Inactive), m_connection(0)
|
||||
QObject(parent), m_state(Inactive), m_connection(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
PackageUploader::~PackageUploader()
|
||||
{
|
||||
}
|
||||
PackageUploader::~PackageUploader() = default;
|
||||
|
||||
void PackageUploader::uploadPackage(SshConnection *connection,
|
||||
const QString &localFilePath, const QString &remoteFilePath)
|
||||
@@ -138,12 +136,12 @@ void PackageUploader::setState(State newState)
|
||||
return;
|
||||
if (newState == Inactive) {
|
||||
if (m_uploader) {
|
||||
disconnect(m_uploader.data(), 0, this, 0);
|
||||
disconnect(m_uploader.data(), nullptr, this, nullptr);
|
||||
m_uploader.clear();
|
||||
}
|
||||
if (m_connection) {
|
||||
disconnect(m_connection, 0, this, 0);
|
||||
m_connection = 0;
|
||||
disconnect(m_connection, nullptr, this, nullptr);
|
||||
m_connection = nullptr;
|
||||
}
|
||||
}
|
||||
m_state = newState;
|
||||
|
||||
@@ -43,8 +43,8 @@ class PackageUploader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PackageUploader(QObject *parent = 0);
|
||||
~PackageUploader();
|
||||
explicit PackageUploader(QObject *parent = nullptr);
|
||||
~PackageUploader() override;
|
||||
|
||||
// Connection has to be established already.
|
||||
void uploadPackage(QSsh::SshConnection *connection,
|
||||
|
||||
@@ -55,7 +55,7 @@ PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog(const IDevice
|
||||
tr("Choose Public Key File"), dir,
|
||||
tr("Public Key Files (*.pub);;All Files (*)"));
|
||||
if (publicKeyFileName.isEmpty())
|
||||
return 0;
|
||||
return nullptr;
|
||||
return new PublicKeyDeploymentDialog(deviceConfig, publicKeyFileName, parent);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void PublicKeyDeploymentDialog::handleDeploymentFinished(const QString &errorMsg
|
||||
|
||||
void PublicKeyDeploymentDialog::handleCanceled()
|
||||
{
|
||||
disconnect(&d->keyDeployer, 0, this, 0);
|
||||
disconnect(&d->keyDeployer, nullptr, this, nullptr);
|
||||
d->keyDeployer.stopDeployment();
|
||||
if (d->done)
|
||||
accept();
|
||||
|
||||
@@ -40,13 +40,13 @@ class REMOTELINUX_EXPORT PublicKeyDeploymentDialog : public QProgressDialog
|
||||
public:
|
||||
// Asks for public key and returns null if the file dialog is canceled.
|
||||
static PublicKeyDeploymentDialog *createDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig,
|
||||
QWidget *parent = 0);
|
||||
QWidget *parent = nullptr);
|
||||
|
||||
~PublicKeyDeploymentDialog();
|
||||
~PublicKeyDeploymentDialog() override;
|
||||
|
||||
private:
|
||||
explicit PublicKeyDeploymentDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig,
|
||||
const QString &publicKeyFileName, QWidget *parent = 0);
|
||||
const QString &publicKeyFileName, QWidget *parent = nullptr);
|
||||
void handleDeploymentFinished(const QString &errorMsg);
|
||||
void handleDeploymentError(const QString &errorMsg);
|
||||
void handleDeploymentSuccess();
|
||||
|
||||
@@ -42,7 +42,7 @@ RemoteLinuxCheckForFreeDiskSpaceService::RemoteLinuxCheckForFreeDiskSpaceService
|
||||
: AbstractRemoteLinuxDeployService(parent),
|
||||
d(new Internal::RemoteLinuxCheckForFreeDiskSpaceServicePrivate)
|
||||
{
|
||||
d->processRunner = 0;
|
||||
d->processRunner = nullptr;
|
||||
d->requiredSpaceInBytes = 0;
|
||||
}
|
||||
|
||||
@@ -97,13 +97,13 @@ void RemoteLinuxCheckForFreeDiskSpaceService::handleProcessFinished()
|
||||
freeSpace /= 1024; // convert kilobyte to megabyte
|
||||
if (freeSpace < requiredSpaceInMegaBytes) {
|
||||
emit errorMessage(tr("The remote file system has only %n megabytes of free space, "
|
||||
"but %1 megabytes are required.", 0, freeSpace).arg(requiredSpaceInMegaBytes));
|
||||
"but %1 megabytes are required.", nullptr, freeSpace).arg(requiredSpaceInMegaBytes));
|
||||
stopDeployment();
|
||||
return;
|
||||
}
|
||||
|
||||
emit progressMessage(tr("The remote file system has %n megabytes of free space, going ahead.",
|
||||
0, freeSpace));
|
||||
nullptr, freeSpace));
|
||||
stopDeployment();
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@ void RemoteLinuxCheckForFreeDiskSpaceService::stopDeployment()
|
||||
void RemoteLinuxCheckForFreeDiskSpaceService::cleanup()
|
||||
{
|
||||
if (d->processRunner) {
|
||||
disconnect(d->processRunner, 0, this, 0);
|
||||
disconnect(d->processRunner, nullptr, this, nullptr);
|
||||
d->processRunner->cancel();
|
||||
delete d->processRunner;
|
||||
d->processRunner = 0;
|
||||
d->processRunner = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ class REMOTELINUX_EXPORT RemoteLinuxCheckForFreeDiskSpaceService : public Abstra
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RemoteLinuxCheckForFreeDiskSpaceService(QObject *parent = 0);
|
||||
~RemoteLinuxCheckForFreeDiskSpaceService();
|
||||
RemoteLinuxCheckForFreeDiskSpaceService(QObject *parent = nullptr);
|
||||
~RemoteLinuxCheckForFreeDiskSpaceService() override;
|
||||
|
||||
void setPathToCheck(const QString &path);
|
||||
void setRequiredSpaceInBytes(quint64 sizeInBytes);
|
||||
@@ -44,13 +44,13 @@ private:
|
||||
void handleStdErr();
|
||||
void handleProcessFinished();
|
||||
|
||||
bool isDeploymentNecessary() const { return true; }
|
||||
void doDeviceSetup() { handleDeviceSetupDone(true); }
|
||||
void stopDeviceSetup() { handleDeviceSetupDone(false); }
|
||||
bool isDeploymentNecessary() const override { return true; }
|
||||
void doDeviceSetup() override { handleDeviceSetupDone(true); }
|
||||
void stopDeviceSetup() override { handleDeviceSetupDone(false); }
|
||||
|
||||
bool isDeploymentPossible(QString *whyNot) const;
|
||||
void doDeploy();
|
||||
void stopDeployment();
|
||||
bool isDeploymentPossible(QString *whyNot) const override;
|
||||
void doDeploy() override;
|
||||
void stopDeployment() override;
|
||||
|
||||
void cleanup();
|
||||
|
||||
|
||||
@@ -39,11 +39,9 @@ enum State { Inactive, Running };
|
||||
class RemoteLinuxCustomCommandDeployservicePrivate
|
||||
{
|
||||
public:
|
||||
RemoteLinuxCustomCommandDeployservicePrivate() : state(Inactive), runner(0) { }
|
||||
|
||||
QString commandLine;
|
||||
State state;
|
||||
SshRemoteProcessRunner *runner;
|
||||
State state = Inactive;
|
||||
SshRemoteProcessRunner *runner = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -105,7 +103,7 @@ void RemoteLinuxCustomCommandDeployService::stopDeployment()
|
||||
{
|
||||
QTC_ASSERT(d->state == Running, return);
|
||||
|
||||
disconnect(d->runner, 0, this, 0);
|
||||
disconnect(d->runner, nullptr, this, nullptr);
|
||||
d->runner->cancel();
|
||||
d->state = Inactive;
|
||||
handleDeploymentDone();
|
||||
|
||||
@@ -35,19 +35,19 @@ class REMOTELINUX_EXPORT RemoteLinuxCustomCommandDeployService
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit RemoteLinuxCustomCommandDeployService(QObject *parent = 0);
|
||||
~RemoteLinuxCustomCommandDeployService();
|
||||
explicit RemoteLinuxCustomCommandDeployService(QObject *parent = nullptr);
|
||||
~RemoteLinuxCustomCommandDeployService() override;
|
||||
|
||||
void setCommandLine(const QString &commandLine);
|
||||
|
||||
bool isDeploymentNecessary() const { return true; }
|
||||
bool isDeploymentPossible(QString *whyNot = 0) const;
|
||||
bool isDeploymentNecessary() const override { return true; }
|
||||
bool isDeploymentPossible(QString *whyNot = nullptr) const override;
|
||||
|
||||
protected:
|
||||
void doDeviceSetup() { handleDeviceSetupDone(true); }
|
||||
void stopDeviceSetup() { handleDeviceSetupDone(false); }
|
||||
void doDeploy();
|
||||
void stopDeployment();
|
||||
void doDeviceSetup() override { handleDeviceSetupDone(true); }
|
||||
void stopDeviceSetup() override { handleDeviceSetupDone(false); }
|
||||
void doDeploy() override;
|
||||
void stopDeployment() override;
|
||||
|
||||
private:
|
||||
void handleStdout();
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect,
|
||||
ProjectExplorer::Target *target);
|
||||
|
||||
RemoteLinuxEnvironmentAspect *aspect() const;
|
||||
RemoteLinuxEnvironmentAspect *aspect() const override;
|
||||
QPushButton *fetchButton() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,10 +37,8 @@ namespace Internal {
|
||||
RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(const IDevice::ConstPtr &device,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_stop(false)
|
||||
, m_env(Utils::OsTypeLinux)
|
||||
, m_device(device)
|
||||
, m_deviceProcess(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -127,7 +125,7 @@ void RemoteLinuxEnvironmentReader::destroyProcess()
|
||||
if (m_deviceProcess->state() != QProcess::NotRunning)
|
||||
m_deviceProcess->terminate();
|
||||
m_deviceProcess->deleteLater();
|
||||
m_deviceProcess = 0;
|
||||
m_deviceProcess = nullptr;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -41,7 +41,7 @@ class RemoteLinuxEnvironmentReader : public QObject
|
||||
|
||||
public:
|
||||
RemoteLinuxEnvironmentReader(const ProjectExplorer::IDevice::ConstPtr &device,
|
||||
QObject *parent = 0);
|
||||
QObject *parent = nullptr);
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
@@ -58,10 +58,10 @@ private:
|
||||
void setFinished();
|
||||
void destroyProcess();
|
||||
|
||||
bool m_stop;
|
||||
bool m_stop = false;
|
||||
Utils::Environment m_env;
|
||||
ProjectExplorer::IDevice::ConstPtr m_device;
|
||||
ProjectExplorer::DeviceProcess *m_deviceProcess;
|
||||
ProjectExplorer::DeviceProcess *m_deviceProcess = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -37,12 +37,10 @@ namespace Internal {
|
||||
class AbstractRemoteLinuxPackageInstallerPrivate
|
||||
{
|
||||
public:
|
||||
AbstractRemoteLinuxPackageInstallerPrivate() : isRunning(false), installer(0), killProcess(0) {}
|
||||
|
||||
bool isRunning;
|
||||
bool isRunning = false;
|
||||
IDevice::ConstPtr deviceConfig;
|
||||
SshRemoteProcessRunner *installer;
|
||||
SshRemoteProcessRunner *killProcess;
|
||||
SshRemoteProcessRunner *installer = nullptr;
|
||||
SshRemoteProcessRunner *killProcess = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -127,7 +125,7 @@ void AbstractRemoteLinuxPackageInstaller::handleInstallerErrorOutput()
|
||||
|
||||
void AbstractRemoteLinuxPackageInstaller::setFinished()
|
||||
{
|
||||
disconnect(d->installer, 0, this, 0);
|
||||
disconnect(d->installer, nullptr, this, nullptr);
|
||||
d->isRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class REMOTELINUX_EXPORT AbstractRemoteLinuxPackageInstaller : public QObject
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(AbstractRemoteLinuxPackageInstaller)
|
||||
public:
|
||||
~AbstractRemoteLinuxPackageInstaller();
|
||||
~AbstractRemoteLinuxPackageInstaller() override;
|
||||
|
||||
void installPackage(const ProjectExplorer::IDevice::ConstPtr &deviceConfig,
|
||||
const QString &packageFilePath, bool removePackageFile);
|
||||
@@ -50,7 +50,7 @@ signals:
|
||||
void finished(const QString &errorMsg = QString());
|
||||
|
||||
protected:
|
||||
explicit AbstractRemoteLinuxPackageInstaller(QObject *parent = 0);
|
||||
explicit AbstractRemoteLinuxPackageInstaller(QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
void handleConnectionError();
|
||||
@@ -74,11 +74,11 @@ class REMOTELINUX_EXPORT RemoteLinuxTarPackageInstaller : public AbstractRemoteL
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RemoteLinuxTarPackageInstaller(QObject *parent = 0);
|
||||
RemoteLinuxTarPackageInstaller(QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
QString installCommandLine(const QString &packageFilePath) const;
|
||||
QString cancelInstallationCommandLine() const;
|
||||
QString installCommandLine(const QString &packageFilePath) const override;
|
||||
QString cancelInstallationCommandLine() const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -34,9 +34,7 @@ using namespace ProjectExplorer;
|
||||
|
||||
RemoteLinuxSignalOperation::RemoteLinuxSignalOperation(
|
||||
const QSsh::SshConnectionParameters &sshParameters)
|
||||
: DeviceProcessSignalOperation()
|
||||
, m_sshParameters(sshParameters)
|
||||
, m_runner(0)
|
||||
: m_sshParameters(sshParameters)
|
||||
{}
|
||||
|
||||
RemoteLinuxSignalOperation::~RemoteLinuxSignalOperation()
|
||||
@@ -68,7 +66,7 @@ void RemoteLinuxSignalOperation::run(const QString &command)
|
||||
void RemoteLinuxSignalOperation::finish()
|
||||
{
|
||||
delete m_runner;
|
||||
m_runner = 0;
|
||||
m_runner = nullptr;
|
||||
emit finished(m_errorMessage);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
void finish();
|
||||
|
||||
const QSsh::SshConnectionParameters m_sshParameters;
|
||||
QSsh::SshRemoteProcessRunner *m_runner;
|
||||
QSsh::SshRemoteProcessRunner *m_runner = nullptr;
|
||||
|
||||
friend class LinuxDevice;
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ void SshKeyDeployer::stopDeployment()
|
||||
|
||||
void SshKeyDeployer::cleanup()
|
||||
{
|
||||
disconnect(&d->deployProcess, 0, this, 0);
|
||||
disconnect(&d->deployProcess, nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
} // namespace RemoteLinux
|
||||
|
||||
@@ -39,8 +39,8 @@ class REMOTELINUX_EXPORT SshKeyDeployer : public QObject
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(SshKeyDeployer)
|
||||
public:
|
||||
explicit SshKeyDeployer(QObject *parent = 0);
|
||||
~SshKeyDeployer();
|
||||
explicit SshKeyDeployer(QObject *parent = nullptr);
|
||||
~SshKeyDeployer() override;
|
||||
|
||||
void deployPublicKey(const QSsh::SshConnectionParameters &sshParams,
|
||||
const QString &keyFilePath);
|
||||
|
||||
@@ -41,8 +41,8 @@ class TypeSpecificDeviceConfigurationListModel : public QAbstractListModel
|
||||
public:
|
||||
explicit TypeSpecificDeviceConfigurationListModel(ProjectExplorer::Target *target);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
private:
|
||||
int indexForId(Core::Id id) const;
|
||||
|
||||
@@ -39,10 +39,10 @@ class REMOTELINUX_EXPORT UploadAndInstallTarPackageService : public AbstractUplo
|
||||
|
||||
public:
|
||||
explicit UploadAndInstallTarPackageService(QObject *parent);
|
||||
~UploadAndInstallTarPackageService();
|
||||
~UploadAndInstallTarPackageService() override;
|
||||
|
||||
private:
|
||||
AbstractRemoteLinuxPackageInstaller *packageInstaller() const;
|
||||
AbstractRemoteLinuxPackageInstaller *packageInstaller() const override;
|
||||
|
||||
Internal::UploadAndInstallTarPackageServicePrivate *d;
|
||||
};
|
||||
@@ -55,7 +55,7 @@ class REMOTELINUX_EXPORT UploadAndInstallTarPackageStep : public AbstractRemoteL
|
||||
public:
|
||||
explicit UploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bsl);
|
||||
|
||||
bool initInternal(QString *error = 0) override;
|
||||
bool initInternal(QString *error = nullptr) override;
|
||||
|
||||
static Core::Id stepId();
|
||||
static QString displayName();
|
||||
|
||||
Reference in New Issue
Block a user