summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb04b19)
raw | patch | inline | side by side (parent: eb04b19)
author | Max Kellermann <max@duempel.org> | |
Thu, 18 Sep 2008 21:35:12 +0000 (23:35 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 18 Sep 2008 21:35:12 +0000 (23:35 +0200) |
browser_select_entry() checked the entry's "highlight" flag twice: the
first time, it was toggled, and the second time, action was performed
based on the flag. Merge the two checks.
first time, it was toggled, and the second time, action was performed
based on the flag. Merge the two checks.
src/screen_browser.c | patch | blob | history |
diff --git a/src/screen_browser.c b/src/screen_browser.c
index b9ef7d4e734cc87f09c714ec235d3080cf2b8090..f3ec8eda67567cd9c447b3214af886e08bdfa514 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
if (entry->entity->type != MPD_INFO_ENTITY_TYPE_SONG)
return -1;
- if (toggle && entry->flags & HIGHLIGHT)
- entry->flags &= ~HIGHLIGHT;
- else
- entry->flags |= HIGHLIGHT;
-
- if (toggle || entry->flags & HIGHLIGHT) {
+ if (!toggle || (entry->flags & HIGHLIGHT) == 0) {
mpd_Song *song = entry->entity->info.song;
+ entry->flags |= HIGHLIGHT;
+
if (mpdclient_cmd_add(c, song) == 0) {
char buf[BUFSIZE];
/* remove song from playlist */
mpd_Song *song = entry->entity->info.song;
+ entry->flags &= ~HIGHLIGHT;
+
if (song) {
int idx;