you cannot call non const method on a temp const QString
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 17 May 2024 14:34:45 +0000 (16:34 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 17 May 2024 14:34:45 +0000 (16:34 +0200)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/syncfileitem.cpp

index a7fd1c7d53e98c8836ea5c51a1239ed5b1e3bdea..7ac7ca15378c367251e567a45b56de5b53e4ba3a 100644 (file)
@@ -219,7 +219,8 @@ SyncFileItemPtr SyncFileItem::fromProperties(const QString &filePath, const QMap
         const auto intConvertedValue = properties.value(QStringLiteral("lock-timeout")).toULongLong(&ok);
         item->_lockTimeout = ok ? intConvertedValue : 0;
     }
-    const auto lastModifiedValue = properties.value(QStringLiteral("getlastmodified")).replace("GMT", "+0000");
+    auto getlastmodified = properties.value(QStringLiteral("getlastmodified"));
+    const auto lastModifiedValue = getlastmodified.replace(QStringLiteral("GMT"), QStringLiteral("+0000"));
     const auto date = QDateTime::fromString(lastModifiedValue, Qt::RFC2822Date);
     Q_ASSERT(date.isValid());
     if (date.toSecsSinceEpoch() > 0) {