diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2018-11-24 17:06:01 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2018-11-28 17:47:02 +0000 |
commit | f52f25e15054b54e7b515853418f30618a9925d1 (patch) | |
tree | 691fdc64a281bdf3ee7b35f04e8e2c973f924b51 /src | |
parent | 77c729bb8a315dc596d111bddabf0b510094f7cc (diff) | |
download | qt-creator-f52f25e15054b54e7b515853418f30618a9925d1.tar.gz |
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>
Diffstat (limited to 'src')
34 files changed, 119 insertions, 139 deletions
diff --git a/src/plugins/remotelinux/abstractpackagingstep.cpp b/src/plugins/remotelinux/abstractpackagingstep.cpp index 5ee20c341f..bf393b670d 100644 --- a/src/plugins/remotelinux/abstractpackagingstep.cpp +++ b/src/plugins/remotelinux/abstractpackagingstep.cpp @@ -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, diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp index 6e663bf817..c63e16ce5a 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp @@ -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(); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 5b85f4bde6..b145264eee 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -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); } diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp index 16c1e6fc29..ee79ba4ec8 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp @@ -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(); } diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h index c08682c597..c970e287ea 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h @@ -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(); diff --git a/src/plugins/remotelinux/embeddedlinuxqtversion.h b/src/plugins/remotelinux/embeddedlinuxqtversion.h index 6bad126f28..56d5fff500 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversion.h +++ b/src/plugins/remotelinux/embeddedlinuxqtversion.h @@ -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 diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp index 2be055aec5..935f057ad2 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp +++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp @@ -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 diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h index 2c48501941..7737a8de7a 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h +++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h @@ -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 diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp index ed917d1d78..3112d519c8 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.cpp +++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp @@ -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; diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h index 3b9b46dca7..217e5b1379 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h @@ -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(); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h index 5db089bb6a..ff69a68113 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h @@ -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(); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp index d3524e4bcc..88c62bcaf8 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp @@ -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); } diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index f19350ca1f..3b62402a80 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -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() { diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index 56c58748e8..210bb6177f 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -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); diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index dfce1ab267..913b3250e2 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -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); } diff --git a/src/plugins/remotelinux/packageuploader.cpp b/src/plugins/remotelinux/packageuploader.cpp index 5543d5fd08..5de62edf07 100644 --- a/src/plugins/remotelinux/packageuploader.cpp +++ b/src/plugins/remotelinux/packageuploader.cpp @@ -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; diff --git a/src/plugins/remotelinux/packageuploader.h b/src/plugins/remotelinux/packageuploader.h index 2314d6ac51..7e61eefbe3 100644 --- a/src/plugins/remotelinux/packageuploader.h +++ b/src/plugins/remotelinux/packageuploader.h @@ -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, diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index daeeb002c9..1cb506f273 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -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(); diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.h b/src/plugins/remotelinux/publickeydeploymentdialog.h index 16ffa82364..037e53aacc 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.h +++ b/src/plugins/remotelinux/publickeydeploymentdialog.h @@ -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(); diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp index 120933b5f9..5a336125ed 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.cpp @@ -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; } } diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h index 461bf23676..0592090480 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h @@ -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(); diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp index 6822db222c..eddcda0f19 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.cpp @@ -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(); diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h index 0adb1943ec..75352420f6 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h @@ -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(); diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h index 115b6148f9..ae254fda62 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h @@ -43,7 +43,7 @@ public: RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect, ProjectExplorer::Target *target); - RemoteLinuxEnvironmentAspect *aspect() const; + RemoteLinuxEnvironmentAspect *aspect() const override; QPushButton *fetchButton() const; private: diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp index 18a265c886..0c93be020a 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp @@ -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 diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.h b/src/plugins/remotelinux/remotelinuxenvironmentreader.h index 3642a556e0..d16664e870 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.h @@ -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 diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp index 38fa9b12a4..3f84fa7c37 100644 --- a/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp +++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.cpp @@ -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; } diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.h b/src/plugins/remotelinux/remotelinuxpackageinstaller.h index dacdf5b5ef..25f1b34f77 100644 --- a/src/plugins/remotelinux/remotelinuxpackageinstaller.h +++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.h @@ -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; }; diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp index e529b7cdce..07e5e1d04e 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp @@ -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); } diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.h b/src/plugins/remotelinux/remotelinuxsignaloperation.h index e52c15cf41..dc479141b3 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.h +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.h @@ -61,7 +61,7 @@ private: void finish(); const QSsh::SshConnectionParameters m_sshParameters; - QSsh::SshRemoteProcessRunner *m_runner; + QSsh::SshRemoteProcessRunner *m_runner = nullptr; friend class LinuxDevice; }; diff --git a/src/plugins/remotelinux/sshkeydeployer.cpp b/src/plugins/remotelinux/sshkeydeployer.cpp index eca72eccb1..5d7cccdc8f 100644 --- a/src/plugins/remotelinux/sshkeydeployer.cpp +++ b/src/plugins/remotelinux/sshkeydeployer.cpp @@ -101,7 +101,7 @@ void SshKeyDeployer::stopDeployment() void SshKeyDeployer::cleanup() { - disconnect(&d->deployProcess, 0, this, 0); + disconnect(&d->deployProcess, nullptr, this, nullptr); } } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/sshkeydeployer.h b/src/plugins/remotelinux/sshkeydeployer.h index ebd8214fa1..8c5df26d8a 100644 --- a/src/plugins/remotelinux/sshkeydeployer.h +++ b/src/plugins/remotelinux/sshkeydeployer.h @@ -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); diff --git a/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h b/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h index 69ded3a6d6..d1b54844a9 100644 --- a/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h +++ b/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h @@ -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; diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.h b/src/plugins/remotelinux/uploadandinstalltarpackagestep.h index ec891b1e5d..de1d2f487d 100644 --- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.h +++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.h @@ -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(); |