summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 266baf8)
raw | patch | inline | side by side (parent: 266baf8)
author | Max Kellermann <max@duempel.org> | |
Fri, 12 Jun 2009 17:41:07 +0000 (19:41 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 12 Jun 2009 17:41:07 +0000 (19:41 +0200) |
The screen code shouldn't bother to do any callbacks, because screen.c
should only care about the GUI. Move that invocation to the mpdclient
library.
should only care about the GUI. Move that invocation to the mpdclient
library.
src/mpdclient.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history | |
src/screen.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index cc391ab1a41a745334ca0cb1c44d320f660d4546..496d904129968038ea4e106030483682a56149ed 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
if ((retval=mpdclient_finish_command(c)))
return retval;
+ if (c->updatingdb && c->updatingdb != c->status->updatingDb)
+ mpdclient_browse_callback(c, BROWSE_DB_UPDATED, NULL);
+
+ c->updatingdb = c->status->updatingDb;
+
/* check if the playlist needs an update */
if (c->playlist.id != c->status->playlist) {
if (playlist_is_empty(&c->playlist))
/* set updatingDb to make sure the browse callback
gets called even if the update has finished before
status is updated */
- c->status->updatingDb = 1;
+ c->updatingdb = 1;
return ret;
}
diff --git a/src/mpdclient.h b/src/mpdclient.h
index dc7cbf976b8d4939822fdbbc8f3cf8cee1082aa5..c2ba4767356bb1441c168c7409bb5ef0da620d27 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
mpd_Song *song;
gboolean need_update;
+
+ int updatingdb;
} mpdclient_t;
/** functions ***************************************************************/
diff --git a/src/screen.c b/src/screen.c
index 929766b998a8593306af867207f026285a133451..200f9dbb67d27f188f264f9d3877462d01b6e60b 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
if (dbupdate && dbupdate != c->status->updatingDb) {
screen_status_printf(_("Database updated"));
- mpdclient_browse_callback(c, BROWSE_DB_UPDATED, NULL);
}
repeat = c->status->repeat;