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

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