Add save all playlists action
This commit is contained in:
committed by
Jonas Kvinge
parent
9449bfa414
commit
962b52bd5b
@@ -650,3 +650,15 @@ void PlaylistManager::RateCurrentSong(const float rating) {
|
||||
void PlaylistManager::RateCurrentSong2(const int rating) {
|
||||
RateCurrentSong(static_cast<float>(rating) / 5.0F);
|
||||
}
|
||||
|
||||
void PlaylistManager::SaveAllPlaylists() {
|
||||
|
||||
const QString path = QFileDialog::getExistingDirectory(nullptr, tr("Select directory for the playlists"), QDir::homePath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
|
||||
for (QMap<int, Data>::const_iterator it = playlists_.constBegin(); it != playlists_.constEnd(); ++it) {
|
||||
const Data &data = *it;
|
||||
const QString filepath = path + "/" + data.name + ".m3u";
|
||||
Save(it.key(), filepath, Playlist::Path_Absolute);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user