[libdazzle] shortcuts: allow getting the internal theme
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] shortcuts: allow getting the internal theme
- Date: Tue, 13 Jun 2017 06:48:45 +0000 (UTC)
commit ce22bc6504236a8018292484afe9d2229d0c71f4
Author: Christian Hergert <chergert redhat com>
Date: Mon Jun 12 21:06:10 2017 -0700
shortcuts: allow getting the internal theme
src/shortcuts/dzl-shortcut-manager.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-manager.c b/src/shortcuts/dzl-shortcut-manager.c
index 55d52cb..98aeb5f 100644
--- a/src/shortcuts/dzl-shortcut-manager.c
+++ b/src/shortcuts/dzl-shortcut-manager.c
@@ -1157,9 +1157,14 @@ dzl_shortcut_manager_add_shortcut_entries (DzlShortcutManager *self,
/**
* dzl_shortcut_manager_get_theme_by_name:
* @self: a #DzlShortcutManager
+ * @theme_name: (nullable): the name of a theme or %NULL of the internal theme
*
* Locates a theme by the name of the theme.
*
+ * If @theme_name is %NULL, then the internal theme is used. You probably dont
+ * need to use that as it is used by various controllers to hook up their
+ * default actions.
+ *
* Returns: (transfer none) (nullable): A #DzlShortcutTheme or %NULL.
*/
DzlShortcutTheme *
@@ -1169,7 +1174,9 @@ dzl_shortcut_manager_get_theme_by_name (DzlShortcutManager *self,
DzlShortcutManagerPrivate *priv = dzl_shortcut_manager_get_instance_private (self);
g_return_val_if_fail (DZL_IS_SHORTCUT_MANAGER (self), NULL);
- g_return_val_if_fail (theme_name != NULL, NULL);
+
+ if (theme_name == NULL || g_strcmp0 (theme_name, "__internal__") == 0)
+ return priv->internal_theme;
for (guint i = 0; i < priv->themes->len; i++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]