1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Use an enum instead of hardcoded values for the user-injected codes

This commit is contained in:
Paul Cercueil
2013-07-21 23:52:35 -04:00
parent a0515ad356
commit b0fa6db97d
4 changed files with 31 additions and 11 deletions

View File

@@ -8,13 +8,14 @@
#include <sys/inotify.h>
#include <unistd.h>
#include "inputmanager.h"
#include "monitor.h"
void Monitor::inject_event(bool is_add, const char *path)
{
SDL_UserEvent e = {
.type = SDL_USEREVENT,
.code = (int) is_add,
.code = is_add ? OPEN_PACKAGE : REMOVE_LINKS,
.data1 = strdup(path),
.data2 = NULL,
};