On 07/12/2012 06:24 PM, Denys Vlasenko wrote:
> Please review this and the following patch.
> 
> It only renames functions in libreport, nothing else.
> (Second patch does the same for arbt code).

-- 
vda


diff -x '*.po' -d -urpN abrt.6/src/applet/test_report.c 
abrt.7/src/applet/test_report.c
--- abrt.6/src/applet/test_report.c     2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/applet/test_report.c     2012-07-12 16:36:17.955153956 +0200
@@ -34,13 +34,13 @@ static char *do_log(char *log_line, void

 int main(int argc, char** argv)
 {
-    problem_data_t *problem_data = new_problem_data();
+    problem_data_t *problem_data = problem_data_new();

-    add_to_problem_data(problem_data, "analyzer", "wow");
+    problem_data_add_text_noteditable(problem_data, "analyzer", "wow");
     const char *event = "report";

     struct dump_dir *dd = create_dump_dir_from_problem_data(problem_data, 
"/tmp");
-    free_problem_data(problem_data);
+    problem_data_free(problem_data);
     if (!dd)
         return 1;
     char *dir_name = strdup(dd->dd_dirname);
diff -x '*.po' -d -urpN abrt.6/src/cli/abrt-cli-core.c 
abrt.7/src/cli/abrt-cli-core.c
--- abrt.6/src/cli/abrt-cli-core.c      2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/cli/abrt-cli-core.c      2012-07-12 16:40:08.381851919 +0200
@@ -36,7 +36,7 @@ void free_vector_of_problem_data(vector_

 vector_of_problem_data_t *new_vector_of_problem_data(void)
 {
-    return g_ptr_array_new_with_free_func((void (*)(void*)) 
&free_problem_data);
+    return g_ptr_array_new_with_free_func((void (*)(void*)) 
&problem_data_free);
 }

 problem_data_t *fill_crash_info(const char *dump_dir_name)
@@ -51,7 +51,7 @@ problem_data_t *fill_crash_info(const ch

     problem_data_t *problem_data = create_problem_data_from_dump_dir(dd);
     dd_close(dd);
-    add_to_problem_data_ext(problem_data, CD_DUMPDIR, dump_dir_name,
+    problem_data_add(problem_data, CD_DUMPDIR, dump_dir_name,
                             CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE + 
CD_FLAG_LIST);

     return problem_data;
diff -x '*.po' -d -urpN abrt.6/src/cli/list.c abrt.7/src/cli/list.c
--- abrt.6/src/cli/list.c       2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/cli/list.c       2012-07-12 17:42:04.964988450 +0200
@@ -72,7 +72,7 @@ static void print_crash_list(vector_of_p
         problem_data_t *crash = get_problem_data(crash_list, i);
         if (!include_reported)
         {
-            const char *msg = get_problem_item_content_or_NULL(crash, 
FILENAME_REPORTED_TO);
+            const char *msg = problem_data_get_content_or_NULL(crash, 
FILENAME_REPORTED_TO);
             if (msg)
                 continue;
         }
@@ -159,7 +159,7 @@ int cmd_info(int argc, const char **argv
         }

         print_crash(problem, opt_detailed);
-        free_problem_data(problem);
+        problem_data_free(problem);
         if (*argv)
             printf("\n");
     }
diff -x '*.po' -d -urpN abrt.6/src/cli/report.c abrt.7/src/cli/report.c
--- abrt.6/src/cli/report.c     2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/cli/report.c     2012-07-12 17:42:07.137983145 +0200
@@ -62,7 +62,7 @@ int cmd_report(int argc, const char **ar
             g_ptr_array_sort_with_data(ci, &cmp_problem_data, (char *) 
FILENAME_TIME);
             problem_data_t *pd = get_problem_data(ci, at);

-            dir_name = get_problem_item_content_or_NULL(pd, CD_DUMPDIR);
+            dir_name = problem_data_get_content_or_NULL(pd, CD_DUMPDIR);
         }

         int status = report_problem_in_dir(dir_name,
diff -x '*.po' -d -urpN abrt.6/src/gui-gtk/main.c abrt.7/src/gui-gtk/main.c
--- abrt.6/src/gui-gtk/main.c   2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/gui-gtk/main.c   2012-07-12 17:42:14.082966193 +0200
@@ -182,7 +182,7 @@ static void add_directory_to_dirlist(con

     char time_buf[sizeof("YYYY-MM-DD hh:mm:ss")];
     time_buf[0] = '\0';
-    const char *time_str = get_problem_item_content_or_NULL(pd, FILENAME_TIME);
+    const char *time_str = problem_data_get_content_or_NULL(pd, FILENAME_TIME);
     time_t t = 0;
     if (time_str && time_str[0])
     {
@@ -192,16 +192,16 @@ static void add_directory_to_dirlist(con
         time_buf[time_len] = '\0';
     }

-    const char *not_reportable_reason = get_problem_item_content_or_NULL(pd, 
FILENAME_NOT_REPORTABLE);
-    const char *reason = get_problem_item_content_or_NULL(pd, FILENAME_REASON);
+    const char *not_reportable_reason = problem_data_get_content_or_NULL(pd, 
FILENAME_NOT_REPORTABLE);
+    const char *reason = problem_data_get_content_or_NULL(pd, FILENAME_REASON);

     /* the source of the problem:
      * - first we try to load component, as we use it on Fedora
     */
-    const char *source = get_problem_item_content_or_NULL(pd, 
FILENAME_COMPONENT);
+    const char *source = problem_data_get_content_or_NULL(pd, 
FILENAME_COMPONENT);
     if (!source) /* if we don't have component, we fallback to executable */
-        source = get_problem_item_content_or_NULL(pd, FILENAME_EXECUTABLE);
-    const char *msg = get_problem_item_content_or_NULL(pd, 
FILENAME_REPORTED_TO);
+        source = problem_data_get_content_or_NULL(pd, FILENAME_EXECUTABLE);
+    const char *msg = problem_data_get_content_or_NULL(pd, 
FILENAME_REPORTED_TO);

     GtkListStore *list_store = s_dumps_list_store;
     char *subm_status = NULL;
@@ -225,7 +225,7 @@ static void add_directory_to_dirlist(con
                           -1);

     free(subm_status);
-    free_problem_data(pd);
+    problem_data_free(pd);

     VERB1 log("added: %s", problem_dir_path);
 }
@@ -678,18 +678,18 @@ static void on_button_send_cb(GtkWidget
                                            &it_end,
                                            false);

-    problem_data_t *pd = new_problem_data();
+    problem_data_t *pd = problem_data_new();

     if (text[0])
     {
-        add_to_problem_data(pd, "description", text);
+        problem_data_add_text_noteditable(pd, "description", text);
     }

     /* why it doesn't want to hide before report ends? */
     gtk_widget_destroy(s_report_window);

     report_problem_in_memory(pd, LIBREPORT_NOWAIT | LIBREPORT_GETPID);
-    free_problem_data(pd);
+    problem_data_free(pd);
 }

 static void on_menu_report_cb(GtkMenuItem *menuitem, gpointer unused)
diff -x '*.po' -d -urpN abrt.6/src/lib/hooklib.c abrt.7/src/lib/hooklib.c
--- abrt.6/src/lib/hooklib.c    2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/lib/hooklib.c    2012-07-12 16:40:00.513862336 +0200
@@ -357,18 +357,18 @@ static const char *get_filename(const ch

 problem_data_t *problem_data_new()
 {
-    return new_problem_data();
+    return problem_data_new();
 }

 int problem_data_add_item(problem_data_t *pd, char * key, char * value)
 {
-    add_to_problem_data_ext(pd, key, value, CD_FLAG_TXT);
+    problem_data_add(pd, key, value, CD_FLAG_TXT);
     return 0;
 }

 int problem_data_add_file(problem_data_t *pd, const char* path)
 {
-    add_to_problem_data_ext(pd, get_filename(path), path, CD_FLAG_FILE);
+    problem_data_add(pd, get_filename(path), path, CD_FLAG_FILE);
     return 0;
 }

@@ -387,6 +387,6 @@ int problem_data_save(problem_data_t *pd

 void problem_data_destroy(problem_data_t *pd)
 {
-    free_problem_data(pd);
+    problem_data_free(pd);
     pd = NULL;
 }
diff -x '*.po' -d -urpN abrt.6/src/lib/problem_api.c 
abrt.7/src/lib/problem_api.c
--- abrt.6/src/lib/problem_api.c        2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/lib/problem_api.c        2012-07-12 16:36:20.391150796 +0200
@@ -128,13 +128,13 @@ problem_data_t *get_problem_data_dbus(co
         return NULL;
     }

-    problem_data_t *pd = new_problem_data();
+    problem_data_t *pd = problem_data_new();
     char *key, *val;
     GVariantIter *iter;
     g_variant_get(result, "(a{ss})", &iter);
     while (g_variant_iter_loop(iter, "{ss}", &key, &val))
     {
-        add_to_problem_data(pd, key, val);
+        problem_data_add_text_noteditable(pd, key, val);
     }
     g_variant_unref(result);
     return pd;
diff -x '*.po' -d -urpN abrt.6/src/plugins/bodhi.c abrt.7/src/plugins/bodhi.c
--- abrt.6/src/plugins/bodhi.c  2012-07-10 19:15:17.000000000 +0200
+++ abrt.7/src/plugins/bodhi.c  2012-07-12 17:42:10.003976148 +0200
@@ -410,9 +410,9 @@ int main(int argc, char **argv)
             if (!problem_data)
                 xfunc_die(); /* create_problem_data_for_reporting already 
emitted error msg */

-            release = get_problem_item_content_or_NULL(problem_data, 
FILENAME_OS_RELEASE);
+            release = problem_data_get_content_or_NULL(problem_data, 
FILENAME_OS_RELEASE);
             //COMPAT, remove in abrt-2.1
-            if (!release) release = 
get_problem_item_content_or_die(problem_data, "release");
+            if (!release) release = 
problem_data_get_content_or_die(problem_data, "release");
             char *product = NULL, *version = NULL;
             parse_release_for_bz(release, &product, &version);
             query = strbuf_append_strf(query, "release=f%s&", version);

Reply via email to