Fix crash in SettingsDialog with delayed initialization
authorMichael Schuster <michael@schuster.ms>
Thu, 22 Oct 2020 02:14:09 +0000 (04:14 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Thu, 22 Oct 2020 11:29:38 +0000 (11:29 +0000)
setWindowFlags triggered changeEvent, thus causing a crash in customizeStyle.

This fix should be kept even if we decide against delayed init in the future.

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/settingsdialog.cpp

index 20b145a3cc17b2283f4f110ea10facb6defc76e9..1722ae9d9afd94625501678f205d637f6a7a0301 100644 (file)
@@ -62,7 +62,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
 {
     ConfigFile cfg;
 
-    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
     _ui->setupUi(this);
     _toolBar = new QToolBar;
     _toolBar->setIconSize(QSize(32, 32));
@@ -130,6 +129,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
 
     customizeStyle();
 
+    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
     cfg.restoreGeometry(this);
 }