diff options
Diffstat (limited to 'src/plugins/projectexplorer/devicesupport/devicemanager.cpp')
-rw-r--r-- | src/plugins/projectexplorer/devicesupport/devicemanager.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 585478a611..9a0e1b0e11 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -57,8 +57,7 @@ const char DefaultDevicesKey[] = "DefaultDevices"; class DeviceManagerPrivate { public: - DeviceManagerPrivate() : writer(0) - { } + DeviceManagerPrivate() = default; int indexForId(Core::Id id) const { @@ -74,15 +73,15 @@ public: QHash<Core::Id, Core::Id> defaultDevices; QSsh::SshHostKeyDatabasePtr hostKeyDatabase; - Utils::PersistentSettingsWriter *writer; + Utils::PersistentSettingsWriter *writer = nullptr; }; -DeviceManager *DeviceManagerPrivate::clonedInstance = 0; +DeviceManager *DeviceManagerPrivate::clonedInstance = nullptr; } // namespace Internal using namespace Internal; -DeviceManager *DeviceManager::m_instance = 0; +DeviceManager *DeviceManager::m_instance = nullptr; DeviceManager *DeviceManager::instance() { @@ -104,12 +103,12 @@ void DeviceManager::replaceInstance() void DeviceManager::removeClonedInstance() { delete DeviceManagerPrivate::clonedInstance; - DeviceManagerPrivate::clonedInstance = 0; + DeviceManagerPrivate::clonedInstance = nullptr; } DeviceManager *DeviceManager::cloneInstance() { - QTC_ASSERT(!DeviceManagerPrivate::clonedInstance, return 0); + QTC_ASSERT(!DeviceManagerPrivate::clonedInstance, return nullptr); DeviceManagerPrivate::clonedInstance = new DeviceManager(false); copy(instance(), DeviceManagerPrivate::clonedInstance, true); @@ -210,7 +209,7 @@ QVariantMap DeviceManager::toMap() const { QVariantMap map; QVariantMap defaultDeviceMap; - typedef QHash<Core::Id, Core::Id> TypeIdHash; + using TypeIdHash = QHash<Core::Id, Core::Id>; for (TypeIdHash::ConstIterator it = d->defaultDevices.constBegin(); it != d->defaultDevices.constEnd(); ++it) { defaultDeviceMap.insert(it.key().toString(), it.value().toSetting()); @@ -370,7 +369,7 @@ DeviceManager::~DeviceManager() if (d->clonedInstance != this) delete d->writer; if (m_instance == this) - m_instance = 0; + m_instance = nullptr; delete d; } @@ -429,9 +428,9 @@ public: static Core::Id testTypeId() { return "TestType"; } private: - TestDevice(const TestDevice &other) : IDevice(other) {} + TestDevice(const TestDevice &other) = default; QString displayType() const override { return QLatin1String("blubb"); } - IDeviceWidget *createWidget() override { return 0; } + IDeviceWidget *createWidget() override { return nullptr; } QList<Core::Id> actionIds() const override { return QList<Core::Id>(); } QString displayNameForActionId(Core::Id) const override { return QString(); } void executeAction(Core::Id, QWidget *) override { } |