Skip to content

Commit

Permalink
[libmce-glib] Added mce_display_remove_handlers
Browse files Browse the repository at this point in the history
Removes multiple handlers in one shot
  • Loading branch information
monich committed Nov 12, 2016
1 parent 6356120 commit 9b0fa09
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions include/mce_display.h
Expand Up @@ -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 */
Expand Down
22 changes: 19 additions & 3 deletions src/mce_display.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -154,7 +162,6 @@ mce_display_valid_changed(
}
}


static
void
mce_display_status_ind(
Expand Down Expand Up @@ -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
*==========================================================================*/
Expand Down

0 comments on commit 9b0fa09

Please sign in to comment.