[nautilus/wip/csoriano/destktop-split2: 49/50] desktop-canvas-view-container: override get icon text
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/csoriano/destktop-split2: 49/50] desktop-canvas-view-container: override get icon text
- Date: Tue, 5 Apr 2016 13:18:24 +0000 (UTC)
commit 57aa11e9f8e363e774df21b3ba8ddcc0fb99b019
Author: Carlos Soriano <csoriano gnome org>
Date: Mon Apr 4 12:34:31 2016 +0200
desktop-canvas-view-container: override get icon text
Now that we have a subclass we can override the function instead of
special casing in the parent.
src/nautilus-canvas-view-container.c | 7 ++--
src/nautilus-desktop-canvas-view-container.c | 45 ++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-canvas-view-container.c b/src/nautilus-canvas-view-container.c
index a56ec66..efcb735 100644
--- a/src/nautilus-canvas-view-container.c
+++ b/src/nautilus-canvas-view-container.c
@@ -243,10 +243,9 @@ nautilus_canvas_view_container_get_icon_text (NautilusCanvasContainer *container
return;
}
- if (NAUTILUS_IS_DESKTOP_ICON_FILE (file) ||
- nautilus_file_is_nautilus_link (file)) {
- /* Don't show the normal extra information for desktop icons,
- * or desktop files, it doesn't make sense. */
+ if (nautilus_file_is_nautilus_link (file)) {
+ /* Don't show the normal extra information for desktop files,
+ * it doesn't make sense. */
*additional_text = NULL;
return;
}
diff --git a/src/nautilus-desktop-canvas-view-container.c b/src/nautilus-desktop-canvas-view-container.c
index 48e6f95..0e2b291 100644
--- a/src/nautilus-desktop-canvas-view-container.c
+++ b/src/nautilus-desktop-canvas-view-container.c
@@ -26,6 +26,50 @@ struct _NautilusDesktopCanvasViewContainer
G_DEFINE_TYPE (NautilusDesktopCanvasViewContainer, nautilus_desktop_canvas_view_container,
NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER)
+
+static void
+real_get_icon_text (NautilusCanvasContainer *container,
+ NautilusCanvasIconData *data,
+ char **editable_text,
+ char **additional_text,
+ gboolean include_invisible)
+{
+ NautilusFile *file;
+ gboolean use_additional;
+
+ file = NAUTILUS_FILE (data);
+
+ g_assert (NAUTILUS_IS_FILE (file));
+ g_assert (editable_text != NULL);
+
+ use_additional = (additional_text != NULL);
+
+ /* Strip the suffix for nautilus object xml files. */
+ *editable_text = nautilus_file_get_display_name (file);
+
+ if (!use_additional) {
+ return;
+
+ }
+
+ if (NAUTILUS_IS_DESKTOP_ICON_FILE (file) ||
+ nautilus_file_is_nautilus_link (file))
+ {
+ /* Don't show the normal extra information for desktop icons,
+ * or desktop files, it doesn't make sense.
+ */
+ *additional_text = NULL;
+ return;
+
+ }
+
+ return NAUTILUS_CANVAS_CONTAINER_CLASS (G_OBJECT_GET_CLASS (container))->get_icon_text (container,
+ data,
+ editable_text,
+ additional_text,
+ include_invisible);
+}
+
static char *
real_get_icon_description (NautilusCanvasContainer *container,
NautilusCanvasIconData *data)
@@ -58,6 +102,7 @@ nautilus_desktop_canvas_view_container_class_init (NautilusDesktopCanvasViewCont
NautilusCanvasContainerClass *container_class = NAUTILUS_CANVAS_CONTAINER_CLASS (klass);
container_class->get_icon_description = real_get_icon_description;
+ container_class->get_icon_text = real_get_icon_text;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]