[balsa] address-book-gpe: streamline some code
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] address-book-gpe: streamline some code
- Date: Thu, 27 Jun 2019 00:21:04 +0000 (UTC)
commit 19fafe0b108b1292c95b71158dec533be122d779
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Wed Jun 26 20:18:16 2019 -0400
address-book-gpe: streamline some code
Use the full-name we just created instead of fetching it.
ChangeLog | 4 ++++
libbalsa/address-book-gpe.c | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ee0438900..78a7c5dfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-06-26 Peter Bloomfield <pbloomfield bellsouth net>
+
+ * libbalsa/address-book-gpe.c: streamline.
+
2019-06-25 Peter Bloomfield <pbloomfield bellsouth net>
address: rename add to append
diff --git a/libbalsa/address-book-gpe.c b/libbalsa/address-book-gpe.c
index 1eeddcb4f..83a1505db 100644
--- a/libbalsa/address-book-gpe.c
+++ b/libbalsa/address-book-gpe.c
@@ -730,6 +730,7 @@ gpe_read_completion(void *arg, int argc, char **argv, char **names)
InternetAddress *ia;
guint uid = atoi(argv[0]);
guint n_addrs;
+ gchar *full_name;
guint n;
#ifdef HAVE_SQLITE3
gchar *sql;
@@ -754,25 +755,24 @@ gpe_read_completion(void *arg, int argc, char **argv, char **names)
return 0;
}
- if (libbalsa_address_get_full_name(address) == NULL) {
+ full_name = libbalsa_address_get_full_name(address);
+ if (full_name == NULL) {
const gchar *first_name;
const gchar *last_name;
- gchar *full_name;
first_name = libbalsa_address_get_first_name(address);
last_name = libbalsa_address_get_last_name(address);
full_name = create_name(first_name, last_name);
libbalsa_address_set_full_name(address, full_name);
- g_free(full_name);
}
for (n = 0; n < n_addrs; ++n) {
const gchar *addr = libbalsa_address_get_nth_addr(address, n);
- const gchar *full_name = libbalsa_address_get_full_name(address);
ia = internet_address_mailbox_new(full_name, addr);
gc->res = g_list_prepend(gc->res, ia);
}
+ g_free(full_name);
g_object_unref(address);
return 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]