Simplify code

Do not call the setAttributte *everytime* the Preferences
is called, call it once on the constructor.

Also, no need to call the LanguageModel::instance() on the
instance method, it will be already called on the constructor
it seems that it's a leftover from a long while.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-10-06 19:01:00 -03:00 committed by Dirk Hohndel
parent 4eb0c77d85
commit d120755d15

View file

@ -23,14 +23,13 @@
PreferencesDialog *PreferencesDialog::instance()
{
static PreferencesDialog *dialog = new PreferencesDialog(MainWindow::instance());
dialog->setAttribute(Qt::WA_QuitOnClose, false);
LanguageModel::instance();
return dialog;
}
PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
{
ui.setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false);
#if defined(Q_OS_ANDROID) || !defined(FBSUPPORT)
for (int i = 0; i < ui.listWidget->count(); i++) {