forked from qt-creator/qt-creator
Madde: Introduce new class MaddeDevice.
This is needed for an upcoming change that will move a number of virtual functions from IDeviceFactory to IDevice. Change-Id: I3658c057583853359b3f0e901f5db78502e1a993 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -53,6 +53,7 @@ HEADERS += \
|
|||||||
maemodeploybymountsteps.h \
|
maemodeploybymountsteps.h \
|
||||||
maddedevicetester.h \
|
maddedevicetester.h \
|
||||||
maddedeviceconfigurationfactory.h \
|
maddedeviceconfigurationfactory.h \
|
||||||
|
maddedevice.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
maddeplugin.cpp \
|
maddeplugin.cpp \
|
||||||
@@ -98,7 +99,8 @@ SOURCES += \
|
|||||||
maddeuploadandinstallpackagesteps.cpp \
|
maddeuploadandinstallpackagesteps.cpp \
|
||||||
maemodeploybymountsteps.cpp \
|
maemodeploybymountsteps.cpp \
|
||||||
maddedevicetester.cpp \
|
maddedevicetester.cpp \
|
||||||
maemorunconfiguration.cpp
|
maemorunconfiguration.cpp \
|
||||||
|
maddedevice.cpp
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
maemopackagecreationwidget.ui \
|
maemopackagecreationwidget.ui \
|
||||||
|
@@ -125,6 +125,8 @@ QtcPlugin {
|
|||||||
"qt4maemotarget.h",
|
"qt4maemotarget.h",
|
||||||
"qt4maemotargetfactory.cpp",
|
"qt4maemotargetfactory.cpp",
|
||||||
"qt4maemotargetfactory.h",
|
"qt4maemotargetfactory.h",
|
||||||
|
"maddedevice.cpp",
|
||||||
|
"maddedevice.h"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
68
src/plugins/madde/maddedevice.cpp
Normal file
68
src/plugins/madde/maddedevice.cpp
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||||
|
** Please review the following information to ensure the GNU Lesser General
|
||||||
|
** Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** If you have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
#include "maddedevice.h"
|
||||||
|
|
||||||
|
namespace Madde {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
MaddeDevice::Ptr MaddeDevice::create()
|
||||||
|
{
|
||||||
|
return Ptr(new MaddeDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
MaddeDevice::Ptr MaddeDevice::create(const QString &name, const QString &type,
|
||||||
|
MachineType machineType, Origin origin, const QString &fingerprint)
|
||||||
|
{
|
||||||
|
return Ptr(new MaddeDevice(name, type, machineType, origin, fingerprint));
|
||||||
|
}
|
||||||
|
|
||||||
|
MaddeDevice::MaddeDevice()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MaddeDevice::MaddeDevice(const QString &name, const QString &type, MachineType machineType,
|
||||||
|
Origin origin, const QString &fingerprint)
|
||||||
|
: LinuxDeviceConfiguration(name, type, machineType, origin, fingerprint)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MaddeDevice::MaddeDevice(const MaddeDevice &other) : LinuxDeviceConfiguration(other)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::IDevice::Ptr MaddeDevice::clone() const
|
||||||
|
{
|
||||||
|
return Ptr(new MaddeDevice(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Madde
|
63
src/plugins/madde/maddedevice.h
Normal file
63
src/plugins/madde/maddedevice.h
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
**
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||||
|
** Please review the following information to ensure the GNU Lesser General
|
||||||
|
** Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
**
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** If you have questions regarding the use of this file, please contact
|
||||||
|
** Nokia at qt-info@nokia.com.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
#ifndef MADDEDEVICE_H
|
||||||
|
#define MADDEDEVICE_H
|
||||||
|
|
||||||
|
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||||
|
|
||||||
|
namespace Madde {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class MaddeDevice : public RemoteLinux::LinuxDeviceConfiguration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef QSharedPointer<MaddeDevice> Ptr;
|
||||||
|
typedef QSharedPointer<const MaddeDevice> ConstPtr;
|
||||||
|
|
||||||
|
static Ptr create();
|
||||||
|
static Ptr create(const QString &name, const QString &type, MachineType machineType,
|
||||||
|
Origin origin = ManuallyAdded, const QString &fingerprint = QString());
|
||||||
|
|
||||||
|
ProjectExplorer::IDevice::Ptr clone() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
MaddeDevice();
|
||||||
|
MaddeDevice(const QString &name, const QString &type, MachineType machineType,
|
||||||
|
Origin origin, const QString &fingerprint);
|
||||||
|
|
||||||
|
MaddeDevice(const MaddeDevice &other);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Madde
|
||||||
|
|
||||||
|
#endif // MADDEDEVICE_H
|
@@ -31,6 +31,7 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "maddedeviceconfigurationfactory.h"
|
#include "maddedeviceconfigurationfactory.h"
|
||||||
|
|
||||||
|
#include "maddedevice.h"
|
||||||
#include "maddedevicetester.h"
|
#include "maddedevicetester.h"
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "maemodeviceconfigwizard.h"
|
#include "maemodeviceconfigwizard.h"
|
||||||
@@ -77,9 +78,8 @@ IDeviceWidget *MaddeDeviceConfigurationFactory::createWidget(const IDevice::Ptr
|
|||||||
|
|
||||||
IDevice::Ptr MaddeDeviceConfigurationFactory::loadDevice(const QVariantMap &map) const
|
IDevice::Ptr MaddeDeviceConfigurationFactory::loadDevice(const QVariantMap &map) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(supportsDeviceType(IDevice::typeFromMap(map)),
|
QTC_ASSERT(supportsDeviceType(IDevice::typeFromMap(map)), return MaddeDevice::Ptr());
|
||||||
return LinuxDeviceConfiguration::Ptr());
|
MaddeDevice::Ptr device = MaddeDevice::create();
|
||||||
LinuxDeviceConfiguration::Ptr device = LinuxDeviceConfiguration::create();
|
|
||||||
device->fromMap(map);
|
device->fromMap(map);
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
@@ -36,13 +36,13 @@
|
|||||||
#include "ui_maemodeviceconfigwizardreusekeyscheckpage.h"
|
#include "ui_maemodeviceconfigwizardreusekeyscheckpage.h"
|
||||||
#include "ui_maemodeviceconfigwizardstartpage.h"
|
#include "ui_maemodeviceconfigwizardstartpage.h"
|
||||||
|
|
||||||
|
#include "maddedevice.h"
|
||||||
#include "maddedevicetester.h"
|
#include "maddedevicetester.h"
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
||||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
|
||||||
#include <remotelinux/linuxdevicetestdialog.h>
|
#include <remotelinux/linuxdevicetestdialog.h>
|
||||||
#include <remotelinux/sshkeydeployer.h>
|
#include <remotelinux/sshkeydeployer.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
@@ -579,7 +579,7 @@ IDevice::Ptr MaemoDeviceConfigWizard::device()
|
|||||||
freePortsSpec = QLatin1String("10000-10100");
|
freePortsSpec = QLatin1String("10000-10100");
|
||||||
doTest = true;
|
doTest = true;
|
||||||
}
|
}
|
||||||
const LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(d->wizardData.configName,
|
const MaddeDevice::Ptr devConf = MaddeDevice::create(d->wizardData.configName,
|
||||||
d->wizardData.deviceType, d->wizardData.machineType);
|
d->wizardData.deviceType, d->wizardData.machineType);
|
||||||
devConf->setFreePorts(PortList::fromString(freePortsSpec));
|
devConf->setFreePorts(PortList::fromString(freePortsSpec));
|
||||||
devConf->setSshParameters(sshParams);
|
devConf->setSshParameters(sshParams);
|
||||||
|
Reference in New Issue
Block a user