desktop-shell/client: Use a proper enum for clock format

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Quentin Glidic 2016-06-23 18:55:21 +02:00 committed by Daniel Stone
parent e8bf959764
commit f9574f2314
1 changed files with 10 additions and 7 deletions

View File

@ -40,6 +40,7 @@
#include <libgen.h>
#include <ctype.h>
#include <time.h>
#include <assert.h>
#include <wayland-client.h>
#include "window.h"
@ -55,6 +56,12 @@
extern char **environ; /* defined by libc */
enum clock_format {
CLOCK_FORMAT_MINUTES,
CLOCK_FORMAT_SECONDS,
CLOCK_FORMAT_NONE
};
struct desktop {
struct display *display;
struct weston_desktop_shell *shell;
@ -90,7 +97,7 @@ struct panel {
struct wl_list launcher_list;
struct panel_clock *clock;
int painted;
int clock_format;
enum clock_format clock_format;
uint32_t color;
};
@ -417,12 +424,6 @@ panel_destroy_clock(struct panel_clock *clock)
free(clock);
}
enum {
CLOCK_FORMAT_MINUTES,
CLOCK_FORMAT_SECONDS,
CLOCK_FORMAT_NONE
};
static void
panel_add_clock(struct panel *panel)
{
@ -449,6 +450,8 @@ panel_add_clock(struct panel *panel)
clock->format_string = "%a %b %d, %I:%M:%S %p";
clock->refresh_timer = 1;
break;
case CLOCK_FORMAT_NONE:
assert(!"not reached");
}
clock->clock_task.run = clock_func;