aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateWalk.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 22:04:03 +0100
committerMax Kellermann <max@duempel.org>2013-01-02 22:16:05 +0100
commit8331de424a67b137cd83ce817da0fceec647dc2f (patch)
treeb5243fbff385d9732c683cb1efc64eec85f3189f /src/UpdateWalk.cxx
parent98dbdf72b3c35878494df4954a447cec250a835d (diff)
downloadmpd-8331de424a67b137cd83ce817da0fceec647dc2f.tar.gz
mpd-8331de424a67b137cd83ce817da0fceec647dc2f.tar.xz
mpd-8331de424a67b137cd83ce817da0fceec647dc2f.zip
PlaylistInfo: rename class, use std::string
Diffstat (limited to '')
-rw-r--r--src/UpdateWalk.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index 860342001..a34e0028d 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -159,11 +159,12 @@ purge_deleted_from_directory(struct directory *directory)
g_free(path);
}
- struct playlist_metadata *pm, *np;
+ PlaylistInfo *pm, *np;
directory_for_each_playlist_safe(pm, np, directory) {
- if (!directory_child_is_regular(directory, pm->name)) {
+ if (!directory_child_is_regular(directory, pm->name.c_str())) {
db_lock();
- playlist_vector_remove(&directory->playlists, pm->name);
+ playlist_vector_remove(&directory->playlists,
+ pm->name.c_str());
db_unlock();
}
}
@@ -214,9 +215,11 @@ update_playlist_file2(struct directory *directory,
if (!playlist_suffix_supported(suffix))
return false;
+ PlaylistInfo pi(name, st->st_mtime);
+
db_lock();
- if (playlist_vector_update_or_add(&directory->playlists, name,
- st->st_mtime))
+ if (playlist_vector_update_or_add(&directory->playlists,
+ std::move(pi)))
modified = true;
db_unlock();
return true;