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

@@ -23,7 +23,6 @@ HEADERS += \
androidcreatekeystorecertificate.h \
javaparser.h \
androidplugin.h \
androiddevicefactory.h \
androiddevice.h \
androidgdbserverkitinformation.h \
androidqmltoolingsupport.h \
@@ -70,7 +69,6 @@ SOURCES += \
androidcreatekeystorecertificate.cpp \
javaparser.cpp \
androidplugin.cpp \
androiddevicefactory.cpp \
androiddevice.cpp \
androidgdbserverkitinformation.cpp \
androidqmltoolingsupport.cpp \

View File

@@ -46,8 +46,6 @@ Project {
"androiddevicedialog.ui",
"androiddevice.cpp",
"androiddevice.h",
"androiddevicefactory.cpp",
"androiddevicefactory.h",
"androiderrormessage.h",
"androiderrormessage.cpp",
"androidextralibrarylistmodel.cpp",

View File

@@ -103,5 +103,18 @@ QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const
return url;
}
// Factory
AndroidDeviceFactory::AndroidDeviceFactory()
: ProjectExplorer::IDeviceFactory(Constants::ANDROID_DEVICE_TYPE)
{
setObjectName(QLatin1String("AndroidDeviceFactory"));
setDisplayName(tr("Android Device"));
setCombinedIcon(":/android/images/androiddevicesmall.png",
":/android/images/androiddevice.png");
setConstructionFunction(&AndroidDevice::create);
}
} // namespace Internal
} // namespace Android

View File

@@ -26,6 +26,7 @@
#pragma once
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/devicesupport/idevicefactory.h>
namespace Android {
namespace Internal {
@@ -50,5 +51,12 @@ private:
QUrl toolControlChannel(const ControlChannelHint &) const override;
};
class AndroidDeviceFactory : public ProjectExplorer::IDeviceFactory
{
Q_OBJECT
public:
AndroidDeviceFactory();
};
} // namespace Internal
} // namespace Android

View File

@@ -1,45 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "androiddevicefactory.h"
#include "androiddevice.h"
#include "androidconstants.h"
namespace Android {
namespace Internal {
AndroidDeviceFactory::AndroidDeviceFactory()
: ProjectExplorer::IDeviceFactory(Constants::ANDROID_DEVICE_TYPE)
{
setObjectName(QLatin1String("AndroidDeviceFactory"));
setDisplayName(tr("Android Device"));
setCombinedIcon(":/android/images/androiddevicesmall.png",
":/android/images/androiddevice.png");
setConstructionFunction(&AndroidDevice::create);
}
} // namespace Internal
} // namespace Android

View File

@@ -1,41 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <projectexplorer/devicesupport/idevicefactory.h>
namespace Android {
namespace Internal {
class AndroidDeviceFactory : public ProjectExplorer::IDeviceFactory
{
Q_OBJECT
public:
AndroidDeviceFactory();
};
} // namespace Internal
} // namespace Android

View File

@@ -30,7 +30,6 @@
#include "androiddebugsupport.h"
#include "androiddeployqtstep.h"
#include "androiddevice.h"
#include "androiddevicefactory.h"
#include "androidgdbserverkitinformation.h"
#include "androidmanager.h"
#include "androidmanifesteditorfactory.h"