diff options
author | hjk <hjk@qt.io> | 2019-02-20 19:13:28 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-02-21 13:20:16 +0000 |
commit | 9e965409d1cbe6270c6a994bfe41d61a154d1d77 (patch) | |
tree | c7099baa704c1d3b0ddf01250e6757b132394ebf /src/plugins/qnx/qnxdevice.cpp | |
parent | 317ab497936cc6c32da80bd0d3de58975bb308f1 (diff) |
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>
Diffstat (limited to 'src/plugins/qnx/qnxdevice.cpp')
-rw-r--r-- | src/plugins/qnx/qnxdevice.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/plugins/qnx/qnxdevice.cpp b/src/plugins/qnx/qnxdevice.cpp index 49cd195ccdb..9b4a7542ffe 100644 --- a/src/plugins/qnx/qnxdevice.cpp +++ b/src/plugins/qnx/qnxdevice.cpp @@ -24,11 +24,14 @@ ****************************************************************************/ #include "qnxdevice.h" + +#include "qnxconstants.h" #include "qnxdevicetester.h" #include "qnxdeviceprocesslist.h" #include "qnxdeviceprocesssignaloperation.h" #include "qnxdeployqtlibrariesdialog.h" #include "qnxdeviceprocess.h" +#include "qnxdevicewizard.h" #include <projectexplorer/devicesupport/sshdeviceprocess.h> @@ -46,8 +49,7 @@ using namespace ProjectExplorer; using namespace Utils; namespace Qnx { - -using namespace Internal; +namespace Internal { const char QnxVersionKey[] = "QnxVersion"; @@ -179,4 +181,30 @@ DeviceProcessSignalOperation::Ptr QnxDevice::signalOperation() const new QnxDeviceProcessSignalOperation(sshParameters())); } +// Factory + +QnxDeviceFactory::QnxDeviceFactory() + : ProjectExplorer::IDeviceFactory(Constants::QNX_QNX_OS_TYPE) +{ + setDisplayName(tr("QNX Device")); + setCombinedIcon(":/qnx/images/qnxdevicesmall.png", + ":/qnx/images/qnxdevice.png"); + setCanCreate(true); + setConstructionFunction(&QnxDevice::create); +} + +ProjectExplorer::IDevice::Ptr QnxDeviceFactory::create() const +{ + QnxDeviceWizard wizard; + if (wizard.exec() != QDialog::Accepted) + return ProjectExplorer::IDevice::Ptr(); + return wizard.device(); +} + +Core::Id QnxDeviceFactory::deviceType() +{ + return Core::Id(Constants::QNX_QNX_OS_TYPE); +} + +} // namespace Internal } // namespace Qnx |