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

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