Blame SOURCES/0059-lib-make_description-show-not-reportable.patch

28bab8
From 2c4f3128fe66634f0239e307ed686f87340f0655 Mon Sep 17 00:00:00 2001
28bab8
From: Matej Habrnal <matejhabrnal@gmail.com>
28bab8
Date: Thu, 4 Sep 2014 05:27:42 -0400
28bab8
Subject: [LIBREPORT PATCH 59/93] lib: make_description show not-reportable
28bab8
28bab8
When the flag from desc_flags is set to MAKEDESC_SHOW_URLS and problem is
28bab8
not-reportable. The abrt-cli shows not-reportable in listing.
28bab8
28bab8
Resolves: rhbz#1066520
28bab8
---
28bab8
 src/lib/make_descr.c | 45 +++++++++++++++++++++++++--------------------
28bab8
 1 file changed, 25 insertions(+), 20 deletions(-)
28bab8
28bab8
diff --git a/src/lib/make_descr.c b/src/lib/make_descr.c
28bab8
index d183ac1..7f5c10b 100644
28bab8
--- a/src/lib/make_descr.c
28bab8
+++ b/src/lib/make_descr.c
28bab8
@@ -101,33 +101,38 @@ char *make_description(problem_data_t *problem_data, char **names_to_skip,
28bab8
 
28bab8
     if (desc_flags & MAKEDESC_SHOW_URLS)
28bab8
     {
28bab8
-        const char *reported_to = problem_data_get_content_or_NULL(problem_data, FILENAME_REPORTED_TO);
28bab8
-        if (reported_to != NULL)
28bab8
+        if (problem_data_get_content_or_NULL(problem_data, FILENAME_NOT_REPORTABLE) != NULL)
28bab8
+            strbuf_append_strf(buf_dsc, "%s%*s%s\n", _("Reported:"), 16 - strlen(_("Reported:")), "" , _("cannot be reported"));
28bab8
+        else
28bab8
         {
28bab8
-            GList *reports = read_entire_reported_to_data(reported_to);
28bab8
-
28bab8
-            /* The value part begins on 17th column */
28bab8
-            /*                        0123456789ABCDEF*/
28bab8
-            const char *pad_prefix = "                ";
28bab8
-            char *first_prefix = xasprintf("%s%*s", _("Reported:"), 16 - strlen(_("Reported:")), "");
28bab8
-            const char *prefix     = first_prefix;
28bab8
-            for (GList *iter = reports; iter != NULL; iter = g_list_next(iter))
28bab8
+            const char *reported_to = problem_data_get_content_or_NULL(problem_data, FILENAME_REPORTED_TO);
28bab8
+            if (reported_to != NULL)
28bab8
             {
28bab8
-                const report_result_t *const report = (report_result_t *)iter->data;
28bab8
+                GList *reports = read_entire_reported_to_data(reported_to);
28bab8
+
28bab8
+                /* The value part begins on 17th column */
28bab8
+                /*                        0123456789ABCDEF*/
28bab8
+                const char *pad_prefix = "                ";
28bab8
+                char *first_prefix = xasprintf("%s%*s", _("Reported:"), 16 - strlen(_("Reported:")), "");
28bab8
+                const char *prefix     = first_prefix;
28bab8
+                for (GList *iter = reports; iter != NULL; iter = g_list_next(iter))
28bab8
+                {
28bab8
+                    const report_result_t *const report = (report_result_t *)iter->data;
28bab8
 
28bab8
-                if (report->url == NULL)
28bab8
-                    continue;
28bab8
+                    if (report->url == NULL)
28bab8
+                        continue;
28bab8
 
28bab8
-                strbuf_append_strf(buf_dsc, "%s%s\n", prefix, report->url);
28bab8
+                    strbuf_append_strf(buf_dsc, "%s%s\n", prefix, report->url);
28bab8
 
28bab8
-                if (prefix == first_prefix)
28bab8
-                {   /* Only the first URL is prefixed by 'Reported:' */
28bab8
-                    empty = false;
28bab8
-                    prefix = pad_prefix;
28bab8
+                    if (prefix == first_prefix)
28bab8
+                    {   /* Only the first URL is prefixed by 'Reported:' */
28bab8
+                        empty = false;
28bab8
+                        prefix = pad_prefix;
28bab8
+                    }
28bab8
                 }
28bab8
+                free(first_prefix);
28bab8
+                g_list_free_full(reports, (GDestroyNotify)free_report_result);
28bab8
             }
28bab8
-            free(first_prefix);
28bab8
-            g_list_free_full(reports, (GDestroyNotify)free_report_result);
28bab8
         }
28bab8
     }
28bab8
 
28bab8
-- 
28bab8
1.8.3.1
28bab8