Martin Milata <mmilata(a)redhat.com> writes:
This is an attempt to solve #304 (wrong title when reporting from
setroubleshoot). SETroubleshoot does not provide the name of the
application in question (or was setroubleshoot itself meant as the
application name?), so this patch uses the 'reason' item instead of the
dump dir path. This is IMHO more informative even in the typical ABRT
case.
Is that OK or should I display something else in the title (possibly
explicitly passed to libreport by setroubleshoot)?
---
src/gui-wizard-gtk/wizard.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 06a184a..bd4b5bb 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -374,7 +374,11 @@ struct dump_dir *steal_if_needed(struct dump_dir *dd)
g_dump_dir_name = xstrdup(dd->dd_dirname);
dd_close(dd);
- gtk_window_set_title(GTK_WINDOW(g_assistant), g_dump_dir_name);
+ /* reset the window title in case it fell back to g_dump_dir_name */
+ const char *reason = get_problem_item_content_or_NULL(g_cd, FILENAME_REASON);
+ if (reason == NULL)
+ gtk_window_set_title(GTK_WINDOW(g_assistant), g_dump_dir_name);
wrong indentation (8 tabs/space)
+
delete_dump_dir_possibly_using_abrtd(old_name); //TODO: if (deletion_failed)
error_msg("BAD")?
free(old_name);
@@ -1010,10 +1014,9 @@ static void update_event_checkboxes(GList **events_gui_data,
void update_gui_state_from_problem_data(void)
{
- gtk_window_set_title(GTK_WINDOW(g_assistant), g_dump_dir_name);
-
const char *reason = get_problem_item_content_or_NULL(g_cd, FILENAME_REASON);
gtk_label_set_text(g_lbl_cd_reason, reason ? reason : _("(no
description)"));
+ gtk_window_set_title(GTK_WINDOW(g_assistant), reason ? reason : g_dump_dir_name);
gtk_list_store_clear(g_ls_details);
struct cd_stats stats = { 0 };
--
Nikola
Save the whales. Feed the hungry. Free the mallocs