[kde-doc-english] [trojita] src/Imap/Model: GUI: Message list: add placeholder text for empty subjects
Jan Kundrát
jkt at flaska.net
Wed Aug 7 15:12:32 UTC 2013
Git commit 9377bb5a51626d9e7a56e32a995f9599298aab4b by Jan Kundrát.
Committed on 06/08/2013 at 08:59.
Pushed by jkt into branch 'master'.
GUI: Message list: add placeholder text for empty subjects
REVIEW: 11904
M +10 -1 src/Imap/Model/PrettyMsgListModel.cpp
http://commits.kde.org/trojita/9377bb5a51626d9e7a56e32a995f9599298aab4b
diff --git a/src/Imap/Model/PrettyMsgListModel.cpp b/src/Imap/Model/PrettyMsgListModel.cpp
index dde7686..e9309de 100644
--- a/src/Imap/Model/PrettyMsgListModel.cpp
+++ b/src/Imap/Model/PrettyMsgListModel.cpp
@@ -101,7 +101,12 @@ QVariant PrettyMsgListModel::data(const QModelIndex &index, int role) const
return PrettySize::prettySize(size.toUInt());
}
case MsgListModel::SUBJECT:
- return translated.data(RoleIsFetched).toBool() ? translated.data(RoleMessageSubject) : tr("Loading...");
+ {
+ if (!translated.data(RoleIsFetched).toBool())
+ return tr("Loading...");
+ QString subject = translated.data(RoleMessageSubject).toString();
+ return subject.isEmpty() ? tr("(no subject)") : subject;
+ }
}
break;
@@ -173,6 +178,10 @@ QVariant PrettyMsgListModel::data(const QModelIndex &index, int role) const
font.setUnderline(true);
}
+ if (index.column() == MsgListModel::SUBJECT && translated.data(RoleMessageSubject).toString().isEmpty()) {
+ font.setItalic(true);
+ }
+
return font;
}
}
More information about the kde-doc-english
mailing list