https://bugs.kde.org/show_bug.cgi?id=499255
Bug ID: 499255 Summary: Ledger appear blank (no transactions) Classification: Applications Product: kmymoney Version: git (master) Platform: Gentoo Packages OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: reports Assignee: kmymoney-de...@kde.org Reporter: alexandre...@gmail.com Target Milestone: --- Created attachment 177778 --> https://bugs.kde.org/attachment.cgi?id=177778&action=edit kmymoney file SUMMARY Ledger appear blank (no transactions). I bisected it to this commit cbcaed2493329507191b24fb7c8d0fa3a36eed92. >From cbcaed2493329507191b24fb7c8d0fa3a36eed92 Mon Sep 17 00:00:00 2001 From: Thomas Baumgart <t...@net-bembel.de> Date: Sat, 18 Jan 2025 11:22:06 +0100 Subject: [PATCH 1/1] Fix tag filtering in tags view The transaction tab in the tags view did not show transactions that referenced more than one tag. Only those that had a single tag assigned were shown. This change fixes the problem by interpreting the returned data from the journal model properly as list of ids and checks each single one for a match. --- kmymoney/models/ledgerfilterbase.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kmymoney/models/ledgerfilterbase.cpp b/kmymoney/models/ledgerfilterbase.cpp index eabf7913c..fc69ffeb0 100644 --- a/kmymoney/models/ledgerfilterbase.cpp +++ b/kmymoney/models/ledgerfilterbase.cpp @@ -181,8 +181,17 @@ bool LedgerFilterBase::filterAcceptsRow(int source_row, const QModelIndex& sourc } if (LedgerSortProxyModel::filterAcceptsRow(source_row, source_parent)) { - const auto id = idx.data(filterRole()).toString(); - bool rc = d->filterIds.contains(id); + const QVariant dataItem = idx.data(filterRole()); + bool rc = false; + if (dataItem.canConvert<QVariantList>()) { + QSequentialIterable vList = dataItem.value<QSequentialIterable>(); + for (const auto& v : vList) { + rc |= d->filterIds.contains(v.toString()); + } + } else { + const auto id = idx.data(filterRole()).toString(); + rc = d->filterIds.contains(id); + } // in case a journal entry has no id, it is the new transaction placeholder if (!rc) { -- 2.48.1 STEPS TO REPRODUCE 1. Use the attached test.kmy (created with a single account and two transactions) 2. Go to ledgers->select account test 3. OBSERVED RESULT Ledger appears blank EXPECTED RESULT Two transactions being printed SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) KMyMoney: 5.1.90-13115d9f4 Alkimia: 8.1.92(I18N_ARGUMENT_MISSING) (build against 8.1.92(I18N_ARGUMENT_MISSING)) Gpgme: Unknown(I18N_ARGUMENT_MISSING) (build against 1.24.1(I18N_ARGUMENT_MISSING)) KDiagram: Unknown(I18N_ARGUMENT_MISSING) (build against (I18N_ARGUMENT_MISSING)) libofx: Unknown(I18N_ARGUMENT_MISSING) (build against 0.10.9(I18N_ARGUMENT_MISSING)) KDE Frameworks: 6.10.0 Qt: Using 6.8.1 and built against 6.8.1 Gentoo Linux (Wayland) Build ABI: x86_64-little_endian-lp64 Kernel: linux 6.13.0-gentoo-archlinux ADDITIONAL INFORMATION -- You are receiving this mail because: You are watching all bug changes.