From f0709d187d5f914e34c8421440bb49e4d0a5e73b Mon Sep 17 00:00:00 2001 From: Ojas Anand Date: Sat, 4 Apr 2020 03:41:40 -0400 Subject: [PATCH] Check if hiding notes by default is enabled, hide text if it is - Check if hide notes setting is enabled and update EntryModel notes' data if so - Fixes #4412 --- src/gui/entry/EntryModel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/entry/EntryModel.cpp b/src/gui/entry/EntryModel.cpp index 405de9495..00a4f5890 100644 --- a/src/gui/entry/EntryModel.cpp +++ b/src/gui/entry/EntryModel.cpp @@ -185,8 +185,12 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const } return result; case Notes: - // Display only first line of notes in simplified format - result = entry->notes().section("\n", 0, 0).simplified(); + // Display only first line of notes in simplified format if not hidden + if (config()->get("security/hidenotes").toBool()) { + result = EntryModel::HiddenContentDisplay; + } else { + result = entry->notes().section("\n", 0, 0).simplified(); + } if (attr->isReference(EntryAttributes::NotesKey)) { result.prepend(tr("Ref: ", "Reference abbreviation")); }