[geary: 6/8] conversation-list: construct string in place for single participant
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 6/8] conversation-list: construct string in place for single participant
- Date: Sun, 28 Apr 2019 00:54:03 +0000 (UTC)
commit 7909f85bd2d988578a983c9dc0c4e47d904afa5b
Author: Konstantin Kharlamov <Hi-Angel yandex ru>
Date: Tue Apr 23 03:22:33 2019 +0300
conversation-list: construct string in place for single participant
Signed-off-by: Konstantin Kharlamov <Hi-Angel yandex ru>
.../conversation-list/formatted-conversation-data.vala | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/client/conversation-list/formatted-conversation-data.vala
b/src/client/conversation-list/formatted-conversation-data.vala
index 5f9e667b..a87b1797 100644
--- a/src/client/conversation-list/formatted-conversation-data.vala
+++ b/src/client/conversation-list/formatted-conversation-data.vala
@@ -216,12 +216,14 @@ public class FormattedConversationData : Geary.BaseObject {
}
}
- StringBuilder builder = new StringBuilder("<span foreground='%s'>".printf(
- rgba_to_markup(get_foreground_rgba(widget, selected))));
if (list.size == 1) {
// if only one participant, use full name
- builder.append(list[0].get_full_markup(account_owner_emails));
+ return "<span foreground='%s'>%s</span>"
+ .printf(rgba_to_markup(get_foreground_rgba(widget, selected)),
+ list[0].get_full_markup(account_owner_emails));
} else {
+ StringBuilder builder = new StringBuilder("<span foreground='%s'>".printf(
+ rgba_to_markup(get_foreground_rgba(widget, selected))));
bool first = true;
foreach (ParticipantDisplay participant in list) {
if (!first)
@@ -230,10 +232,9 @@ public class FormattedConversationData : Geary.BaseObject {
builder.append(participant.get_short_markup(account_owner_emails));
first = false;
}
+ builder.append("</span>");
+ return builder.str;
}
- builder.append("</span>");
-
- return builder.str;
}
public void render(Cairo.Context ctx, Gtk.Widget widget, Gdk.Rectangle background_area,
@@ -434,4 +435,3 @@ public class FormattedConversationData : Geary.BaseObject {
}
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]