summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine_win.cpp
diff options
context:
space:
mode:
authorDavid Faure <faure+bluesystems@kde.org>2013-01-14 09:41:35 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-14 23:44:15 +0100
commitad893943cfe0434624a1e807ed19e95286e362cc (patch)
tree397d1d631e433ee8e501b585e7ebfc0a123be997 /src/corelib/io/qfsfileengine_win.cpp
parent7e7b65c370207fa849ac0ec69fe9209f08d8f2e3 (diff)
Add syncToDisk() to QAbstractFileEngine.
This is needed by QSaveFile. Change-Id: I07ebdfd832c0be65c26f0aed1bb7852ac33135ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfsfileengine_win.cpp')
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 86e9bf971d..756e884bd1 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -198,15 +198,25 @@ bool QFSFileEnginePrivate::nativeFlush()
return true;
}
- // Windows native mode; flushing is
- // unnecessary. FlushFileBuffers(), the equivalent of sync() or
- // fsync() on Unix, does a low-level flush to the disk, and we
- // don't expose an API for this.
+ // Windows native mode; flushing is unnecessary.
return true;
}
/*
\internal
+ \since 5.1
+*/
+bool QFSFileEnginePrivate::nativeSyncToDisk()
+{
+ if (fh || fd != -1) {
+ // stdlib / stdio mode. No API available.
+ return false;
+ }
+ return FlushFileBuffers(fileHandle);
+}
+
+/*
+ \internal
*/
qint64 QFSFileEnginePrivate::nativeSize() const
{