[gnome-builder] foundry: add ide_build_target_get_display_name()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] foundry: add ide_build_target_get_display_name()
- Date: Thu, 17 Jan 2019 03:43:24 +0000 (UTC)
commit 3633e7b2a3c1aa66189c6ba6c8c3c987b6e2a4c5
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 16 19:42:21 2019 -0800
foundry: add ide_build_target_get_display_name()
This is different from name in that it allows for pango markup to be
assocaited with the build target.
src/libide/foundry/ide-build-target.c | 19 +++++++++++++++++++
src/libide/foundry/ide-build-target.h | 3 +++
2 files changed, 22 insertions(+)
---
diff --git a/src/libide/foundry/ide-build-target.c b/src/libide/foundry/ide-build-target.c
index 291597716..f37c58fd5 100644
--- a/src/libide/foundry/ide-build-target.c
+++ b/src/libide/foundry/ide-build-target.c
@@ -87,6 +87,25 @@ ide_build_target_get_install (IdeBuildTarget *self)
return FALSE;
}
+/**
+ * ide_build_target_get_display_name:
+ *
+ * Returns: (nullable) (transfer full): A display name for the build
+ * target to be displayed in UI. May contain pango markup.
+ *
+ * Since: 3.32
+ */
+gchar *
+ide_build_target_get_display_name (IdeBuildTarget *self)
+{
+ g_return_val_if_fail (IDE_IS_BUILD_TARGET (self), NULL);
+
+ if (IDE_BUILD_TARGET_GET_IFACE (self)->get_display_name)
+ return IDE_BUILD_TARGET_GET_IFACE (self)->get_display_name (self);
+ else
+ return ide_build_target_get_name (self);
+}
+
/**
* ide_build_target_get_name:
*
diff --git a/src/libide/foundry/ide-build-target.h b/src/libide/foundry/ide-build-target.h
index 8da2fdb68..8acca0ae7 100644
--- a/src/libide/foundry/ide-build-target.h
+++ b/src/libide/foundry/ide-build-target.h
@@ -50,6 +50,7 @@ struct _IdeBuildTargetInterface
GFile *(*get_install_directory) (IdeBuildTarget *self);
gchar *(*get_name) (IdeBuildTarget *self);
+ gchar *(*get_display_name) (IdeBuildTarget *self);
gint (*get_priority) (IdeBuildTarget *self);
gchar **(*get_argv) (IdeBuildTarget *self);
gchar *(*get_cwd) (IdeBuildTarget *self);
@@ -62,6 +63,8 @@ GFile *ide_build_target_get_install_directory (IdeBuildTarget *
IDE_AVAILABLE_IN_3_32
gchar *ide_build_target_get_name (IdeBuildTarget *self);
IDE_AVAILABLE_IN_3_32
+gchar *ide_build_target_get_display_name (IdeBuildTarget *self);
+IDE_AVAILABLE_IN_3_32
gint ide_build_target_get_priority (IdeBuildTarget *self);
IDE_AVAILABLE_IN_3_32
gchar **ide_build_target_get_argv (IdeBuildTarget *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]