Improve CSV export and import capability

* Fixes #3541
* CSV export now includes TOTP settings, Entry Icon (database icon number only), Modified Time, and Created Time.
* CSV import properly understands time in ISO 8601 format and Unix Timestamp.
* CSV import will set the TOTP settings and entry icon based on the chosen column.
This commit is contained in:
Jonathan White 2020-08-26 15:17:31 -04:00
parent f49f62d3be
commit f947c96462
7 changed files with 189 additions and 76 deletions

View file

@ -67,6 +67,10 @@ QString CsvExporter::exportHeader()
addColumn(header, "Password");
addColumn(header, "URL");
addColumn(header, "Notes");
addColumn(header, "TOTP");
addColumn(header, "Icon");
addColumn(header, "Last Modified");
addColumn(header, "Created");
return header + QString("\n");
}
@ -88,6 +92,10 @@ QString CsvExporter::exportGroup(const Group* group, QString groupPath)
addColumn(line, entry->password());
addColumn(line, entry->url());
addColumn(line, entry->notes());
addColumn(line, entry->totpSettingsString());
addColumn(line, QString::number(entry->iconNumber()));
addColumn(line, entry->timeInfo().lastModificationTime().toString(Qt::ISODate));
addColumn(line, entry->timeInfo().creationTime().toString(Qt::ISODate));
line.append("\n");
response.append(line);