From 8d6b200dd7f6d33ec102c5162efa89a1f17a66a2 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Wed, 30 May 2012 17:06:01 +0200 Subject: [PATCH] Improve performance of EntryHistoryModel. --- src/gui/entry/EntryHistoryModel.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/entry/EntryHistoryModel.cpp b/src/gui/entry/EntryHistoryModel.cpp index 32d4e0778..58aa49a69 100644 --- a/src/gui/entry/EntryHistoryModel.cpp +++ b/src/gui/entry/EntryHistoryModel.cpp @@ -52,11 +52,10 @@ QVariant EntryHistoryModel::data(const QModelIndex& index, int role) const return QVariant(); } - Entry* entry = entryFromIndex(index); - TimeInfo timeInfo = entry->timeInfo(); - QDateTime lastModificationLocalTime = timeInfo.lastModificationTime().toLocalTime(); - if (role == Qt::DisplayRole || role == Qt::UserRole) { + Entry* entry = entryFromIndex(index); + TimeInfo timeInfo = entry->timeInfo(); + QDateTime lastModificationLocalTime = timeInfo.lastModificationTime().toLocalTime(); switch (index.column()) { case 0: if (role == Qt::DisplayRole) {