csvImport: fix modified and creation time import

Creation and last modification time stamps are imported incorrectly
during CSV import:
    * the imported created time is set to the CSV's last modified time
    * the imported last modified time is set to the CSV's icon index
      (which isn't a valid time usually and gets set to the current
      date & time instead).

The reason is commit 33a3796074 ("Add ability to parse tags from CSV
files") which shifted indices but missed to update all relevant time
related code locations.

Update the missing indices for those two to fix the import.

* Closes #12378

Fixes: 33a3796074 ("Add ability to parse tags from CSV files")
Signed-off-by: André Draszik <andre.draszik@linaro.org>
This commit is contained in:
André Draszik 2025-08-12 07:51:34 +01:00 committed by Jonathan White
parent 8d59090243
commit 544f983bad

View file

@ -279,7 +279,7 @@ QSharedPointer<Database> CsvImportWidget::buildDatabase()
// Modified Time
TimeInfo timeInfo;
if (m_parserModel->data(m_parserModel->index(r, 9)).isValid()) {
auto datetime = m_parserModel->data(m_parserModel->index(r, 8)).toString();
auto datetime = m_parserModel->data(m_parserModel->index(r, 9)).toString();
if (datetime.contains(QRegularExpression("^\\d+$"))) {
auto t = datetime.toLongLong();
if (t <= INT32_MAX) {
@ -298,7 +298,7 @@ QSharedPointer<Database> CsvImportWidget::buildDatabase()
}
// Creation Time
if (m_parserModel->data(m_parserModel->index(r, 10)).isValid()) {
auto datetime = m_parserModel->data(m_parserModel->index(r, 9)).toString();
auto datetime = m_parserModel->data(m_parserModel->index(r, 10)).toString();
if (datetime.contains(QRegularExpression("^\\d+$"))) {
auto t = datetime.toLongLong();
if (t <= INT32_MAX) {