Remove use of std::bind where possible
This commit is contained in:
parent
a155e503f4
commit
deddaed04a
|
@ -893,7 +893,11 @@ void CollectionModel::LazyPopulate(CollectionItem *parent, const bool signal) {
|
|||
}
|
||||
|
||||
void CollectionModel::ResetAsync() {
|
||||
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(std::bind(&CollectionModel::RunQuery, this, root_));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(&CollectionModel::RunQuery, this, root_);
|
||||
#else
|
||||
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(this, &CollectionModel::RunQuery, root_);
|
||||
#endif
|
||||
NewClosure(future, this, SLOT(ResetAsyncQueryFinished(QFuture<CollectionModel::QueryResult>)), future);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,11 @@ DeviceManager::DeviceManager(Application *app, QObject *parent)
|
|||
connect(this, SIGNAL(DeviceCreatedFromDB(DeviceInfo*)), SLOT(AddDeviceFromDB(DeviceInfo*)));
|
||||
|
||||
// This reads from the database and contents on the database mutex, which can be very slow on startup.
|
||||
(void)QtConcurrent::run(&thread_pool_, std::bind(&DeviceManager::LoadAllDevices, this));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
(void)QtConcurrent::run(&thread_pool_, &DeviceManager::LoadAllDevices, this);
|
||||
#else
|
||||
(void)QtConcurrent::run(&thread_pool_, this, &DeviceManager::LoadAllDevices);
|
||||
#endif
|
||||
|
||||
// This proxy model only shows connected devices
|
||||
connected_devices_model_ = new DeviceStateFilterModel(this);
|
||||
|
|
|
@ -293,7 +293,11 @@ void EditTagDialog::SetSongs(const SongList &s, const PlaylistItemList &items) {
|
|||
ui_->song_list->clear();
|
||||
|
||||
// Reload tags in the background
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(std::bind(&EditTagDialog::LoadData, this, s));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(&EditTagDialog::LoadData, this, s);
|
||||
#else
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(this, &EditTagDialog::LoadData, s);
|
||||
#endif
|
||||
NewClosure(future, this, SLOT(SetSongsFinished(QFuture<QList<EditTagDialog::Data>>)), future);
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,11 @@
|
|||
#include "gststartup.h"
|
||||
|
||||
GstStartup::GstStartup(QObject *parent) : QObject(parent) {
|
||||
initializing_ = QtConcurrent::run([=]{ InitializeGStreamer(); });
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
initializing_ = QtConcurrent::run(&GstStartup::InitializeGStreamer, this);
|
||||
#else
|
||||
initializing_ = QtConcurrent::run(this, &GstStartup::InitializeGStreamer);
|
||||
#endif
|
||||
}
|
||||
|
||||
GstStartup::~GstStartup() {}
|
||||
|
|
|
@ -387,8 +387,11 @@ bool OrganizeDialog::SetUrls(const QList<QUrl> &urls) {
|
|||
}
|
||||
|
||||
bool OrganizeDialog::SetFilenames(const QStringList &filenames) {
|
||||
|
||||
songs_future_ = QtConcurrent::run(std::bind(&OrganizeDialog::LoadSongsBlocking, this, filenames));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
songs_future_ = QtConcurrent::run(&OrganizeDialog::LoadSongsBlocking, this, filenames);
|
||||
#else
|
||||
songs_future_ = QtConcurrent::run(this, &OrganizeDialog::LoadSongsBlocking, filenames);
|
||||
#endif
|
||||
NewClosure(songs_future_, [=]() { SetSongs(songs_future_.result()); });
|
||||
|
||||
SetLoadingSongs(true);
|
||||
|
|
|
@ -1406,7 +1406,11 @@ void Playlist::Restore() {
|
|||
collection_items_by_id_.clear();
|
||||
|
||||
cancel_restore_ = false;
|
||||
QFuture<QList<PlaylistItemPtr>> future = QtConcurrent::run(std::bind(&PlaylistBackend::GetPlaylistItems, backend_, id_));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QFuture<QList<PlaylistItemPtr>> future = QtConcurrent::run(&PlaylistBackend::GetPlaylistItems, backend_, id_);
|
||||
#else
|
||||
QFuture<QList<PlaylistItemPtr>> future = QtConcurrent::run(backend_, &PlaylistBackend::GetPlaylistItems, id_);
|
||||
#endif
|
||||
NewClosure(future, this, SLOT(ItemsLoaded(QFuture<PlaylistItemList>)), future);
|
||||
|
||||
}
|
||||
|
@ -1461,7 +1465,11 @@ void Playlist::ItemsLoaded(QFuture<PlaylistItemList> future) {
|
|||
|
||||
// Should we gray out deleted songs asynchronously on startup?
|
||||
if (greyout) {
|
||||
(void)QtConcurrent::run(std::bind(&Playlist::InvalidateDeletedSongs, this));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
(void)QtConcurrent::run(&Playlist::InvalidateDeletedSongs, this);
|
||||
#else
|
||||
(void)QtConcurrent::run(this, &Playlist::InvalidateDeletedSongs);
|
||||
#endif
|
||||
}
|
||||
|
||||
emit PlaylistLoaded();
|
||||
|
|
|
@ -215,7 +215,11 @@ void PlaylistManager::Save(const int id, const QString &filename, const Playlist
|
|||
}
|
||||
else {
|
||||
// Playlist is not in the playlist manager: probably save action was triggered from the left side bar and the playlist isn't loaded.
|
||||
QFuture<QList<Song>> future = QtConcurrent::run(std::bind(&PlaylistBackend::GetPlaylistSongs, playlist_backend_, id));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QFuture<QList<Song>> future = QtConcurrent::run(&PlaylistBackend::GetPlaylistSongs, playlist_backend_, id);
|
||||
#else
|
||||
QFuture<QList<Song>> future = QtConcurrent::run(playlist_backend_, &PlaylistBackend::GetPlaylistSongs, id);
|
||||
#endif
|
||||
NewClosure(future, this, SLOT(ItemsLoadedForSavePlaylist(QFuture<SongList>, QString, Playlist::Path)), future, filename, path_type);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,11 @@ void SongLoaderInserter::Load(Playlist *destination, int row, bool play_now, boo
|
|||
deleteLater();
|
||||
}
|
||||
else {
|
||||
(void)QtConcurrent::run([=]{ AsyncLoad(); });
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
(void)QtConcurrent::run(&SongLoaderInserter::AsyncLoad, this);
|
||||
#else
|
||||
(void)QtConcurrent::run(this, &SongLoaderInserter::AsyncLoad);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue