Skip to content

Commit

Permalink
Use queued connections instead of singleSlot timers.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckaiser committed Mar 26, 2016
1 parent 2debb24 commit dd91622
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions dialogs/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
}
#endif

QTimer::singleShot(0, this, SLOT(init()));
QTimer::singleShot(1, this, SLOT(loadSettings()));
QMetaObject::invokeMethod(this, "init" , Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "loadSettings", Qt::QueuedConnection);
}

void OptionsDialog::accepted()
Expand Down Expand Up @@ -219,7 +219,6 @@ void OptionsDialog::importSettings()

void OptionsDialog::imgurRequestAlbumList()
{

QString username = settings()->value("upload/imgur/account_username").toString();

if (username.isEmpty()) {
Expand Down Expand Up @@ -426,8 +425,8 @@ void OptionsDialog::loadSettings()
settings()->endGroup();
settings()->endGroup();

QTimer::singleShot(0, this, SLOT(updatePreview()));
QTimer::singleShot(1, this, SLOT(imgurRequestAlbumList()));
QMetaObject::invokeMethod(this, "updatePreview", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "imgurRequestAlbumList", Qt::QueuedConnection);

setEnabled(true);
setUpdatesEnabled(true);
Expand Down Expand Up @@ -577,7 +576,7 @@ bool OptionsDialog::event(QEvent *event)
event->ignore();
return false;
}
} else if (event->type() == QEvent::Show) {
} else if (event->type() == QEvent::Show && settings()->contains("geometry/optionsDialog")) {
restoreGeometry(settings()->value("geometry/optionsDialog").toByteArray());
}

Expand Down

0 comments on commit dd91622

Please sign in to comment.