Android: Cosmetics for AndroidDevice interface

Change-Id: I291f51a3baeb3768428485c63914627c0d91037b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-01-14 18:01:06 +01:00
parent b466e3f0be
commit da4d395ff4
4 changed files with 7 additions and 12 deletions

View File

@@ -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));
}

View File

@@ -60,8 +60,6 @@ AndroidDevice::AndroidDevice()
setQmlsceneCommand(activityPath);
}
AndroidDevice::AndroidDevice(const AndroidDevice &other) = default;
IDevice::DeviceInfo AndroidDevice::deviceInformation() const
{
return IDevice::DeviceInfo();

View File

@@ -28,13 +28,16 @@
#include <projectexplorer/devicesupport/idevice.h>
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

View File

@@ -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