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:
Rachel Powers 2025-12-15 15:10:04 -07:00
parent 35121f26fd
commit 0ba2c09787
No known key found for this signature in database
GPG key ID: B4CB507E51F8B89C
6 changed files with 21 additions and 6 deletions

View file

@ -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);

View file

@ -3,6 +3,7 @@
#define PRISM_PRECOMPILED_BASE_HEADERS_H
#include <algorithm>
#include <cstddef>
#include <functional>
#include <memory>
#include <optional>

View file

@ -5,9 +5,15 @@
#include <QEvent>
#include <QMetaType>
#include <QObject>
#include <QPointer>
#include <QSharedPointer>
#include <QVariant>
#include <QVariantMap>
#include <QDebug>
#include <QLoggingCategory>
#include <QCoreApplication>

View file

@ -37,6 +37,7 @@
#pragma once
#include "Application.h"
#include "BaseInstance.h"
#include <QList>
#include <QMessageBox>

View file

@ -2,7 +2,6 @@
#include <QImage>
#include <QList>
#include <QNetworkReply>
#include <QObject>
#include <QSet>

View file

@ -1,6 +1,5 @@
#pragma once
#include <QList>
#include <QNetworkReply>
#include <QObject>
#include "QObjectPtr.h"