Skip to content

Commit

Permalink
Removed WinRT QFile::copy() fix from Qt patch: change approved to Qt.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed May 2, 2016
1 parent dff5765 commit 19d1f0f
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions Telegram/Patches/qtbase_5_6_0.diff
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ index eec9e1f..ec3015e 100644
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_LTCG = -GL
QMAKE_CFLAGS_SSE2 = -arch:SSE2
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index f1a6019..81ff6ef 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -1416,8 +1416,10 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
COPYFILE2_EXTENDED_PARAMETERS copyParams = {
sizeof(copyParams), COPY_FILE_FAIL_IF_EXISTS, NULL, NULL, NULL
};
- bool ret = ::CopyFile2((const wchar_t*)source.nativeFilePath().utf16(),
- (const wchar_t*)target.nativeFilePath().utf16(), &copyParams) != 0;
+ // CopyFile2 returns HRESULT, not BOOL, so it should be tested for S_OK, not 0.
+ HRESULT hres = ::CopyFile2((const wchar_t*)source.nativeFilePath().utf16(),
+ (const wchar_t*)target.nativeFilePath().utf16(), &copyParams);
+ bool ret = SUCCEEDED(hres);
#endif // Q_OS_WINRT
if(!ret)
error = QSystemError(::GetLastError(), QSystemError::NativeError);
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 14e4fd1..c31c62b 100644
--- a/src/corelib/tools/qunicodetables.cpp
Expand Down

0 comments on commit 19d1f0f

Please sign in to comment.