[gnome-todo] task-list-eds: Use "Inbox" display name for inbox



commit 8f80f17025e74c06d6d6f90321b53b816111dd26
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Apr 26 18:42:31 2020 -0300

    task-list-eds: Use "Inbox" display name for inbox

 plugins/eds/gtd-provider-eds.c  |  2 +-
 plugins/eds/gtd-provider-eds.h  |  2 ++
 plugins/eds/gtd-task-list-eds.c | 10 ++++++++--
 3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/plugins/eds/gtd-provider-eds.c b/plugins/eds/gtd-provider-eds.c
index 7c75f99..aaa5a0d 100644
--- a/plugins/eds/gtd-provider-eds.c
+++ b/plugins/eds/gtd-provider-eds.c
@@ -740,7 +740,7 @@ gtd_provider_eds_get_inbox (GtdProvider *provider)
 {
   GtdProviderEdsPrivate *priv = gtd_provider_eds_get_instance_private (GTD_PROVIDER_EDS (provider));
 
-  return g_hash_table_lookup (priv->task_lists, "system-task-list");
+  return g_hash_table_lookup (priv->task_lists, GTD_PROVIDER_EDS_INBOX_ID);
 }
 
 static void
diff --git a/plugins/eds/gtd-provider-eds.h b/plugins/eds/gtd-provider-eds.h
index 54ef5f9..f785f80 100644
--- a/plugins/eds/gtd-provider-eds.h
+++ b/plugins/eds/gtd-provider-eds.h
@@ -25,6 +25,8 @@
 
 G_BEGIN_DECLS
 
+#define GTD_PROVIDER_EDS_INBOX_ID "system-task-list"
+
 #define GTD_TYPE_PROVIDER_EDS (gtd_provider_eds_get_type())
 
 G_DECLARE_DERIVABLE_TYPE (GtdProviderEds, gtd_provider_eds, GTD, PROVIDER_EDS, GtdObject)
diff --git a/plugins/eds/gtd-task-list-eds.c b/plugins/eds/gtd-task-list-eds.c
index f6fc036..619676d 100644
--- a/plugins/eds/gtd-task-list-eds.c
+++ b/plugins/eds/gtd-task-list-eds.c
@@ -1,6 +1,6 @@
 /* gtd-task-list-eds.c
  *
- * Copyright (C) 2015 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ * Copyright (C) 2015-2020 Georges Basile Stavracas Neto <georges stavracas gmail com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -894,12 +894,15 @@ gtd_task_list_eds_set_source (GtdTaskListEds *self,
   ESourceSelectable *selectable;
   ESourceRefresh *refresh;
   GdkRGBA color;
+  gboolean is_inbox;
 
   g_return_if_fail (GTD_IS_TASK_LIST_EDS (self));
 
   if (!g_set_object (&self->source, source))
     return;
 
+  is_inbox = g_str_equal (e_source_get_uid (source), GTD_PROVIDER_EDS_INBOX_ID);
+
   /* Setup color */
   selectable = E_SOURCE_SELECTABLE (e_source_get_extension (source, E_SOURCE_EXTENSION_TASK_LIST));
 
@@ -925,7 +928,10 @@ gtd_task_list_eds_set_source (GtdTaskListEds *self,
                            0);
 
   /* Setup tasklist name */
-  gtd_task_list_set_name (GTD_TASK_LIST (self), e_source_get_display_name (source));
+  if (is_inbox)
+    gtd_task_list_set_name (GTD_TASK_LIST (self), _("Inbox"));
+  else
+    gtd_task_list_set_name (GTD_TASK_LIST (self), e_source_get_display_name (source));
 
   g_object_bind_property (source,
                           "display-name",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]