Skip to content

Commit 5b2b67a

Browse files
committed
refactor(discord): remove unnecessary method
Signed-off-by: so5iso4ka <[email protected]>
1 parent 9fad133 commit 5b2b67a

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

launcher/Application.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,6 @@ bool Application::openJsonEditor(const QString& filename)
14221422
}
14231423
}
14241424

1425-
void Application::showInDiscord()
1426-
{
1427-
discord()->showAlways(m_settings->get("AlwaysShowInDiscord").toBool());
1428-
}
1429-
14301425
bool Application::launch(InstancePtr instance, bool online, bool demo, MinecraftTarget::Ptr targetToJoin, BaseAccountPtr accountToUse)
14311426
{
14321427
if (m_updateRunning) {

launcher/Application.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ class Application : public QApplication {
187187
*/
188188
bool openJsonEditor(const QString& filename);
189189

190-
void showInDiscord();
191-
192190
InstanceWindow* showInstanceWindow(InstancePtr instance, QString page = QString());
193191
MainWindow* showMainWindow(bool minimized = false);
194192

launcher/ui/pages/global/LauncherPage.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "Application.h"
5050
#include "BuildConfig.h"
5151
#include "DesktopServices.h"
52+
#include "discord/DiscordIntegration.h"
5253
#include "settings/SettingsObject.h"
5354
#include "ui/themes/ITheme.h"
5455
#include "ui/themes/ThemeManager.h"
@@ -106,7 +107,6 @@ LauncherPage::~LauncherPage()
106107
bool LauncherPage::apply()
107108
{
108109
applySettings();
109-
APPLICATION->showInDiscord();
110110
return true;
111111
}
112112

@@ -280,7 +280,9 @@ void LauncherPage::applySettings()
280280
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
281281
s->set("SkipModpackUpdatePrompt", ui->skipModpackUpdatePromptBtn->isChecked());
282282

283-
s->set("AlwaysShowInDiscord", ui->discordBtn->isChecked());
283+
const auto showInDiscord = ui->discordBtn->isChecked();
284+
s->set("AlwaysShowInDiscord", showInDiscord);
285+
APPLICATION->discord()->showAlways(showInDiscord);
284286
}
285287

286288
void LauncherPage::loadSettings()

0 commit comments

Comments
 (0)