diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2011-03-15 13:02:27 +0100 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2011-03-15 13:02:27 +0100 |
commit | 83bc2b3944dc0e130f8e5c751d73b4e4a63affdf (patch) | |
tree | faec598be5a48a0108b52cf18294e86f35233433 /src/plugins | |
parent | 7e0fb81d0e7fb98f94285fb2c3a5fae961a32a00 (diff) | |
download | abrt-83bc2b3944dc0e130f8e5c751d73b4e4a63affdf.tar.gz abrt-83bc2b3944dc0e130f8e5c751d73b4e4a63affdf.tar.xz abrt-83bc2b3944dc0e130f8e5c751d73b4e4a63affdf.zip |
get rid of std::vector from bugzilla
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/abrt-action-bugzilla.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/plugins/abrt-action-bugzilla.cpp b/src/plugins/abrt-action-bugzilla.cpp index c77a2bad..5b4eacc2 100644 --- a/src/plugins/abrt-action-bugzilla.cpp +++ b/src/plugins/abrt-action-bugzilla.cpp @@ -41,9 +41,10 @@ struct bug_info { const char* bug_reporter; const char* bug_product; xmlrpc_int32 bug_dup_id; - std::vector<char*> bug_cc; + GList* bug_cc; }; +/* xzalloc */ static void bug_info_init(struct bug_info* bz) { bz->bug_status = NULL; @@ -60,27 +61,7 @@ static void bug_info_destroy(struct bug_info* bz) free((void*)bz->bug_reporter); free((void*)bz->bug_product); - if (!bz->bug_cc.empty()) - { - for (unsigned ii = 0; ii < bz->bug_cc.size(); ii++) - free(bz->bug_cc[ii]); - - bz->bug_cc.clear(); - } -} - -static int am_i_in_cc(const struct bug_info* bz, const char* login) -{ - if (bz->bug_cc.empty()) - return -1; - - int size = bz->bug_cc.size(); - for (int ii = 0; ii < size; ii++) - { - if (strcmp(login, bz->bug_cc[ii]) == 0) - return 0; - } - return -1; + list_free_with_free(bz->bug_cc); } /* @@ -308,7 +289,7 @@ void ctx::get_bug_cc(xmlrpc_value* result_xml, struct bug_info* bz) if (*cc != '\0') { - bz->bug_cc.push_back((char*)cc); + bz->bug_cc = g_list_append(bz->bug_cc, (char*)cc); VERB3 log("member on cc is %s", cc); continue; } @@ -846,7 +827,8 @@ static void report_to_bugzilla( if (strcmp(bz.bug_status, "CLOSED") != 0) { int status = 0; - if ((strcmp(bz.bug_reporter, login) != 0) && (am_i_in_cc(&bz, login))) + if ((strcmp(bz.bug_reporter, login) != 0) + && (g_list_find(bz.bug_cc, login))) { log(_("Add %s to CC list"), login); status = bz_server.add_plus_one_cc(bug_id, login); |