+
+/**
+ * g_action_print_detailed_name:
+ * @action_name: a valid action name
+ * @target_value: (allow-none): a #GVariant target value, or %NULL
+ *
+ * Formats a detailed action name from @action_name and @target_value.
+ *
+ * It is an error to call this function with an invalid action name.
+ *
+ * This function is the opposite of
+ * g_action_parse_detailed_action_name(). It will produce a string that
+ * can be parsed back to the @action_name and @target_value by that
+ * function.
+ *
+ * See that function for the types of strings that will be printed by
+ * this function.
+ *
+ * Returns: a detailed format string
+ *
+ * Since: 2.38
+ **/
+gchar *
+g_action_print_detailed_name (const gchar *action_name,
+ GVariant *target_value)
+{
+ g_return_val_if_fail (g_action_name_is_valid (action_name), NULL);
+
+ if (target_value == NULL)
+ return g_strdup (action_name);
+
+ if (g_variant_is_of_type (target_value, G_VARIANT_TYPE_STRING))
+ {
+ const gchar *str = g_variant_get_string (target_value, NULL);
+
+ if (g_action_name_is_valid (str))
+ return g_strconcat (action_name, "::", str, NULL);
+ }
+
+ {
+ GString *result = g_string_new (action_name);
+ g_string_append_c (result, '(');
+ g_variant_print_string (target_value, result, TRUE);
+ g_string_append_c (result, ')');
+
+ return g_string_free (result, FALSE);
+ }
+}