From 9b4198663463ce584fbd4f78adff29edc2bbc51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 17 Nov 2016 04:09:24 +0100 Subject: GH-347 update timestamps of added mods --- api/logic/FileSystem.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'api/logic/FileSystem.cpp') diff --git a/api/logic/FileSystem.cpp b/api/logic/FileSystem.cpp index 7805a78b..67bafd28 100644 --- a/api/logic/FileSystem.cpp +++ b/api/logic/FileSystem.cpp @@ -60,6 +60,25 @@ QByteArray read(const QString &filename) return data; } +bool updateTimestamp(const QString& filename) +{ + QFile file(filename); + if (!file.exists()) + { + return false; + } + if (!file.open(QIODevice::ReadWrite)) + { + return false; + } + const quint64 size = file.size(); + file.seek(size); + file.write( QByteArray(1, '0') ); + file.resize(size); + return true; + +} + bool ensureFilePathExists(QString filenamepath) { QFileInfo a(filenamepath); -- cgit v1.2.3