[kmymoney4] [Bug 360747] CSV Importer detects more columns than are assigned
NSLW via KDE Bugzilla
bugzilla_noreply at kde.org
Sat Mar 19 19:54:31 UTC 2016
https://bugs.kde.org/show_bug.cgi?id=360747
--- Comment #4 from NSLW <lukasz.wojnilowicz at gmail.com> ---
Created attachment 97981
--> https://bugs.kde.org/attachment.cgi?id=97981&action=edit
[PATCH] Use parseLine() to determine most likely fieldDelimiter
The place where warning is displayed is this:
>>>>>>>>>>>>>>>>>>>>>>
if (m_columnList.count() < m_endColumn) {
if (!m_csvDialog->m_accept) {
QString row = QString::number(m_row);
int ret = KMessageBox::questionYesNoCancel(0, i18n("<center>Row number %1
does not have the expected number of columns.</center>"
"<center>This might not be a problem, but it may be a header
line.</center>"
"<center>You may accept all similar items, or just this one, or
cancel.</center>",
row), i18n("CSV import"),
KGuiItem(i18n("Accept All")),
KGuiItem(i18n("Accept This")),
KGuiItem(i18n("Cancel")));
if (ret == KMessageBox::Cancel) {
return ret;
}
if (ret == KMessageBox::Yes) {
m_csvDialog->m_accept = true;
}
}
>>>>>>>>>>>>>>>>>>>>>>
Where m_columnList:
m_columnList = m_parse->parseLine(data);
and
m_endColumn = m_maxColumnCount = colCount =
data.count(m_parse->m_fieldDelimiterCharList[count]) + 1;
Data.count doesn't handle following lines well:
2016-01-25,MONNARI,Sprzedaż,20,"12,7",254,MON,3
It return 9 columns, while in fact it should return 8 (single value in double
quotes "12,7" is treated as two columns). parseLine(data) returns correct
value, which is 8 columns. Attached patch fixes this issue. Please revise it
and apply to master
branch.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the KMyMoney-devel
mailing list