Blob Blame History Raw
From 119ea29a19cd17a25acbe5cf1d35c5a40c2de4cb Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Tue, 13 Oct 2015 13:47:19 +0200
Subject: [PATCH] wizard: correct comments in save_text_if_changed()

The FIXME has become irrelevant in commit
257578a23d1537a2d235aaa2b1488ee4f818e360 because there are no more
problems with other widgets as the function no longer reloads data from
the dump directory.

I added a comment explaining how the wizard deals with errors while
saving user data, because it is not clear and one might think that the
errors are silently ignored.

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/gui-wizard-gtk/wizard.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 6e7f6c4..5962181 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -425,11 +425,14 @@ static void save_text_if_changed(const char *name, const char *new_value)
         old_value = "";
     if (strcmp(new_value, old_value) != 0)
     {
+        /* If the dump directory cannot be opened for writing, an error dialogue
+         * will pop up because g_custom_logger is set to &show_error_as_msgbox.*/
         struct dump_dir *dd = wizard_open_directory_for_writing(g_dump_dir_name);
         if (dd)
+            /* If this operation fails, an error dialogue will pop up because
+             * g_custom_logger is set to &show_error_as_msgbox.*/
             dd_save_text(dd, name, new_value);
 
-//FIXME: else: what to do with still-unsaved data in the widget??
         dd_close(dd);
     }
 }
-- 
2.5.0