don't change timestamp of unchanged files
Change-Id: Ifa5c15a37d072c6c8edb50f8a4343d99ee0dccf9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
ca645afdc4
commit
922df2c233
@ -4235,6 +4235,12 @@ FileWriter::FileWriter(const QString &name)
|
||||
bool FileWriter::flush()
|
||||
{
|
||||
QTextStream::flush();
|
||||
QFile oldFile(m_name);
|
||||
if (oldFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
if (oldFile.readAll() == m_buffer.data())
|
||||
return true;
|
||||
oldFile.close();
|
||||
}
|
||||
QString dir = QFileInfo(m_name).absolutePath();
|
||||
if (!QDir().mkpath(dir)) {
|
||||
cout << "Cannot create directory " << qPrintable(QDir::toNativeSeparators(dir)) << ".\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user