[gnome-todo] task-list: be less strict about source
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] task-list: be less strict about source
- Date: Thu, 25 Jun 2015 03:47:37 +0000 (UTC)
commit 3820b6860f65d1255d547eb6e78ea8de010e3135
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jun 25 00:46:55 2015 -0300
task-list: be less strict about source
src/gtd-task-list.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/gtd-task-list.c b/src/gtd-task-list.c
index 373cbe4..caea621 100644
--- a/src/gtd-task-list.c
+++ b/src/gtd-task-list.c
@@ -286,16 +286,23 @@ gtd_task_list_new (ESource *source,
GdkRGBA*
gtd_task_list_get_color (GtdTaskList *list)
{
- ESourceSelectable *selectable;
GdkRGBA color;
g_return_val_if_fail (GTD_IS_TASK_LIST (list), NULL);
- g_return_val_if_fail (E_IS_SOURCE (list->priv->source), NULL);
- selectable = E_SOURCE_SELECTABLE (e_source_get_extension (list->priv->source,
E_SOURCE_EXTENSION_TASK_LIST));
+ if (list->priv->source)
+ {
+ ESourceSelectable *selectable;
+
+ selectable = E_SOURCE_SELECTABLE (e_source_get_extension (list->priv->source,
E_SOURCE_EXTENSION_TASK_LIST));
- if (!gdk_rgba_parse (&color, e_source_selectable_get_color (selectable)))
- gdk_rgba_parse (&color, "#ffffff"); /* calendar default colour */
+ if (!gdk_rgba_parse (&color, e_source_selectable_get_color (selectable)))
+ gdk_rgba_parse (&color, "#ffffff"); /* calendar default colour */
+ }
+ else
+ {
+ gdk_rgba_parse (&color, "#ffffff");
+ }
return gdk_rgba_copy (&color);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]