mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Refresh the available profiles when the profile page is shown. Fix regression for #1012
I carelessly removed perfectly good code from the present() method and this commit brings that back
This commit is contained in:
parent
b155830e4c
commit
75f5901aec
|
@ -36,6 +36,16 @@
|
|||
#include <QBuffer>
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user