diff --git a/src/model/export/CSVExportEngine.cpp b/src/model/export/CSVExportEngine.cpp index 29293fd..2e197dd 100644 --- a/src/model/export/CSVExportEngine.cpp +++ b/src/model/export/CSVExportEngine.cpp @@ -161,7 +161,7 @@ bool CSVExportEngine::SaveTags() ESCAPE_CHARS(tag.name); *_writer << QString::number(tag.id) << ";"; - *_writer << "\"" << tag.name << "\"" << ";"; + *_writer << "\"" << tag.name << "\""; *_writer << endl; } @@ -196,8 +196,8 @@ bool CSVExportEngine::SaveOperations(std::vector* operations) *_writer << QString::number(it->transfert) << ";"; *_writer << it->formula << ";"; *_writer << (it->meta ? "1" : "0") << ";"; - *_writer << (it->_virtual ? "1" : "0"); - *_writer << QString::number(it->tag) << ";"; + *_writer << (it->_virtual ? "1" : "0") << ";"; + *_writer << QString::number(it->tag); *_writer << endl; } diff --git a/src/model/export/ExportEngine.cpp b/src/model/export/ExportEngine.cpp index 441b056..3773f30 100644 --- a/src/model/export/ExportEngine.cpp +++ b/src/model/export/ExportEngine.cpp @@ -40,7 +40,7 @@ bool ExportEngine::HandleFile(const QString& path, User* user, Database* db, Kis bool ExportEngine::SaveFile(std::vector* operations) { int i; - int account, category; + int account, category, tag; AccountAmount accountAmount; int minMonth = -1, minYear = -1; unsigned int maxMonth = -1, maxYear = -1; @@ -51,12 +51,14 @@ bool ExportEngine::SaveFile(std::vector* operations) _accounts.clear(); _categories.clear(); + _tags.clear(); _accountAmounts.clear(); for(i=0; i<(int)operations->size(); i++) { account = (*operations)[i].account; category = (*operations)[i].category; + tag = (*operations)[i].tag; if (minYear == -1 || (int)(*operations)[i].year < minYear) maxYear = minYear = (*operations)[i].year; @@ -78,7 +80,10 @@ bool ExportEngine::SaveFile(std::vector* operations) if (category && !_categories.count(category)) _categories[category]++; - } + + if (tag && !_tags.count(tag)) + _tags[tag]++; +} for(it=_accounts.begin(); it!=_accounts.end(); it++) {