Move IDeviceFactory closer to IDevice implementation

Except for the DesktopDevice, which is kind of special. Also try
a bit to make (and partially fail at doing so) naming and code
structure (#include, use of namespaces) more similar to each other.

Change-Id: I9fe266e706b72c14f59ff03ca1ae02dba3adcc71
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-20 19:13:28 +01:00
parent 317ab49793
commit 9e965409d1
44 changed files with 492 additions and 910 deletions

View File

@@ -26,6 +26,7 @@
#include "linuxdevice.h"
#include "genericlinuxdeviceconfigurationwidget.h"
#include "genericlinuxdeviceconfigurationwizard.h"
#include "linuxdeviceprocess.h"
#include "linuxdevicetester.h"
#include "publickeydeploymentdialog.h"
@@ -33,6 +34,7 @@
#include "remotelinuxsignaloperation.h"
#include "remotelinuxenvironmentreader.h"
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <coreplugin/messagemanager.h>
#include <projectexplorer/devicesupport/sshdeviceprocesslist.h>
@@ -284,4 +286,27 @@ bool LinuxDevice::supportsRSync() const
return extraData("RemoteLinux.SupportsRSync").toBool();
}
namespace Internal {
// Factory
LinuxDeviceFactory::LinuxDeviceFactory()
: IDeviceFactory(Constants::GenericLinuxOsType)
{
setDisplayName(tr("Generic Linux Device"));
setIcon(QIcon());
setCanCreate(true);
setConstructionFunction(&LinuxDevice::create);
}
IDevice::Ptr LinuxDeviceFactory::create() const
{
GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::mainWindow());
if (wizard.exec() != QDialog::Accepted)
return IDevice::Ptr();
return wizard.device();
}
}
} // namespace RemoteLinux