Skip to content

Commit

Permalink
preferences: Fix preferences initialization at startup, don't rely on
Browse files Browse the repository at this point in the history
showEvent() to initialize them.

Signed-off-by: Alexandra Trifan <[email protected]>
  • Loading branch information
AlexandraTrifan committed Mar 18, 2022
1 parent 4107964 commit 895c0e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ Preferences::Preferences(QWidget *parent) :
requestRestart();
});
pref_ptr = this;
initializePreferences();
}

void Preferences::save() {
Expand Down Expand Up @@ -403,7 +404,7 @@ void Preferences::notifyChange()
Q_EMIT notify();
}

void Preferences::showEvent(QShowEvent *event)
void Preferences::initializePreferences()
{

setDynamicProperty(ui->sigGenNrPeriods, "invalid", false);
Expand Down Expand Up @@ -452,7 +453,11 @@ void Preferences::showEvent(QShowEvent *event)
ui->loggingUnavailableLabel->setVisible(true);
m_logging_enabled = false;
#endif
}

void Preferences::showEvent(QShowEvent *event)
{
initializePreferences();
QWidget::showEvent(event);
}

Expand Down
1 change: 1 addition & 0 deletions src/preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ private Q_SLOTS:
Preferences_API *pref_api;

ScopyColorEditor *m_colorEditor;
void initializePreferences();
};

class Preferences_API : public ApiObject
Expand Down

0 comments on commit 895c0e9

Please sign in to comment.