[evolution/gnome-3-38] I#1085 - WebDAVBrowser: Show the collection URL in the tooltip



commit d66656dbb34f5354d095f3b0649a2cc02050829a
Author: Milan Crha <mcrha redhat com>
Date:   Fri Sep 11 09:02:36 2020 +0200

    I#1085 - WebDAVBrowser: Show the collection URL in the tooltip
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1085

 src/e-util/e-webdav-browser.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/e-util/e-webdav-browser.c b/src/e-util/e-webdav-browser.c
index f53177d831..434bfbcbd2 100644
--- a/src/e-util/e-webdav-browser.c
+++ b/src/e-util/e-webdav-browser.c
@@ -395,8 +395,8 @@ webdav_browser_update_ui (EWebDAVBrowser *webdav_browser)
                GtkTreePath *path;
                GdkRGBA rgba;
                GString *type_info;
-               const gchar *icon_name = NULL;
-               gchar *parent_href, *ptr;
+               const gchar *icon_name = NULL, *description;
+               gchar *parent_href, *ptr, *tmp = NULL;
                gboolean has_parent_iter = FALSE, has_color, is_loaded_row = FALSE, is_existing_row = FALSE;
                gint len;
 
@@ -534,11 +534,22 @@ webdav_browser_update_ui (EWebDAVBrowser *webdav_browser)
                        has_color = gdk_rgba_parse (&rgba, rd->resource->color);
                }
 
+               if (rd->resource->kind == E_WEBDAV_RESOURCE_KIND_COLLECTION) {
+                       if (rd->resource->description && *rd->resource->description) {
+                               tmp = g_strconcat (rd->resource->description, "\n\n", rd->resource->href, 
NULL);
+                               description = tmp;
+                       } else {
+                               description = rd->resource->href;
+                       }
+               } else {
+                       description = rd->resource->description;
+               }
+
                gtk_tree_store_set (tree_store, &iter,
                        COLUMN_STRING_DISPLAY_NAME, rd->resource->display_name,
                        COLUMN_STRING_TYPE, type_info->str,
                        COLUMN_STRING_HREF, rd->resource->href,
-                       COLUMN_STRING_DESCRIPTION, rd->resource->description,
+                       COLUMN_STRING_DESCRIPTION, description,
                        COLUMN_STRING_ICON_NAME, icon_name,
                        COLUMN_BOOL_ICON_VISIBLE, icon_name != NULL,
                        COLUMN_RGBA_COLOR, has_color ? &rgba : NULL,
@@ -550,6 +561,7 @@ webdav_browser_update_ui (EWebDAVBrowser *webdav_browser)
 
                g_string_free (type_info, TRUE);
                g_free (parent_href);
+               g_free (tmp);
        }
 
        g_slist_free_full (webdav_browser->priv->resources, resource_data_free);


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