mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00:00
refactor(Application.h): reduce include chain
Include only what's absolutely necessary to reduce headers pulled into a translation unit. If you need access to instance's from `APPLICATION` include `BaseInstance.h` separately Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
35121f26fd
commit
0ba2c09787
|
|
@ -37,6 +37,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
|
|
@ -44,12 +46,12 @@
|
|||
#include <QIcon>
|
||||
#include <QMutex>
|
||||
#include <QUrl>
|
||||
#include <memory>
|
||||
|
||||
#include <BaseInstance.h>
|
||||
#include "QObjectPtr.h"
|
||||
|
||||
#include "launch/LogModel.h"
|
||||
#include "minecraft/launch/MinecraftTarget.h"
|
||||
#include "minecraft/auth/MinecraftAccount.h"
|
||||
#include "settings/SettingsObject.h"
|
||||
|
||||
class LaunchController;
|
||||
class LocalPeer;
|
||||
|
|
@ -74,6 +76,13 @@ class ITheme;
|
|||
class MCEditTool;
|
||||
class ThemeManager;
|
||||
class IconTheme;
|
||||
class BaseInstance;
|
||||
|
||||
struct MinecraftTarget;
|
||||
|
||||
// pointers for lazy people
|
||||
using InstancePtr = std::shared_ptr<BaseInstance>;
|
||||
using MinecraftTargetPtr = std::shared_ptr<MinecraftTarget>;
|
||||
|
||||
namespace Meta {
|
||||
class Index;
|
||||
|
|
@ -212,7 +221,7 @@ class Application : public QApplication {
|
|||
bool launch(BaseInstance* instance,
|
||||
bool online = true,
|
||||
bool demo = false,
|
||||
MinecraftTarget::Ptr targetToJoin = nullptr,
|
||||
MinecraftTargetPtr targetToJoin = nullptr,
|
||||
MinecraftAccountPtr accountToUse = nullptr,
|
||||
const QString& offlineName = QString());
|
||||
bool kill(BaseInstance* instance);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#define PRISM_PRECOMPILED_BASE_HEADERS_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,15 @@
|
|||
#include <QEvent>
|
||||
#include <QMetaType>
|
||||
#include <QObject>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include <QVariant>
|
||||
#include <QVariantMap>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
#pragma once
|
||||
#include "Application.h"
|
||||
#include "BaseInstance.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QMessageBox>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <QImage>
|
||||
#include <QList>
|
||||
#include <QNetworkReply>
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
#include <QList>
|
||||
#include <QNetworkReply>
|
||||
#include <QObject>
|
||||
|
||||
#include "QObjectPtr.h"
|
||||
|
|
|
|||
Loading…
Reference in a new issue