[Kmymoney] Re: QIF IMPORT: ERROR MESSAGE

Thomas Baumgart thb at net-bembel.de
Sat Apr 23 11:57:14 CEST 2011


Hi,

on Saturday 23 April 2011 11:27:20 timothy wrote:

> Hi
> 
> I am running KMM 1.0.5 on KDE 3.5.10 on Ubuntu Maverick.
> 
> I have written a program to output a QIF from a PDF.
> The QIF imports into KMM via the File/Import/QIF... correctly.
> 
> However when I right click on the QIF file and I try to open via "Open
> with KMyMoney" from the desktop box menu I get:
> 
> 1) If KMM is open:-> "Another instance of KMyMoney is already running.
> Do you want to quit?" If I quit and close the running KMM and try again
> with the right click open I get:
> 
> 2)File /home/timothy/Desktop/AG_LA_1220.qif contains the old binary
> format used by KMyMoney. Please use an older version of KMyMoney (0.8.x)
> that still supports this format to convert it to the new XML based
> format.

Hmm, 2) is clear, as you cannot open a QIF file, you can only import it.

For 1) I checked the 1.0.5 source. It contains an interesting comment:

  // Place code here to test for QIF and other locally-supported formats
  // (i.e. not a plugin). If you add them here, be sure to add it to
  // the webConnect function.

webConnect is the feature we're looking for. The unfortunate part is, that the 
code is not present, so it has never been added.  BTW: 4.5 lacks the same :(

> I mention 1) because when I right click and open an OFX file it goes
> straight into the QIF import of KMM whether KMM is already running or
> not.
> 
> I have tried the versions of QIF which I originally used to import my
> data from MsMoney and get the same error. I searched for "new XML based
> QIF format" with no success.
> 
> Basically the QIF file I have generated (and possibly every QIF file) is
> accepted by KMM only when importing from KMM itself. This makes for a
> number of extra steps and in any case a spurious error message.
> 
> Can I work round this to give the same results as OFX formats?

Not work around, but implement it, but it would involve code changes in C++. 
Patches are welcome.

> Could you please give me the names of the source files that handle the
> QIF importation to see if I can glean a better understanding of how KMM
> treats QIF?

The logic that gets this work done is spread over some source files. Start is 
in main.cpp (look for a call to "isImportableFile(url.path())". This function 
is in kmymoney2.cpp. This function contains a loop that checks for the format 
provided by so called plugins. QIF for historic reasons is not a plugin but 
could probably added here easily with the same functionality.

The actual processing of the data happens in KMyMoney2App::webConnect() which 
can also be found in kmymoney2.cpp and is called from main.cpp. This will 
become a bit more tricky, but the basic source part is available in 
KMyMoney2App::slotQifImport(). Simply don't use a dialog to get a filename.

Hope that helps to get started. If you have more of those questions please 
feel free to ask them on our developer list at kmymoney-devel at kde.org. You can 
also try IRC on the #kmymoney channel on freenode.org. Please be patient, 
sometimes it takes a day or more until you get an answer there as well.


-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
Please avoid sending me Word or PowerPoint attachments.
 See http://www.gnu.org/philosophy/no-word-attachments.html
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney/attachments/20110423/5589a80e/attachment-0001.sig 


More information about the KMyMoney mailing list