Call fixPath so that correct URL is passed

This commit is contained in:
Craig Drummond
2015-06-19 22:55:51 +01:00
committed by Craig Drummond
parent 54f615cc77
commit 97271a60d1
3 changed files with 9 additions and 4 deletions

View File

@@ -271,8 +271,10 @@ QList<Song> SearchModel::songs(const QModelIndexList &indexes, bool allowPlaylis
}
Song *song=static_cast<Song *>(index.internalPointer());
if ((allowPlaylists || Song::Playlist!=song->type) && !files.contains(song->file)) {
list << *song;
files << song->file;
Song s=*song;
fixPath(s);
list << s;
files << s.file;
}
}
return list;

View File

@@ -85,6 +85,7 @@ Q_SIGNALS:
void statsUpdated(int songs, quint32 time);
protected:
virtual Song & fixPath(Song &s) const { return s; }
void results(const QList<Song> &songs);
const Song * toSong(const QModelIndex &index) const { return index.isValid() ? static_cast<const Song *>(index.internalPointer()) : 0; }

View File

@@ -512,7 +512,8 @@ QList<Song> PodcastService::songs(const QModelIndexList &indexes, bool allowPlay
Podcast *podcast=static_cast<Podcast *>(item);
foreach (const Episode *episode, podcast->episodes) {
selectedPodcasts.insert(item);
songs.append(episode->toSong());
Song s=episode->toSong();
songs.append(fixPath(s));
}
}
}
@@ -521,7 +522,8 @@ QList<Song> PodcastService::songs(const QModelIndexList &indexes, bool allowPlay
if (!item->isPodcast()) {
Episode *episode=static_cast<Episode *>(item);
if (!selectedPodcasts.contains(episode->parent)) {
songs.append(episode->toSong());
Song s=episode->toSong();
songs.append(fixPath(s));
}
}
}