diff --git a/src/mpdclient.c b/src/mpdclient.c
index 4882d548f1b21563112626f59bfd7489134d8429..ec058061546c23cf1033076d220b267745ff2949 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
/* ncmpc (Ncurses MPD Client)
* (c) 2004-2010 The Music Player Daemon Project
* Project homepage: http://musicpd.org
-
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
+ */
#include "mpdclient.h"
#include "filelist.h"
return false;
}
-static bool
-mpdclient_finish_command(struct mpdclient *c)
-{
- return mpd_response_finish(c->connection)
- ? true : mpdclient_handle_error(c);
-}
-
struct mpdclient *
mpdclient_new(void)
{
c->song = NULL;
/* everything has changed after a disconnect */
- c->events |= MPD_IDLE_DATABASE|MPD_IDLE_STORED_PLAYLIST|
- MPD_IDLE_QUEUE|MPD_IDLE_PLAYER|MPD_IDLE_MIXER|MPD_IDLE_OUTPUT|
- MPD_IDLE_OPTIONS|MPD_IDLE_UPDATE;
+ c->events |= MPD_IDLE_ALL;
}
bool
const gchar *password)
{
/* close any open connection */
- if( c->connection )
+ if (c->connection)
mpdclient_disconnect(c);
/* connect to MPD */
if (connection == NULL)
return false;
- mpd_send_add(connection, path_utf8);
- return mpdclient_finish_command(c);
+ return mpd_send_add(connection, path_utf8)?
+ mpdclient_finish_command(c) : false;
}
bool