aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2009-01-25 16:23:02 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 16:37:29 +0100
commitb6c3adcaaaee10721cb568e439ef7a1b41dc5564 (patch)
tree77a361e15fd3c590b6f9751437380ebe2a7521a0
parent3635c93acbc3da87880e886d924020c427d1774a (diff)
downloadmpd-b6c3adcaaaee10721cb568e439ef7a1b41dc5564.tar.gz
mpd-b6c3adcaaaee10721cb568e439ef7a1b41dc5564.tar.xz
mpd-b6c3adcaaaee10721cb568e439ef7a1b41dc5564.zip
Add idle event on sticker deletion, update and insertion
-rw-r--r--src/idle.c2
-rw-r--r--src/idle.h3
-rw-r--r--src/sticker.c5
3 files changed, 9 insertions, 1 deletions
diff --git a/src/idle.c b/src/idle.c
index 26c15c48b..a29174314 100644
--- a/src/idle.c
+++ b/src/idle.c
@@ -38,7 +38,7 @@ static const char *const idle_names[] = {
"mixer",
"output",
"options",
- "elapsed",
+ "sticker",
NULL
};
diff --git a/src/idle.h b/src/idle.h
index d65575ebe..99f1e8555 100644
--- a/src/idle.h
+++ b/src/idle.h
@@ -46,6 +46,9 @@ enum {
/** options have changed: crossfade, random, repeat, ... */
IDLE_OPTIONS = 0x40,
+
+ /** a sticker has been modified. */
+ IDLE_STICKER = 0x80,
};
/**
diff --git a/src/sticker.c b/src/sticker.c
index e596fd97c..1c838983b 100644
--- a/src/sticker.c
+++ b/src/sticker.c
@@ -17,6 +17,7 @@
*/
#include "sticker.h"
+#include "idle.h"
#include <glib.h>
#include <sqlite3.h>
@@ -239,6 +240,7 @@ sticker_update_value(const char *type, const char *uri,
sqlite3_reset(sticker_stmt_update);
sqlite3_clear_bindings(sticker_stmt_update);
+ idle_add(IDLE_STICKER);
return ret > 0;
}
@@ -299,6 +301,8 @@ sticker_insert_value(const char *type, const char *uri,
sqlite3_reset(sticker_stmt_insert);
sqlite3_clear_bindings(sticker_stmt_insert);
+
+ idle_add(IDLE_STICKER);
return true;
}
@@ -357,5 +361,6 @@ sticker_delete(const char *type, const char *uri)
sqlite3_reset(sticker_stmt_delete);
sqlite3_clear_bindings(sticker_stmt_delete);
+ idle_add(IDLE_STICKER);
return true;
}