[kmymoney4] [Bug 360435] CSV Importer doesn't recognize security if its symbol isn't lower case

NSLW via KDE Bugzilla bugzilla_noreply at kde.org
Sun Mar 27 07:46:19 UTC 2016


https://bugs.kde.org/show_bug.cgi?id=360435

NSLW <lukasz.wojnilowicz at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #97972|0                           |1
        is obsolete|                            |

--- Comment #10 from NSLW <lukasz.wojnilowicz at gmail.com> ---
Created attachment 98111
  --> https://bugs.kde.org/attachment.cgi?id=98111&action=edit
[PATCH] Make matching securities by their symbols case insensitive v2

(In reply to allan from comment #9)
> (In reply to NSLW from comment #8)
> > That seems reasonable. Do you need me to send you another patch?
> 
> No, thanks.  I think we have enough.
> 
> Allan

It seems that it will be necessary. During search for another bug I found out
that QMap is sadly case sensitive and occasionally my security names were
wrong. Attached patch addresses this issue, so please revise it again and apply
to master.

In patch I also modified following code from csvwizard.cpp
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      bool exists;
      QString name;
      QList<MyMoneySecurity>::ConstIterator it = list.constBegin();
      while (it != list.constEnd()) {
        exists = false;
        if (!symbl.isEmpty())  {     //  symbol already exists
          sec = *it;
          name.clear();
          if (sec.tradingSymbol() == symbl) {
            exists = true;
            name = sec.name();
            break;
          }
        }
        ++it;
      }
      if (!exists) {
        name = securityName;
      }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I put  "exists = false;" out of while loop, otherwise condition "if (!exists)"
will newer be met and thus if security was not in "securities tab" from outset,
then it couldn't be created in "equities tab" automatically during import. Do
you want me to open another bug report for that?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list