aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-08 19:27:22 +0100
committerMax Kellermann <max@duempel.org>2014-01-08 19:49:34 +0100
commit5c6fe97b350325396b4c7f168da37d25b26c3044 (patch)
treec9c1f8e900dbdfc688a47e516c44d2dc1c2cd2a6 /src
parent2071070f39216accc02550102017e4f8abb9b5ea (diff)
downloadmpd-5c6fe97b350325396b4c7f168da37d25b26c3044.tar.gz
mpd-5c6fe97b350325396b4c7f168da37d25b26c3044.tar.xz
mpd-5c6fe97b350325396b4c7f168da37d25b26c3044.zip
playlist/pls: simplify error handler
Don't pass a GError** to g_key_file_get_X(). We don't need to dispose something we didn't request in the first place.
Diffstat (limited to 'src')
-rw-r--r--src/playlist/PlsPlaylistPlugin.cxx15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/playlist/PlsPlaylistPlugin.cxx b/src/playlist/PlsPlaylistPlugin.cxx
index 046a9f8c8..6994c8a3d 100644
--- a/src/playlist/PlsPlaylistPlugin.cxx
+++ b/src/playlist/PlsPlaylistPlugin.cxx
@@ -81,25 +81,18 @@ pls_parser(GKeyFile *keyfile, std::forward_list<SongPointer> &songs)
sprintf(key, "Title%u", num_entries);
value = g_key_file_get_string(keyfile, "playlist", key,
- &error);
- if (error == nullptr && value != nullptr)
+ nullptr);
+ if (value != nullptr)
tag.AddItem(TAG_TITLE, value);
- /* Ignore errors? Most likely value not present */
- if(error) g_error_free(error);
- error = nullptr;
g_free(value);
sprintf(key, "Length%u", num_entries);
length = g_key_file_get_integer(keyfile, "playlist", key,
- &error);
- if (error == nullptr && length > 0)
+ nullptr);
+ if (length > 0)
tag.SetTime(length);
- /* Ignore errors? Most likely value not present */
- if(error) g_error_free(error);
- error = nullptr;
-
song->tag = tag.CommitNew();
songs.emplace_front(song);
num_entries--;