Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
5fc354c496 |
1 changed files with 2 additions and 6 deletions
|
@ -85,13 +85,9 @@ static QString cleanFilename(const QString &filename)
|
||||||
void SharePlugin::setDateModified(const QUrl& destination, const qint64 timestamp)
|
void SharePlugin::setDateModified(const QUrl& destination, const qint64 timestamp)
|
||||||
{
|
{
|
||||||
QFile receivedFile(destination.toLocalFile());
|
QFile receivedFile(destination.toLocalFile());
|
||||||
if (!receivedFile.exists()) {
|
if (!receivedFile.exists() || !receivedFile.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
||||||
if (!receivedFile.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
|
||||||
QString error_msg = receivedFile.errorString();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
receivedFile.open(QIODevice::ReadWrite | QIODevice::Text);
|
|
||||||
receivedFile.setFileTime(QDateTime::fromMSecsSinceEpoch(timestamp), QFileDevice::FileTime(QFileDevice::FileModificationTime));
|
receivedFile.setFileTime(QDateTime::fromMSecsSinceEpoch(timestamp), QFileDevice::FileTime(QFileDevice::FileModificationTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue