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

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