mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-28 02:26:07 +00:00
Fix build when -DENABLE_DISCORD_RPC=OFF (#1551)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* added ifdef for discordrpc * replaced discordrpc include correctly
This commit is contained in:
parent
17c47bcd96
commit
9f42a12baf
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include "src/common/discord_rpc_handler.h"
|
||||
#include "discord_rpc_handler.h"
|
||||
|
||||
namespace DiscordRPCHandler {
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
#include "main_window.h"
|
||||
#include "settings_dialog.h"
|
||||
#include "video_core/renderer_vulkan/vk_instance.h"
|
||||
#ifdef ENABLE_DISCORD_RPC
|
||||
#include "common/discord_rpc_handler.h"
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||
ui->setupUi(this);
|
||||
|
@ -76,12 +79,13 @@ bool MainWindow::Init() {
|
|||
"Games: " + QString::number(numGames) + " (" + QString::number(duration.count()) + "ms)";
|
||||
statusBar->showMessage(statusMessage);
|
||||
|
||||
// Initialize Discord RPC
|
||||
#ifdef ENABLE_DISCORD_RPC
|
||||
if (Config::getEnableDiscordRPC()) {
|
||||
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
||||
rpc->init();
|
||||
rpc->setStatusIdling();
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "background_music_player.h"
|
||||
#include "common/config.h"
|
||||
#include "common/discord_rpc_handler.h"
|
||||
#include "common/path_util.h"
|
||||
#include "core/file_format/psf.h"
|
||||
#include "core/file_sys/fs.h"
|
||||
|
|
|
@ -173,6 +173,7 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||
BackgroundMusicPlayer::getInstance().setVolume(val);
|
||||
});
|
||||
|
||||
#ifdef ENABLE_DISCORD_RPC
|
||||
connect(ui->discordRPCCheckbox, &QCheckBox::stateChanged, this, [](int val) {
|
||||
Config::setEnableDiscordRPC(val);
|
||||
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
||||
|
@ -183,6 +184,7 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||
rpc->shutdown();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
// Input TAB
|
||||
|
|
Loading…
Reference in a new issue