diff --git a/src/core/deletefiles.cpp b/src/core/deletefiles.cpp index 98a623cde..2a699c9d8 100644 --- a/src/core/deletefiles.cpp +++ b/src/core/deletefiles.cpp @@ -23,10 +23,10 @@ #include #include -#include #include #include #include +#include #include "taskmanager.h" #include "song.h" @@ -123,6 +123,6 @@ void DeleteFiles::ProcessSomeFiles() { } } - QTimer::singleShot(0, this, &DeleteFiles::ProcessSomeFiles); + QMetaObject::invokeMethod(this, &DeleteFiles::ProcessSomeFiles); } diff --git a/src/queue/queueview.cpp b/src/queue/queueview.cpp index 4f2445cde..18ee32cf0 100644 --- a/src/queue/queueview.cpp +++ b/src/queue/queueview.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -120,7 +120,7 @@ void QueueView::CurrentPlaylistChanged(Playlist *playlist) { QObject::connect(ui_->list->selectionModel(), &QItemSelectionModel::currentChanged, this, &QueueView::UpdateButtonState); QObject::connect(ui_->list->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QueueView::UpdateButtonState); - QTimer::singleShot(0, current_playlist_->queue(), &Queue::UpdateSummaryText); + QMetaObject::invokeMethod(current_playlist_->queue(), &Queue::UpdateSummaryText); } diff --git a/src/smartplaylists/smartplaylistsearchtermwidget.cpp b/src/smartplaylists/smartplaylistsearchtermwidget.cpp index ae7acbd0e..93a081394 100644 --- a/src/smartplaylists/smartplaylistsearchtermwidget.cpp +++ b/src/smartplaylists/smartplaylistsearchtermwidget.cpp @@ -21,7 +21,6 @@ #include "config.h" #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -292,7 +292,7 @@ void SmartPlaylistSearchTermWidget::resizeEvent(QResizeEvent *e) { QWidget::resizeEvent(e); if (overlay_ && overlay_->isVisible()) { - QTimer::singleShot(0, this, &SmartPlaylistSearchTermWidget::Grab); + QMetaObject::invokeMethod(this, &SmartPlaylistSearchTermWidget::Grab); } } @@ -301,7 +301,7 @@ void SmartPlaylistSearchTermWidget::showEvent(QShowEvent *e) { QWidget::showEvent(e); if (overlay_) { - QTimer::singleShot(0, this, &SmartPlaylistSearchTermWidget::Grab); + QMetaObject::invokeMethod(this, &SmartPlaylistSearchTermWidget::Grab); } } diff --git a/src/widgets/loginstatewidget.cpp b/src/widgets/loginstatewidget.cpp index c43617137..5135e7917 100644 --- a/src/widgets/loginstatewidget.cpp +++ b/src/widgets/loginstatewidget.cpp @@ -24,9 +24,9 @@ #include #include -#include #include #include +#include #include #include #include @@ -91,7 +91,7 @@ void LoginStateWidget::SetLoggedIn(const State state, const QString &account_nam // A login just failed - give focus back to the last crediental field (usually password). // We have to do this after control gets back to the // event loop because the user might have just closed a dialog and our widget might not be active yet. - QTimer::singleShot(0, this, &LoginStateWidget::FocusLastCredentialField); + QMetaObject::invokeMethod(this, &LoginStateWidget::FocusLastCredentialField); } }