diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c index de9c5df0e..03dbfb1a6 100644 --- a/shell/cc-panel-loader.c +++ b/shell/cc-panel-loader.c @@ -122,22 +122,37 @@ parse_categories (GDesktopAppInfo *app) const char *categories; char **split; int retval; - int i; categories = g_desktop_app_info_get_categories (app); split = g_strsplit (categories, ";", -1); retval = -1; - for (i = 0; split[i]; i++) - { - if (strcmp (split[i], "HardwareSettings") == 0) - retval = CC_CATEGORY_HARDWARE; - else if (strcmp (split[i], "X-GNOME-PersonalSettings") == 0) - retval = CC_CATEGORY_PERSONAL; - else if (strcmp (split[i], "X-GNOME-SystemSettings") == 0) - retval = CC_CATEGORY_SYSTEM; - } +#define const_strv(s) ((const gchar* const*) s) + +#ifdef CC_ENABLE_ALT_CATEGORIES + if (g_strv_contains (const_strv (split), "X-GNOME-ConnectivitySettings")) + retval = CC_CATEGORY_CONNECTIVITY; + else if (g_strv_contains (const_strv (split), "X-GNOME-PersonalizationSettings")) + retval = CC_CATEGORY_PERSONALIZATION; + else if (g_strv_contains (const_strv (split), "X-GNOME-AccountSettings")) + retval = CC_CATEGORY_ACCOUNT; + else if (g_strv_contains (const_strv (split), "X-GNOME-DevicesSettings")) + retval = CC_CATEGORY_DEVICES; + else if (g_strv_contains (const_strv (split), "X-GNOME-DetailsSettings")) + retval = CC_CATEGORY_DETAILS; + else if (g_strv_contains (const_strv (split), "HardwareSettings")) + retval = CC_CATEGORY_HARDWARE; +#else + if (g_strv_contains (const_strv (split), "HardwareSettings")) + retval = CC_CATEGORY_HARDWARE; + else if (g_strv_contains (const_strv (split), "X-GNOME-PersonalSettings")) + retval = CC_CATEGORY_PERSONAL; + else if (g_strv_contains (const_strv (split), "X-GNOME-SystemSettings")) + retval = CC_CATEGORY_SYSTEM; +#endif + +#undef const_strv if (retval < 0) { diff --git a/shell/cc-shell-model.h b/shell/cc-shell-model.h index bf24173a8..8680d8cdf 100644 --- a/shell/cc-shell-model.h +++ b/shell/cc-shell-model.h @@ -53,9 +53,19 @@ typedef struct _CcShellModelClass CcShellModelClass; typedef struct _CcShellModelPrivate CcShellModelPrivate; typedef enum { - CC_CATEGORY_PERSONAL, +#ifdef CC_ENABLE_ALT_CATEGORIES + CC_CATEGORY_CONNECTIVITY, + CC_CATEGORY_PERSONALIZATION, + CC_CATEGORY_ACCOUNT, CC_CATEGORY_HARDWARE, + CC_CATEGORY_DEVICES, + CC_CATEGORY_DETAILS, +#else + CC_CATEGORY_PERSONAL, CC_CATEGORY_SYSTEM, + CC_CATEGORY_HARDWARE, +#endif + CC_CATEGORY_LAST } CcPanelCategory;