diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index c0d9357af..9084a23c3 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -36,6 +36,16 @@ #include +void ProfileForm::refreshProfiles() +{ + bodyUI->profiles->clear(); + for (QString profile : Settings::getInstance().searchProfiles()) + bodyUI->profiles->addItem(profile); + QString current = Settings::getInstance().getCurrentProfile(); + if (current != "") + bodyUI->profiles->setCurrentText(current); +} + ProfileForm::ProfileForm(QWidget *parent) : QWidget(parent) { @@ -318,3 +328,9 @@ void ProfileForm::enableSwitching() bodyUI->newButton->setEnabled(true); } } + +void ProfileForm::showEvent(QShowEvent *event) +{ + refreshProfiles(); + QWidget::showEvent(event); +} diff --git a/src/widget/form/profileform.h b/src/widget/form/profileform.h index 796341e36..daca69c20 100644 --- a/src/widget/form/profileform.h +++ b/src/widget/form/profileform.h @@ -69,7 +69,11 @@ private slots: void disableSwitching(); void enableSwitching(); +protected: + virtual void showEvent(QShowEvent *); + private: + void refreshProfiles(); Ui::IdentitySettings* bodyUI; MaskablePixmapWidget* profilePicture; Core* core;