diff options
| author | Mike Skec <skec@protonmail.ch> | 2020-12-31 18:59:04 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-31 10:57:55 +0100 |
| commit | 1a4765d778c611c9dc2920518dd9622eec0fbd98 (patch) | |
| tree | 7a524aceec2290bff389d5ebf284fdb4af138886 /src/mainwindow.cpp | |
| parent | 40df924bc7289155a21a7c4ee901fc7c5e1673bd (diff) | |
| download | kristall-1a4765d778c611c9dc2920518dd9622eec0fbd98.tar.gz | |
Fix segfault when opening settings dialog with no tabs
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5f2a7d2..f9266bc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -291,21 +291,21 @@ void MainWindow::on_actionSettings_triggered() dialog.setHttpsSslTrust(kristall::trust::https); // We use this to disable url bar styling - // while we view settings, so that theme - // stays applied. - settings_visible = true; - this->curTab()->updateUrlBarStyle(); + // while we view Settings dialog, so that the URL bar + // doesn't look weird after changing theme. + static const auto update_url_style = [this](bool vis) { + this->settings_visible = vis; + if (this->curTab()) this->curTab()->updateUrlBarStyle(); + }; + update_url_style(true); if(dialog.exec() != QDialog::Accepted) { kristall::setTheme(kristall::options.theme); - - settings_visible = false; - this->curTab()->updateUrlBarStyle(); - + update_url_style(false); return; } - settings_visible = false; + update_url_style(false); kristall::trust::gemini = dialog.geminiSslTrust(); kristall::trust::https = dialog.httpsSslTrust(); |
