diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 47c8fe1f0bf..d26ca3c1911 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1297,7 +1297,7 @@ void AndroidConfigurations::updateAndroidDevice() { DeviceManager * const devMgr = DeviceManager::instance(); if (m_instance->m_config.adbToolPath().exists()) - devMgr->addDevice(IDevice::Ptr(new AndroidDevice)); + devMgr->addDevice(AndroidDevice::create()); else if (devMgr->find(Constants::ANDROID_DEVICE_ID)) devMgr->removeDevice(Core::Id(Constants::ANDROID_DEVICE_ID)); } diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 26058c6e8eb..e33c3e3d12d 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -60,8 +60,6 @@ AndroidDevice::AndroidDevice() setQmlsceneCommand(activityPath); } -AndroidDevice::AndroidDevice(const AndroidDevice &other) = default; - IDevice::DeviceInfo AndroidDevice::deviceInformation() const { return IDevice::DeviceInfo(); diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index 719f479cf2b..22a0e53df1f 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -28,13 +28,16 @@ #include namespace Android { -class AndroidConfigurations; // needed for friend declaration - namespace Internal { class AndroidDevice : public ProjectExplorer::IDevice { public: + static IDevice::Ptr create() { return IDevice::Ptr(new AndroidDevice); }; + +private: + AndroidDevice(); + ProjectExplorer::IDevice::DeviceInfo deviceInformation() const override; QString displayType() const override; @@ -45,12 +48,6 @@ public: ProjectExplorer::IDevice::Ptr clone() const override; QUrl toolControlChannel(const ControlChannelHint &) const override; - -protected: - friend class AndroidDeviceFactory; - friend class Android::AndroidConfigurations; - AndroidDevice(); - AndroidDevice(const AndroidDevice &other); }; } // namespace Internal diff --git a/src/plugins/android/androiddevicefactory.cpp b/src/plugins/android/androiddevicefactory.cpp index 6e6f507679c..19a4679491a 100644 --- a/src/plugins/android/androiddevicefactory.cpp +++ b/src/plugins/android/androiddevicefactory.cpp @@ -38,7 +38,7 @@ AndroidDeviceFactory::AndroidDeviceFactory() setDisplayName(tr("Android Device")); setCombinedIcon(":/android/images/androiddevicesmall.png", ":/android/images/androiddevice.png"); - setConstructionFunction([] { return ProjectExplorer::IDevice::Ptr(new AndroidDevice); }); + setConstructionFunction(&AndroidDevice::create); } } // namespace Internal