From 2a172bf3ef563a408696d1ac18bd6826588930c7 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 1 Oct 2021 07:11:22 +0200 Subject: [PATCH] better formatting of tooltip valies in article list --- resources/desktop/com.github.rssguard.appdata.xml | 2 +- src/librssguard/core/messagesmodel.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index ff4d290d8..401cdf215 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/src/librssguard/core/messagesmodel.cpp b/src/librssguard/core/messagesmodel.cpp index f1a329737..fa6fcf963 100644 --- a/src/librssguard/core/messagesmodel.cpp +++ b/src/librssguard/core/messagesmodel.cpp @@ -344,14 +344,12 @@ QVariant MessagesModel::data(const QModelIndex& idx, int role) const { return QVariant(); } else { - QVariant dta = m_cache->containsData(idx.row()) - ? m_cache->data(idx) - : QSqlQueryModel::data(idx); - QString txt = dta.toString().size() > 300 - ? (dta.toString().left(300) + QSL("...")) - : dta.toString().left(300); - - return txt; + if (idx.column() == MSG_DB_SCORE_INDEX) { + return data(idx, Qt::ItemDataRole::EditRole); + } + else { + return data(idx, Qt::ItemDataRole::DisplayRole); + } } }