diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-10-06 19:01:00 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-07 07:56:44 +0100 |
commit | d120755d15b633ee1fe962672ace1493a40e361e (patch) | |
tree | c2828a57c83aaba55118ffe17ce73ba440476144 | |
parent | 4eb0c77d8578190efbd8fa10ed6665968e1a4379 (diff) | |
download | subsurface-d120755d15b633ee1fe962672ace1493a40e361e.tar.gz |
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>
-rw-r--r-- | qt-ui/preferences.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 715745e84..6450c41cb 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -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++) { |