Blame SOURCES/0159-wizard-fix-save-users-changes-after-reviewing-dump-d.patch

49b321
From 46d7cc6b317334cdd119ceaec9887eab0afac39c Mon Sep 17 00:00:00 2001
49b321
From: Matej Habrnal <mhabrnal@redhat.com>
49b321
Date: Mon, 12 Oct 2015 09:14:12 +0200
49b321
Subject: [PATCH] wizard: fix save users changes after reviewing dump dir files
49b321
49b321
If the user reviewed the dump dir's files during reporting the crash, the
49b321
changes was thrown away and original data was passed to the bugzilla bug
49b321
report.
49b321
49b321
report-gtk saves the first text view buffer and then reloads data from the
49b321
reported problem directory, which causes that the changes made to those text
49b321
views are thrown away.
49b321
49b321
Function save_text_if_changed(), except of saving text, also reload the files
49b321
from dump dir and update gui state from the dump dir. The commit moves the
49b321
reloading and updating gui functions away from this function.
49b321
49b321
Related to rhbz#1270235
49b321
49b321
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
49b321
49b321
Resolves: CVE-2015-5302
49b321
49b321
Signed-off-by: Jakub Filak <jfilak@redhat.com>
49b321
---
49b321
 src/gui-wizard-gtk/wizard.c | 9 ++++++---
49b321
 1 file changed, 6 insertions(+), 3 deletions(-)
49b321
49b321
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
49b321
index 71964a9..3a7db9c 100644
49b321
--- a/src/gui-wizard-gtk/wizard.c
49b321
+++ b/src/gui-wizard-gtk/wizard.c
49b321
@@ -495,8 +495,6 @@ static void save_text_if_changed(const char *name, const char *new_value)
49b321
 
49b321
 //FIXME: else: what to do with still-unsaved data in the widget??
49b321
         dd_close(dd);
49b321
-        problem_data_reload_from_dump_dir();
49b321
-        update_gui_state_from_problem_data(/* don't update selected event */ 0);
49b321
     }
49b321
 }
49b321
 
49b321
@@ -839,7 +837,11 @@ static void tv_details_row_activated(
49b321
         load_text_to_text_view(GTK_TEXT_VIEW(textview), item_name);
49b321
 
49b321
         if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
49b321
+        {
49b321
             save_text_from_text_view(GTK_TEXT_VIEW(textview), item_name);
49b321
+            problem_data_reload_from_dump_dir();
49b321
+            update_gui_state_from_problem_data(/* don't update selected event */ 0);
49b321
+        }
49b321
 
49b321
         gtk_widget_destroy(textview);
49b321
         gtk_widget_destroy(scrolled);
49b321
@@ -2662,7 +2664,8 @@ static void on_page_prepare(GtkNotebook *assistant, GtkWidget *page, gpointer us
49b321
      * these tabs will be lost */
49b321
     save_items_from_notepad();
49b321
     save_text_from_text_view(g_tv_comment, FILENAME_COMMENT);
49b321
-
49b321
+    problem_data_reload_from_dump_dir();
49b321
+    update_gui_state_from_problem_data(/* don't update selected event */ 0);
49b321
 
49b321
     if (pages[PAGENO_SUMMARY].page_widget == page)
49b321
     {
49b321
-- 
49b321
1.8.3.1
49b321