IDevice: Make it possible to forward declare Ptr and ConstPtr

Most inclusions of idevice.h inside other headers are
required just because of IDevice::Ptr or IDevice::ConstPtr
was used there. Unfortunately, since these "using"
are defined inside a IDevice class, we just can't
forward declare IDevice::Ptr nor IDevice::ConstPtr.

Instead, create a separate header that defines
IDevicePtr and IDeviceConstPtr while having IDevice
forward declared. Redefine IDevice::Ptr/ConstPtr
inside IDevice to use IDevicePtr/IDeviceConstPtr.

Now, instead of forward declaring a IDevice::Ptr
it's sufficient to include the idevicefwd.h.

This drops the number of files being recompiled
after touching idevice.h from ~770 to ~210.

Change-Id: Ib6f2982aa0761fb4cd6593badb9c3c0c527ea535
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-04-12 21:01:45 +02:00
parent bfc0d5ec32
commit 7fadaff5d4
84 changed files with 223 additions and 112 deletions

View File

@@ -32,7 +32,7 @@
#include <debugger/debuggerconstants.h>
#include <debugger/debuggerruncontrol.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/devicesupport/idevicefwd.h>
#include <projectexplorer/runconfiguration.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
@@ -83,7 +83,7 @@ private:
IosToolHandler *m_toolHandler = nullptr;
QString m_bundleDir;
ProjectExplorer::IDevice::ConstPtr m_device;
ProjectExplorer::IDeviceConstPtr m_device;
IosDeviceType m_deviceType;
bool m_cppDebug = false;
QmlDebug::QmlDebugServicesPreset m_qmlDebugServices = QmlDebug::NoQmlDebugServices;