[libpanel] save-dialog: remove use of g_autofree
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpanel] save-dialog: remove use of g_autofree
- Date: Tue, 27 Sep 2022 04:41:49 +0000 (UTC)
commit 0f8f5da8c391dc1cc0ccaaa809f55d152e7cb93e
Author: Christian Hergert <chergert redhat com>
Date: Mon Sep 26 21:26:41 2022 -0700
save-dialog: remove use of g_autofree
Going to be hard to not let these creep back in.
src/panel-save-dialog.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/panel-save-dialog.c b/src/panel-save-dialog.c
index 7aa0685..f015dc0 100644
--- a/src/panel-save-dialog.c
+++ b/src/panel-save-dialog.c
@@ -394,7 +394,7 @@ panel_save_dialog_update (PanelSaveDialog *self)
if (panel_save_delegate_get_is_draft (delegate))
{
const char *title = panel_save_delegate_get_title (delegate);
- g_autofree char *body = NULL;
+ char *body;
/* translators: %s is replaced with the document title */
body = g_strdup_printf (_("The draft “%s” has not been saved. It can be saved or discarded."),
title);
@@ -410,11 +410,13 @@ panel_save_dialog_update (PanelSaveDialog *self)
adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (self), "save",
ADW_RESPONSE_SUGGESTED);
adw_message_dialog_set_response_label (ADW_MESSAGE_DIALOG (self), "save", _("_Save As…"));
set_response_visible (ADW_MESSAGE_DIALOG (self), "save", TRUE);
+
+ g_free (body);
}
else
{
const char *title = panel_save_delegate_get_title (delegate);
- g_autofree char *body = NULL;
+ char *body;
/* translators: %s is replaced with the document title */
body = g_strdup_printf (_("“%s” contains unsaved changes. Changes can be saved or discarded."),
title);
@@ -430,6 +432,8 @@ panel_save_dialog_update (PanelSaveDialog *self)
adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (self), "save",
ADW_RESPONSE_SUGGESTED);
adw_message_dialog_set_response_label (ADW_MESSAGE_DIALOG (self), "save", _("_Save"));
set_response_visible (ADW_MESSAGE_DIALOG (self), "save", TRUE);
+
+ g_free (body);
}
gtk_widget_hide (GTK_WIDGET (self->page));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]