[network/kdeconnect-kde/release/26.04] 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 605631f59d1d0d8380dfde7de567567834b1c5c3 by Albert Vaca Cintora.
Committed on 25/07/2026 at 10:37.
Pushed by albertvaka into branch 'release/26.04'.
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/605631f59d1d0d8380dfde7de567567834b1c5c3
diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp
index a4b01fedd..4273497f3 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 | QIODevice::Text)) {
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 | QIODevice::Text)) {
return;