@@ -1637,7 +1637,7 @@ void Playlist::ItemsLoaded() {
|
||||
|
||||
// Should we gray out deleted songs asynchronously on startup?
|
||||
if (greyout) {
|
||||
(void)QtConcurrent::run(&Playlist::InvalidateDeletedSongs, this);
|
||||
InvalidateDeletedSongs();
|
||||
}
|
||||
|
||||
Q_EMIT PlaylistLoaded();
|
||||
@@ -1921,18 +1921,6 @@ void Playlist::ReloadItems(const QList<int> &rows) {
|
||||
|
||||
}
|
||||
|
||||
void Playlist::ReloadItemsBlocking(const QList<int> &rows) {
|
||||
|
||||
for (const int row : rows) {
|
||||
PlaylistItemPtr item = item_at(row);
|
||||
const Song old_metadata = item->Metadata();
|
||||
item->Reload();
|
||||
QPersistentModelIndex idx = index(row, 0);
|
||||
ItemReloadComplete(idx, old_metadata, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Playlist::Shuffle() {
|
||||
|
||||
PlaylistItemPtrList new_items(items_);
|
||||
@@ -2312,8 +2300,8 @@ void Playlist::InvalidateDeletedSongs() {
|
||||
PlaylistItemPtr item = items_.value(row);
|
||||
const Song song = item->Metadata();
|
||||
|
||||
if (song.url().isLocalFile()) {
|
||||
bool exists = QFile::exists(song.url().toLocalFile());
|
||||
if (song.url().isValid() && song.url().isLocalFile()) {
|
||||
const bool exists = QFile::exists(song.url().toLocalFile());
|
||||
|
||||
if (!exists && !item->HasForegroundColor(kInvalidSongPriority)) {
|
||||
// Gray out the song if it's not there
|
||||
@@ -2328,12 +2316,7 @@ void Playlist::InvalidateDeletedSongs() {
|
||||
}
|
||||
|
||||
if (!invalidated_rows.isEmpty()) {
|
||||
if (QThread::currentThread() == thread()) {
|
||||
ReloadItems(invalidated_rows);
|
||||
}
|
||||
else {
|
||||
ReloadItemsBlocking(invalidated_rows);
|
||||
}
|
||||
ReloadItems(invalidated_rows);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user