GH-347 update timestamps of added mods
This commit is contained in:
parent
b09fad9cbf
commit
9b41986634
3 changed files with 25 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue