[network/kdeconnect-kde/release/26.08] plugins/share: Protect from creation/modification timestamps being 0
Albert Vaca Cintora <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 91361a2c7a628b2edcbe3b41ecf75cfc254dda17 by Albert Vaca Cintora.
Committed on 25/07/2026 at 10:38.
Pushed by albertvaka into branch 'release/26.08'.
Protect from creation/modification timestamps being 0
BUG: 523078
(cherry picked from commit f9674f3c983959e3f1af6c337e47ff024c0b0640)
M +6 -0 plugins/share/shareplugin.cpp
https://invent.kde.org/network/kdeconnect-kde/-/commit/91361a2c7a628b2edcbe3b41ecf75cfc254dda17
diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp
index ca65e48f6..8ce9af22a 100644
--- a/plugins/share/shareplugin.cpp
+++ b/plugins/share/shareplugin.cpp
@@ -71,6 +71,9 @@ static QString cleanFilename(const QString &filename)
void SharePlugin::setDateModified(const QUrl &destination, const qint64 timestamp)
{
+ if (timestamp == 0) {
+ return;
+ }
QFile receivedFile(destination.toLocalFile());
if (!receivedFile.exists() || !receivedFile.open(QIODevice::ReadWrite)) {
return;
@@ -80,6 +83,9 @@ void SharePlugin::setDateModified(const QUrl &destination, const qint64 timestam
void SharePlugin::setDateCreated(const QUrl &destination, const qint64 timestamp)
{
+ if (timestamp == 0) {
+ return;
+ }
QFile receivedFile(destination.toLocalFile());
if (!receivedFile.exists() || !receivedFile.open(QIODevice::ReadWrite)) {
return;