1
0
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:
Ovidiu Sabou 2015-03-04 00:04:16 +02:00
parent b155830e4c
commit 75f5901aec
2 changed files with 20 additions and 0 deletions

View File

@ -36,6 +36,16 @@
#include <QBuffer> #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) : ProfileForm::ProfileForm(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
@ -318,3 +328,9 @@ void ProfileForm::enableSwitching()
bodyUI->newButton->setEnabled(true); bodyUI->newButton->setEnabled(true);
} }
} }
void ProfileForm::showEvent(QShowEvent *event)
{
refreshProfiles();
QWidget::showEvent(event);
}

View File

@ -69,7 +69,11 @@ private slots:
void disableSwitching(); void disableSwitching();
void enableSwitching(); void enableSwitching();
protected:
virtual void showEvent(QShowEvent *);
private: private:
void refreshProfiles();
Ui::IdentitySettings* bodyUI; Ui::IdentitySettings* bodyUI;
MaskablePixmapWidget* profilePicture; MaskablePixmapWidget* profilePicture;
Core* core; Core* core;