From 9270a83a78a5487117b9d0558b26afbda50de7ee Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 22 Mar 2009 20:01:39 +0100 Subject: [PATCH] invoke callback immediately after sending update command succesfully --- src/mpdpp.cpp | 5 +++++ src/ncmpcpp.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index c13c6aaf..77f99616 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -192,7 +192,12 @@ void Connection::UpdateDirectory(const string &path) mpd_sendUpdateCommand(itsConnection, path.c_str()); mpd_finishCommand(itsConnection); if (!itsConnection->error) + { itsCurrentStatus->updatingDb = 1; + StatusChanges ch; + ch.DBUpdating = 1; + itsUpdater(this, ch, itsErrorHandlerUserdata); + } } } diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 8cb141a9..ee6e20aa 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -1061,7 +1061,6 @@ int main(int argc, char *argv[]) # endif // HAVE_TAGLIB_H else Mpd->UpdateDirectory("/"); - Mpd->UpdateStatus(); } else if (Keypressed(input, Key.GoToNowPlaying)) {