From ad893943cfe0434624a1e807ed19e95286e362cc Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 14 Jan 2013 09:41:35 +0100 Subject: Add syncToDisk() to QAbstractFileEngine. This is needed by QSaveFile. Change-Id: I07ebdfd832c0be65c26f0aed1bb7852ac33135ca Reviewed-by: Thiago Macieira --- src/corelib/io/qfsfileengine_win.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/corelib/io/qfsfileengine_win.cpp') 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,13 +198,23 @@ 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 */ -- cgit v1.2.3