[gthumb] utils: added GString function
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] utils: added GString function
- Date: Sat, 19 Jun 2021 18:10:34 +0000 (UTC)
commit ad71e6f54a8edc18ccc452f3be5bbbecdb06a782
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun May 16 12:43:56 2021 +0200
utils: added GString function
gthumb/glib-utils.c | 20 ++++++++++++++++++++
gthumb/glib-utils.h | 3 +++
2 files changed, 23 insertions(+)
---
diff --git a/gthumb/glib-utils.c b/gthumb/glib-utils.c
index 386c831c..760cace5 100644
--- a/gthumb/glib-utils.c
+++ b/gthumb/glib-utils.c
@@ -2113,6 +2113,26 @@ _g_error_free (GError *error)
}
+GString *
+_g_string_append_markup_escaped (GString *string,
+ const char *format,
+ ...)
+{
+ va_list args;
+ char *escaped;
+
+ va_start (args, format);
+ escaped = g_markup_vprintf_escaped (format, args);
+ va_end (args);
+
+ g_string_append (string, escaped);
+
+ g_free (escaped);
+
+ return string;
+}
+
+
void
toggle_action_activated (GSimpleAction *action,
GVariant *parameter,
diff --git a/gthumb/glib-utils.h b/gthumb/glib-utils.h
index 879187b7..6470f09d 100644
--- a/gthumb/glib-utils.h
+++ b/gthumb/glib-utils.h
@@ -322,6 +322,9 @@ char * _g_format_duration_for_display (gint64 msecs);
char * _g_format_str_for_file (const char *format,
GFile *file);
void _g_error_free (GError *error);
+GString * _g_string_append_markup_escaped (GString *string,
+ const char *format,
+ ...) G_GNUC_PRINTF (2, 3);
DEF_ACTION_CALLBACK (toggle_action_activated)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]