[kmymoney] [Bug 396286] New: KF5 ofximporter "Map account" fails on MS Windows

Jeff bugzilla_noreply at kde.org
Sat Jul 7 21:56:21 BST 2018


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

            Bug ID: 396286
           Summary: KF5 ofximporter "Map account" fails on MS Windows
           Product: kmymoney
           Version: git (master)
          Platform: MS Windows
                OS: MS Windows
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: importer
          Assignee: kmymoney-devel at kde.org
          Reporter: jeffjl.kde at outlook.com
  Target Milestone: ---

I have a couple of problems with ofxpartner.cpp on a craft-mingw-Qt5.11-windows
build.

First, the "get" function of the OfxHttpRequest constructor does not work.
Maybe because KIO::copy does not work on Windows. Maybe KIO::copy doesn't work
because of QUrl problems on Windows (see problem #2, below). Or maybe this has
been overlooked because if you have an old ofx-bank-index.xml file laying
around, KMM will use that file even if it fails to fetch a new one.

I hacked around that issue by just commenting out the "if(type.toLower() ==
QStringLiteral("get"))" section around ofxpartner.cpp line 297 and always using
the "post" code. A full fix would just remove the "type" parameter from that
function (it was unused in KMM4).

I have not been able to figure out a "clean" solution to the second problem. It
has to do with QUrl paths. I can not find a combination of QUrl, QFile, QDir,
QFileInfo calls that will construct a file name that succeeds with QFile::open
in the slotOfxConnected() method. Even though QUrl.isLocalFile() returns
"true", the file path either does not include the drive letter, e.g.
"/users/jeff/ofx-bank-index.xml", or includes the drive letter looking like a
network name, e.g. "//c/users/jeff/ofx-bank-index.xml". QFile fails to open
either of those. This may only be a problem because my KMM program is on D: and
my app folder is on C:. If they were on the same drive, maybe the "/users/jeff"
path would work.

If I just hack in a string replacement to change the "//c/" to "c:/" to pass to
QFile::open(), then KMM will fetch a new ofx-bank-index.xml and everything's
good from there (assuming the "get" fix is in). 

The "static QString directory" member variable is correctly "C:/users/jeff" at
the troublesome spot. It just gets lost in the QUrl.

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


More information about the KMyMoney-devel mailing list