<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>499255</bug_id>
          
          <creation_ts>2025-01-28 20:29:52 +0000</creation_ts>
          <short_desc>Ledger appears blank (no transactions)</short_desc>
          <delta_ts>2025-01-30 16:43:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmymoney</product>
          <component>reports</component>
          <version>git (master)</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Alexandre">alexandref75</reporter>
          <assigned_to name="KMyMoney Devel Mailing List">kmymoney-devel</assigned_to>
          <cc>alexandref75</cc>
          
          <cf_commitlink>https://invent.kde.org/office/kmymoney/-/commit/d9db245c0e7125d9236421af5159b926376dad67</cf_commitlink>
          <cf_versionfixedin>5.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2393386</commentid>
    <comment_count>0</comment_count>
      <attachid>177778</attachid>
    <who name="Alexandre">alexandref75</who>
    <bug_when>2025-01-28 20:29:52 +0000</bug_when>
    <thetext>Created attachment 177778
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 &lt;thb@net-bembel.de&gt;
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&amp; sourc
     }
 
     if (LedgerSortProxyModel::filterAcceptsRow(source_row, source_parent)) {
-        const auto id = idx.data(filterRole()).toString();
-        bool rc = d-&gt;filterIds.contains(id);
+        const QVariant dataItem = idx.data(filterRole());
+        bool rc = false;
+        if (dataItem.canConvert&lt;QVariantList&gt;()) {
+            QSequentialIterable vList = dataItem.value&lt;QSequentialIterable&gt;();
+            for (const auto&amp; v : vList) {
+                rc |= d-&gt;filterIds.contains(v.toString());
+            }
+        } else {
+            const auto id = idx.data(filterRole()).toString();
+            rc = d-&gt;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-&gt;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2393387</commentid>
    <comment_count>1</comment_count>
    <who name="Alexandre">alexandref75</who>
    <bug_when>2025-01-28 20:32:01 +0000</bug_when>
    <thetext>Reverting the references commit fixes the error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2393601</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Baumgart">tbaumgart</who>
    <bug_when>2025-01-29 17:06:53 +0000</bug_when>
    <thetext>I am unable to duplicate the problem :( Both transactions show up just fine here (latest master). Are you building against Qt5 or Qt6?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2393624</commentid>
    <comment_count>3</comment_count>
    <who name="Alexandre">alexandref75</who>
    <bug_when>2025-01-29 18:06:56 +0000</bug_when>
    <thetext>Against qt6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2393704</commentid>
    <comment_count>4</comment_count>
    <who name="Alexandre">alexandref75</who>
    <bug_when>2025-01-30 00:22:14 +0000</bug_when>
    <thetext>A little additional debugging. Running with this debug added:
        const QVariant dataItem = idx.data(filterRole());
        bool rc = false;
        if (dataItem.canConvert&lt;QVariantList&gt;()) {
            QSequentialIterable vList = dataItem.value&lt;QSequentialIterable&gt;();
            for (const auto&amp; v : vList) {
                qDebug() &lt;&lt; &quot;Processing filterRole &quot; &lt;&lt; v.toString();
                rc |= d-&gt;filterIds.contains(v.toString());
                qDebug() &lt;&lt; &quot;Result filterRole &quot; &lt;&lt; rc;
            }
        } else {
            const auto id = idx.data(filterRole()).toString();
            qDebug() &lt;&lt; &quot;Processing filterRole &quot; &lt;&lt; id;
            rc = d-&gt;filterIds.contains(id);
            qDebug() &lt;&lt; &quot;Result filterRole &quot; &lt;&lt; rc;
        }

Produces:
-----------------------------------------------
Processing filterRole  &quot;A&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;1&quot;
Result filterRole  false
Processing filterRole  &quot;A&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;1&quot;
Result filterRole  false
Processing filterRole  &quot;&quot;
Result filterRole  false
Processing filterRole  &quot;&quot;
Result filterRole  false
Processing filterRole  &quot;A&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;1&quot;
Result filterRole  false
Processing filterRole  &quot;A&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;0&quot;
Result filterRole  false
Processing filterRole  &quot;1&quot;
Result filterRole  false
----------------------------------------------

commenting the lines and running again:
       const QVariant dataItem = idx.data(filterRole());
        bool rc = false;
        //if (dataItem.canConvert&lt;QVariantList&gt;()) {
        //    QSequentialIterable vList = dataItem.value&lt;QSequentialIterable&gt;();
        //    for (const auto&amp; v : vList) {
        //      qDebug() &lt;&lt; &quot;Processing filterRole &quot; &lt;&lt; v.toString();
        //        rc |= d-&gt;filterIds.contains(v.toString());
        //      qDebug() &lt;&lt; &quot;Result filterRole &quot; &lt;&lt; rc;
        //    }
        //} else {
            const auto id = idx.data(filterRole()).toString();
            qDebug() &lt;&lt; &quot;Processing filterRole &quot; &lt;&lt; id;
            rc = d-&gt;filterIds.contains(id);
            qDebug() &lt;&lt; &quot;Result filterRole &quot; &lt;&lt; rc;
        //}
Produces:
-----------------------------------------------
Processing filterRole  &quot;A000001&quot;
Result filterRole  true
Processing filterRole  &quot;A000001&quot;
Result filterRole  true
Processing filterRole  &quot;&quot;
Result filterRole  false
Processing filterRole  &quot;A000001&quot;
Result filterRole  true
Processing filterRole  &quot;A000001&quot;
Result filterRole  true
Processing filterRole  &quot;&quot;
Result filterRole  false
----------------------------------------------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2393840</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Baumgart">tbaumgart</who>
    <bug_when>2025-01-30 15:43:31 +0000</bug_when>
    <thetext>Seems that the problem is the apparently different behavior of QVariant::canConvert&lt;QVariantList&gt;() when used on a QVariant created from a QString between Qt5 (results in false) and Qt6 (results in true).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2393855</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas Baumgart">thb</who>
    <bug_when>2025-01-30 16:43:42 +0000</bug_when>
    <thetext>Git commit d9db245c0e7125d9236421af5159b926376dad67 by Thomas Baumgart.
Committed on 30/01/2025 at 16:43.
Pushed by tbaumgart into branch &apos;master&apos;.

Resolve different behavior of Qt5 vs Qt6 with QVariant
FIXED-IN: 5.2

M  +3    -9    kmymoney/models/ledgerfilterbase.cpp

https://invent.kde.org/office/kmymoney/-/commit/d9db245c0e7125d9236421af5159b926376dad67</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>177778</attachid>
            <date>2025-01-28 20:29:52 +0000</date>
            <delta_ts>2025-01-28 20:29:52 +0000</delta_ts>
            <desc>kmymoney file</desc>
            <filename>test.kmy</filename>
            <type>application/x-kmymoney</type>
            <size>962</size>
            <attacher name="Alexandre">alexandref75</attacher>
            
              <data encoding="base64">H4sICIEcmGcAAwDtVtuSm0YQfc9XEMqvrAAbraRi42Jh5BBrgeLiil7iQjDapZZbALmspPLv6Rlm
uGhrs7GrNk/hhemeHvqc00zP6O+/FrnwBTdtVpU3onIliwIukyrNyvsbMQq30kp8/9MP+o+Wa4Z7
Dwkf7/Z3roP20tbeIZi4sAVBJwPb2brEANP0kRHarvPZMkIkpHGHb0RVVmRJXknKWlywsJ0RhJ/v
XMve2siax6qaJCuSeh0q1xtN3WjXkrzcyPKw9BPyA0ggZCkQGLxb+9fpxHKYMDxvOqFdKVdrWTqq
q7WiYZz0cfpiSkOPAuQLZVwAnhC3HWhUxFl+I4r8m5bloyAQ2q7BuAO/kGTdmbzbjrIQhT+ymrw6
nOP6oSqpL6lOZdech+GZBYL+dL6u2o6NGSoChI5sJwjtMCLKBv2cZ+wRChggalB+nkweRWTwOwq/
wUfcQJ1pFs5FKOIueYDC4zI+5JiqKZxacNCJRwzwZB51X1YNTuIW06gx4Lc3TJP/ThWiC+XbSzTq
oJtuEJrICaHcvUah8YGNDNN0IyfkejGTKmYEXbrZGG2LQak6Bp26OKFISPY8JnSSqkwyqlHvKWDH
HLPezsq2y7pTR3eUKFQ1LvuJ8lQccEP5nmuAv+ZFYblS3CZNVvOFyakhNQL6UWCNqgbR7Rz8hbfn
wKq+GJYtnqzTF8x+VoNdFh+yHGr2ujooMhdikvAfxVg8Cxl9hTQtfmXAbzngId13wrWh1xavjVbl
aHm279X299Pr/wvLQVqW7dvB8o53gXO2r1+CPB47z4LnIbS5XtKY99uXOQybse9coW84gWHS9s4o
TlyUZihfPkrfGy/PTWjPuKhopyd99ek0/BSEePek03g7e95kiIMmD7jCZ4wnZ8yoKOvvccI5D1PH
PL6nB8mXOD9BkKTI8gLWtg9Qrna06yYj5xMdcwJjLYdTbRD+EJePBNqs500Y6IuJgv9aU/V/Tb9F
05mj/5U/ov0nYxchz7D98Xpi+wK9L+xg193RXZfEhJYFJAcaL9/9xg89FoV0gPuIyfbW8JFpm5iH
Z+kQ9Kf29lrVVvJSSrTjUnq3XKXSOlEVScOqFqepkmJ19Rffqk8o6YH5M7KiHWK3iwCZkW+HNrfB
8pFj2sP9jDn2tPAEIWsXUSBYVZ7HDdTuXBwquJe94T0FDp0GKkWu5lKBu4cKlsKf1sZHcoRC8Wu4
S70DR8IcDO08ue75tslx+chz/ZAZt5H1AXHDdXa2g35xb4kNjOfX/L8BTXK6/TcMAAA=
</data>

          </attachment>
      

    </bug>

</bugzilla>