Bug 395980 - KF5 cannot import ofx file on MS Windows
Summary: KF5 cannot import ofx file on MS Windows
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: git (master)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-28 22:09 UTC by Jeff
Modified: 2018-10-05 15:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff 2018-06-28 22:09:10 UTC
Using 5.x git master with a craft mingw build on Windows, attempts to import an OFX file result in a a messagebox error, similar to:

"Unable to import file:///D:/Users/Jeff/Documents/KMyMoney/TestFiles/trades.ofx using the OFX importer plugin.  This file is not the correct format."

The error message is itself misleading. There is no problem with the ofx file format.

The problem is the use of QUrl.path() on Windows, so KMM couldn't find the file. If I change the 2 occurrences of url.path() to url.toLocalFile() in ofximporter.cpp the import succeeds.
Comment 1 Thomas Baumgart 2018-10-05 15:02:02 UTC
Git commit 15c9f3ac39c8719095ee9aaa66097d1bd191380b by Thomas Baumgart.
Committed on 05/10/2018 at 15:02.
Pushed by tbaumgart into branch '5.0'.

Fix problem with leading slash in filenames under ms-windows

A URL of the form file:///C:/abc.xyz is returned as /C:/abc.xyz when the
path() method is used. This causes the QFile::open() method to fail. The
QUrl::toLocalFile() method does return C:/abc.xyz in this case.
Related: bug 399378

M  +2    -3    kmymoney/kmymoney.cpp
M  +2    -2    kmymoney/plugins/ofx/import/dialogs/konlinebankingsetupwizard.cpp
M  +3    -2    kmymoney/plugins/ofx/import/ofximporter.cpp
M  +14   -8    kmymoney/plugins/ofx/import/ofxpartner.cpp
M  +1    -1    kmymoney/plugins/xml/xmlstorage.cpp

https://commits.kde.org/kmymoney/15c9f3ac39c8719095ee9aaa66097d1bd191380b