[libmce-glib] Added mce_display_remove_handlers

Removes multiple handlers in one shot
This commit is contained in:
Slava Monich
2016-11-12 13:10:33 +03:00
parent 63561206d6
commit 9b0fa09fda
2 changed files with 25 additions and 3 deletions

View File

@@ -90,6 +90,12 @@ mce_display_remove_handler(
MceDisplay* display,
gulong id);
void
mce_display_remove_handlers(
MceDisplay* display,
gulong *ids,
guint count);
G_END_DECLS
#endif /* MCE_DISPLAY_H */

View File

@@ -38,8 +38,10 @@
#include "mce_proxy.h"
#include "mce_log_p.h"
#include "mce/dbus-names.h"
#include "mce/mode-names.h"
#include <mce/dbus-names.h>
#include <mce/mode-names.h>
#include <gutil_misc.h>
/* Generated headers */
#include "com.nokia.mce.request.h"
@@ -117,6 +119,12 @@ mce_display_status_query_done(
mce_display_status_update(self, status);
g_free(status);
} else {
/*
* We could retry but it's probably not worth the trouble
* because the next time display state changes we receive
* display_status_ind signal and sync our state with mce.
* Until then, this object stays invalid.
*/
GWARN("Failed to query display state %s", GERRMSG(error));
g_error_free(error);
}
@@ -154,7 +162,6 @@ mce_display_valid_changed(
}
}
static
void
mce_display_status_ind(
@@ -236,6 +243,15 @@ mce_display_remove_handler(
}
}
void
mce_display_remove_handlers(
MceDisplay* self,
gulong *ids,
guint count)
{
gutil_disconnect_handlers(self, ids, count);
}
/*==========================================================================*
* Internals
*==========================================================================*/