Fix Crash on Win Portable

This commit is contained in:
ZeldaZach 2024-12-28 22:01:41 -05:00
parent 60f3e6412b
commit 6d377aea7b
No known key found for this signature in database

View file

@ -118,9 +118,11 @@ GeneralSettingsPage::GeneralSettingsPage()
QPushButton *tokenDatabasePathButton = new QPushButton("..."); QPushButton *tokenDatabasePathButton = new QPushButton("...");
connect(tokenDatabasePathButton, SIGNAL(clicked()), this, SLOT(tokenDatabasePathButtonClicked())); connect(tokenDatabasePathButton, SIGNAL(clicked()), this, SLOT(tokenDatabasePathButtonClicked()));
// Required init here to avoid crashing on Portable builds
resetAllPathsButton = new QPushButton; resetAllPathsButton = new QPushButton;
bool isPortable = settings.getIsPortableBuild();
bool isPortable = true; // settings.getIsPortableBuild();
if (isPortable) { if (isPortable) {
deckPathEdit->setEnabled(false); deckPathEdit->setEnabled(false);
replaysPathEdit->setEnabled(false); replaysPathEdit->setEnabled(false);
@ -303,9 +305,7 @@ void GeneralSettingsPage::retranslateUi()
updateNotificationCheckBox.setText(tr("Notify if a feature supported by the server is missing in my client")); updateNotificationCheckBox.setText(tr("Notify if a feature supported by the server is missing in my client"));
newVersionOracleCheckBox.setText(tr("Automatically run Oracle when running a new version of Cockatrice")); newVersionOracleCheckBox.setText(tr("Automatically run Oracle when running a new version of Cockatrice"));
showTipsOnStartup.setText(tr("Show tips on startup")); showTipsOnStartup.setText(tr("Show tips on startup"));
if (resetAllPathsButton) { resetAllPathsButton->setText(tr("Reset all paths"));
resetAllPathsButton->setText(tr("Reset all paths"));
}
const auto &settings = SettingsCache::instance(); const auto &settings = SettingsCache::instance();