trim start/end whitespace off feed title in lists

This commit is contained in:
Martin Rotter 2021-10-21 09:16:07 +02:00
parent 03823ff2e3
commit 208ff870e9
2 changed files with 6 additions and 2 deletions

View File

@ -307,9 +307,13 @@ QVariant MessagesModel::data(const QModelIndex& idx, int role) const {
return dt.toString(m_customDateFormat); return dt.toString(m_customDateFormat);
} }
} }
else if (index_column == MSG_DB_FEED_TITLE_INDEX) {
// Trim feed title.
return data(idx, Qt::ItemDataRole::EditRole).toString().trimmed();
}
else if (index_column == MSG_DB_CONTENTS_INDEX) { else if (index_column == MSG_DB_CONTENTS_INDEX) {
// Do not display full contents here. // Do not display full contents here.
QString contents = data(idx, Qt::EditRole).toString().mid(0, 64).simplified() + QL1S("..."); QString contents = data(idx, Qt::ItemDataRole::EditRole).toString().mid(0, 64).simplified() + QL1S("...");
return contents; return contents;
} }

View File

@ -164,7 +164,7 @@ QVariant RootItem::data(int column, int role) const {
case Qt::ItemDataRole::DisplayRole: case Qt::ItemDataRole::DisplayRole:
if (column == FDS_MODEL_TITLE_INDEX) { if (column == FDS_MODEL_TITLE_INDEX) {
return m_title; return m_title.trimmed();
} }
else if (column == FDS_MODEL_COUNTS_INDEX) { else if (column == FDS_MODEL_COUNTS_INDEX) {
int count_unread = countOfUnreadMessages(); int count_unread = countOfUnreadMessages();