From c86a42ea6ab8f995d9ee34359769ed934336fe7a Mon Sep 17 00:00:00 2001 From: Jason Conti Date: Fri, 7 Jun 2019 16:26:23 -0400 Subject: * Pull out gsettings schema keys to settings.h to avoid duplication --- src/Makefile.am | 2 ++ src/indicator-notifications-settings.c | 6 +----- src/indicator-notifications.c | 6 +----- src/settings.h | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 src/settings.h diff --git a/src/Makefile.am b/src/Makefile.am index 2e6751c..94c0c07 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,6 +9,7 @@ libnotifications_la_SOURCES = \ urlregex.h \ notification-menuitem.c \ notification-menuitem.h \ + settings.h \ indicator-notifications.c \ notification.c \ notification.h @@ -28,6 +29,7 @@ libnotifications_la_LDFLAGS = \ libexec_PROGRAMS = indicator-notifications-settings indicator_notifications_settings_SOURCES = \ + settings.h \ indicator-notifications-settings.c indicator_notifications_settings_CFLAGS = \ diff --git a/src/indicator-notifications-settings.c b/src/indicator-notifications-settings.c index 04e9209..e7cc04f 100644 --- a/src/indicator-notifications-settings.c +++ b/src/indicator-notifications-settings.c @@ -1,10 +1,6 @@ #include -#define NOTIFICATIONS_SCHEMA "net.launchpad.indicator.notifications" -#define NOTIFICATIONS_KEY_BLACKLIST "blacklist" -#define NOTIFICATIONS_KEY_CLEAR_MC "clear-on-middle-click" -#define NOTIFICATIONS_KEY_HIDE_INDICATOR "hide-indicator" -#define NOTIFICATIONS_KEY_MAX_ITEMS "max-items" +#include "settings.h" #define SCHEMA_KEY "schema-key" diff --git a/src/indicator-notifications.c b/src/indicator-notifications.c index 41164c9..72db13d 100644 --- a/src/indicator-notifications.c +++ b/src/indicator-notifications.c @@ -87,11 +87,7 @@ struct _IndicatorNotificationsPrivate { #define INDICATOR_NOTIFICATIONS_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_NOTIFICATIONS_TYPE, IndicatorNotificationsPrivate)) -#define NOTIFICATIONS_SCHEMA "net.launchpad.indicator.notifications" -#define NOTIFICATIONS_KEY_BLACKLIST "blacklist" -#define NOTIFICATIONS_KEY_CLEAR_MC "clear-on-middle-click" -#define NOTIFICATIONS_KEY_HIDE_INDICATOR "hide-indicator" -#define NOTIFICATIONS_KEY_MAX_ITEMS "max-items" +#include "settings.h" #define INDICATOR_ICON_SIZE 22 #define INDICATOR_ICON_READ "indicator-notification-read" diff --git a/src/settings.h b/src/settings.h new file mode 100644 index 0000000..92521e5 --- /dev/null +++ b/src/settings.h @@ -0,0 +1,14 @@ +/* + * settings.h - Definitions of settings keys and schema. + */ + +#ifndef __SETTINGS_H__ +#define __SETTINGS_H__ + +#define NOTIFICATIONS_SCHEMA "net.launchpad.indicator.notifications" +#define NOTIFICATIONS_KEY_BLACKLIST "blacklist" +#define NOTIFICATIONS_KEY_CLEAR_MC "clear-on-middle-click" +#define NOTIFICATIONS_KEY_HIDE_INDICATOR "hide-indicator" +#define NOTIFICATIONS_KEY_MAX_ITEMS "max-items" + +#endif -- cgit v1.2.3