In KMyMoneyApp::slotStatementImport() a temporary file containing imported statements is created using a path only working for Thomas Baumgart. Reproducible: Always Steps to Reproduce: 1. run kmymoney with strace 2. import statements 3. Actual Results: There were message complaining that /home/thb/kmm-statement-xxx.txt is an invalid path Expected Results: a log file should be created
Created attachment 82566 [details] fixed path of generated log file
I can confirm this. Stumbled over it in the past as well.
From what I know this is an extra, kind of strange (if you ask me), feature that lets users debug statement import if something goes wrong.
(In reply to comment #3) > From what I know this is an extra, kind of strange (if you ask me), feature > that lets users debug statement import if something goes wrong. which would require a related enable checkbox and an output path input field in the settings ?
(In reply to comment #4) > (In reply to comment #3) > > From what I know this is an extra, kind of strange (if you ask me), feature > > that lets users debug statement import if something goes wrong. > which would require a related enable checkbox and an output path input field > in the settings ? or in the import dialog ?
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > From what I know this is an extra, kind of strange (if you ask me), feature > > > that lets users debug statement import if something goes wrong. > > which would require a related enable checkbox and an output path input field > > in the settings ? > or in the import dialog ? Thomas should answer this one :) because I remember proposing something similar back in 2010 at the KDE finance sprint but he insisted that the current behavior is better (I I remeber correctly because it's kind of hidden - the log will only be created if '/home/thb/' exists).
That sounds like the ofx transaction log - it only gets created if the file ofxlog.txt exists in your home directory. (In that case, the file must exist, instead of the directory.) However, if it does not exist, nothing should happen - no error messages. Also, the name should be something more generic, like kmmlog, and not specific to one person. Separately, does this "feature" need to me mentioned in the manual?
> That sounds like the ofx transaction log no , ofxlog.txt is mentioned at the following places kmymoney/plugins/ofximport/ofxpartner.cpp:386: if (homeDir.exists("ofxlog.txt")) { kmymoney/plugins/ofximport/ofxpartner.cpp:387: d->m_fpTrace.setFileName(QString("%1/ofxlog.txt").arg(QDir::homePath())); kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp:94: if (homeDir.exists("ofxlog.txt")) { kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp:95: d->m_fpTrace.setFileName(QString("%1/ofxlog.txt").arg(QDir::homePath())); while the file mentioned in this bug is used at kmymoney/kmymoney.cpp:2308: MyMoneyStatement::writeXMLFile(s, QString("/home/thb/kmm-statement-%1.txt").arg(d->m_statementXMLindex++)); and logs the content of KMymoneyStatement's.
On Tue, 01 Oct 2013 16:44:17 +0000 Ralf Habacker <ralf.habacker@freenet.de> wrote: > https://bugs.kde.org/show_bug.cgi?id=325472 > > --- Comment #8 from Ralf Habacker <ralf.habacker@freenet.de> --- > > That sounds like the ofx transaction log > no , ofxlog.txt is mentioned at the following places > > kmymoney/plugins/ofximport/ofxpartner.cpp:386: if > (homeDir.exists("ofxlog.txt")) { > kmymoney/plugins/ofximport/ofxpartner.cpp:387: > d->m_fpTrace.setFileName(QString("%1/ofxlog.txt").arg(QDir::homePath())); > kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp:94: if > (homeDir.exists("ofxlog.txt")) { > kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp:95: > d->m_fpTrace.setFileName(QString("%1/ofxlog.txt").arg(QDir::homePath())); > > while the file mentioned in this bug is used at > > kmymoney/kmymoney.cpp:2308: MyMoneyStatement::writeXMLFile(s, > QString("/home/thb/kmm-statement-%1.txt").arg(d->m_statementXMLindex++)); > > and logs the content of KMymoneyStatement's. > And then there's also " bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& messages) { // // For testing, save the statement to an XML file // (uncomment this line) // //MyMoneyStatement::writeXMLFile(s, "Imported.Xml"); " Allan
To Comment #8: I was not trying to say the two were the same, or used the same code, but had the same issue that they write to a log only if the log file (for ofx) or directory (for the subject of this bug) exists. The ofx log process is silent (correctly, I think) if the file does not exist. If the import process complains that the directory is not present, instead of silently ignoring it - I think it would make sense to change that. Wasn't that at least part of the reason for filing this bug?
Please keep in mind, that these files contain sensitive data (e.g. passwords in clear-text etc.). In case trace data is written I suggest to present the user a window that shows that fact while providing the full filename so that he/she is aware of what is going on. These files could be written to ~/.kde/share/apps/kmymoney/logs or similar. I don't mind if /home/thb disappears ;)
Based on the previous comment by Thomas, we should remove this "feature" so I'm confirming this.
remove it, or change it to use a more generic location and explicitly confirm with the user before writing to that log?
Created attachment 105694 [details] screenshot with proposal Opening a dialog each time an import is performed does not look very effective. Instead my proposal is to add an additional "developer" tab to the main settings dialog setting a log path and check boxes to enable the different log files. This has also the advantage to assist user support in the way that there is an official way to create log files. From this bug I see two log file types 1. statement import 2. ofx transactions Any objections ?
see https://git.reviewboard.kde.org/r/130137/
Git commit b447041778f255eaf33b689fa8ac3d5c5e4f0f25 by Ralf Habacker. Committed on 29/05/2017 at 09:06. Pushed by habacker into branch '4.8'. Add import statements and ofx transactions log option to "support" tab of general settings page. REVIEW:130137 FIXED-IN:4.8.1 M +28 -0 kmymoney/dialogs/settings/ksettingsgeneral.cpp M +4 -0 kmymoney/dialogs/settings/ksettingsgeneral.h M +103 -8 kmymoney/dialogs/settings/ksettingsgeneraldecl.ui M +4 -1 kmymoney/kmymoney.cpp M +9 -0 kmymoney/kmymoney.kcfg M +4 -3 kmymoney/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp M +4 -3 kmymoney/plugins/ofximport/ofxpartner.cpp https://commits.kde.org/kmymoney/b447041778f255eaf33b689fa8ac3d5c5e4f0f25
Git commit b5873066cced4a78a468df91fb45b6736791aaac by Ralf Habacker. Committed on 27/06/2017 at 18:26. Pushed by habacker into branch '4.8'. Add layout to support tab of setting general page to avoid clipped labels. M +89 -81 kmymoney/dialogs/settings/ksettingsgeneraldecl.ui https://commits.kde.org/kmymoney/b5873066cced4a78a468df91fb45b6736791aaac
Git commit 071693e961e7666b4f2f94d8f6f3724b18d29ff1 by Ralf Habacker. Committed on 05/07/2017 at 14:16. Pushed by habacker into branch '4.8'. Use introduced log file path also on removing log files. M +2 -3 kmymoney/kmymoney.cpp https://commits.kde.org/kmymoney/071693e961e7666b4f2f94d8f6f3724b18d29ff1