diff options
Diffstat (limited to '')
-rw-r--r-- | src/ClientIdle.cxx (renamed from src/client_idle.c) | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/client_idle.c b/src/ClientIdle.cxx index 930911d6e..f9818b278 100644 --- a/src/client_idle.c +++ b/src/ClientIdle.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,9 +18,10 @@ */ #include "config.h" -#include "client_idle.h" -#include "client_internal.h" -#include "idle.h" +#include "ClientIdle.hxx" +#include "ClientInternal.hxx" +#include "ClientList.hxx" +#include "Idle.hxx" #include <assert.h> @@ -28,7 +29,7 @@ * Send "idle" response to this client. */ static void -client_idle_notify(struct client *client) +client_idle_notify(Client *client) { unsigned flags, i; const char *const* idle_names; @@ -52,23 +53,20 @@ client_idle_notify(struct client *client) } void -client_idle_add(struct client *client, unsigned flags) +client_idle_add(Client *client, unsigned flags) { - if (client_is_expired(client)) + if (client->IsExpired()) return; client->idle_flags |= flags; if (client->idle_waiting - && (client->idle_flags & client->idle_subscriptions)) { + && (client->idle_flags & client->idle_subscriptions)) client_idle_notify(client); - client_write_output(client); - } } static void -client_idle_callback(gpointer data, gpointer user_data) +client_idle_callback(Client *client, gpointer user_data) { - struct client *client = data; unsigned flags = GPOINTER_TO_UINT(user_data); client_idle_add(client, flags); @@ -81,7 +79,7 @@ void client_manager_idle_add(unsigned flags) client_list_foreach(client_idle_callback, GUINT_TO_POINTER(flags)); } -bool client_idle_wait(struct client *client, unsigned flags) +bool client_idle_wait(Client *client, unsigned flags) { assert(!client->idle_waiting); |