Partial revert commit af67de8
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtConcurrent>
|
||||
#include <QFuture>
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
@@ -285,15 +286,16 @@ void EditTagDialog::SetSongs(const SongList &s, const PlaylistItemList &items) {
|
||||
ui_->song_list->clear();
|
||||
|
||||
// Reload tags in the background
|
||||
(void)QtConcurrent::run([=]{ SetSongsFinished(LoadData(s)); });
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(this, &EditTagDialog::LoadData, s);
|
||||
NewClosure(future, this, SLOT(SetSongsFinished(QFuture<QList<EditTagDialog::Data>>)), future);
|
||||
|
||||
}
|
||||
|
||||
void EditTagDialog::SetSongsFinished(QList<Data> _data) {
|
||||
void EditTagDialog::SetSongsFinished(QFuture<QList<Data>> future) {
|
||||
|
||||
if (!SetLoading(QString())) return;
|
||||
|
||||
data_ = _data;
|
||||
data_ = future.result();
|
||||
if (data_.count() == 0) {
|
||||
// If there were no valid songs, disable everything
|
||||
ui_->song_list->setEnabled(false);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QObject>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDialog>
|
||||
#include <QFuture>
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
#include <QString>
|
||||
@@ -99,7 +100,7 @@ class EditTagDialog : public QDialog {
|
||||
};
|
||||
|
||||
private slots:
|
||||
void SetSongsFinished(QList<Data> _data);
|
||||
void SetSongsFinished(QFuture<QList<EditTagDialog::Data>> future);
|
||||
void AcceptFinished();
|
||||
|
||||
void SelectionChanged();
|
||||
|
||||
Reference in New Issue
Block a user