diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-12-14 23:22:27 +0100 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-12-14 23:22:27 +0100 |
commit | 849b92665e0762a38a7e17403015e2b037318aec (patch) | |
tree | 2fbeac111297727aa6613aacc08e80dcec5c3724 /launcher/Application.cpp | |
parent | fdbd8d9d2b2e04cd68fd800882309b40c05aba2c (diff) | |
parent | d193ed9eebb392b259edb88a227dce4cee773df6 (diff) | |
download | PrismLauncher-849b92665e0762a38a7e17403015e2b037318aec.tar.gz PrismLauncher-849b92665e0762a38a7e17403015e2b037318aec.tar.bz2 PrismLauncher-849b92665e0762a38a7e17403015e2b037318aec.zip |
Merge branch 'develop' into remove-updater
Diffstat (limited to 'launcher/Application.cpp')
-rw-r--r-- | launcher/Application.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 8fe5a8bf..dc1d7f98 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -97,6 +97,7 @@ #include <QIcon> #include "InstanceList.h" +#include "MTPixmapCache.h" #include <minecraft/auth/AccountList.h> #include "icons/IconList.h" @@ -125,6 +126,7 @@ #ifdef Q_OS_LINUX #include <dlfcn.h> #include "gamemode_client.h" +#include "MangoHud.h" #endif #ifdef Q_OS_MAC @@ -145,6 +147,8 @@ static const QLatin1String liveCheckFile("live.check"); +PixmapCache* PixmapCache::s_instance = nullptr; + namespace { void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { @@ -654,6 +658,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_globalSettingsProvider->addPage<AccountListPage>(); m_globalSettingsProvider->addPage<APIPage>(); } + + PixmapCache::setInstance(new PixmapCache(this)); + qDebug() << "<> Settings loaded."; } @@ -876,13 +883,13 @@ bool Application::createSetupWizard() return false; } -bool Application::event(QEvent* event) { +bool Application::event(QEvent* event) +{ #ifdef Q_OS_MACOS if (event->type() == QEvent::ApplicationStateChange) { auto ev = static_cast<QApplicationStateChangeEvent*>(event); - if (m_prevAppState == Qt::ApplicationActive - && ev->applicationState() == Qt::ApplicationActive) { + if (m_prevAppState == Qt::ApplicationActive && ev->applicationState() == Qt::ApplicationActive) { emit clickedOnDock(); } m_prevAppState = ev->applicationState(); @@ -1480,17 +1487,8 @@ void Application::updateCapabilities() if (gamemode_query_status() >= 0) m_capabilities |= SupportsGameMode; - { - void *dummy = dlopen("libMangoHud_dlsym.so", RTLD_LAZY); - // try normal variant as well - if (dummy == NULL) - dummy = dlopen("libMangoHud.so", RTLD_LAZY); - - if (dummy != NULL) { - dlclose(dummy); - m_capabilities |= SupportsMangoHud; - } - } + if (!MangoHud::getLibraryString().isEmpty()) + m_capabilities |= SupportsMangoHud; #endif } |