fix-windows-qtcreator-build-fail.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 3ced487bd23b92a6f35eb590123bc510c9e2429c Mon Sep 17 00:00:00 2001
  2. From: zinface <[email protected]>
  3. Date: Mon, 6 Feb 2023 21:13:23 +0800
  4. Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=20Windows=20QtCreator=20?=
  5. =?UTF-8?q?=E4=B8=AD=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=A4=84=E7=90=86=E5=AF=BC?=
  6. =?UTF-8?q?=E8=87=B4=E7=BC=96=E8=AF=91=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?=
  7. =?UTF-8?q?=E9=A2=98?=
  8. MIME-Version: 1.0
  9. Content-Type: text/plain; charset=UTF-8
  10. Content-Transfer-Encoding: 8bit
  11. ---
  12. src/cceditor/ccnotepad.cpp | 7 ++++---
  13. 1 file changed, 4 insertions(+), 3 deletions(-)
  14. diff --git a/src/cceditor/ccnotepad.cpp b/src/cceditor/ccnotepad.cpp
  15. index ae615be..b2071d3 100755
  16. --- a/src/cceditor/ccnotepad.cpp
  17. +++ b/src/cceditor/ccnotepad.cpp
  18. @@ -983,11 +983,12 @@ int CCNotePad::runAsAdmin(const QString& filePath)
  19. //}
  20. QString argStr = QString("-muti %1").arg(filePath);
  21. - std::basic_string<TCHAR> args = StringToWString(argStr.toStdString());
  22. - size_t shellExecRes = (size_t)::ShellExecute(NULL, TEXT("runas"), nddFullPath, args.c_str(), TEXT("."), SW_SHOW);
  23. +// std::basic_string<TCHAR> args = StringToWString(argStr.toStdString());
  24. +// size_t shellExecRes = (size_t)::ShellExecute(NULL, TEXT("runas"), nddFullPath, args.c_str(), TEXT("."), SW_SHOW);
  25. + size_t shellExecRes = (size_t)::ShellExecute(NULL, TEXT("runas"), nddFullPath, argStr.toUtf8(), TEXT("."), SW_SHOW);
  26. // If the function succeeds, it returns a value greater than 32. If the function fails,
  27. - // it returns an error value that indicates the cause of the failure.
  28. + // it returns an error value that indicates the cause of the failure.
  29. // https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx
  30. if (shellExecRes < 32)
  31. --
  32. 2.39.1.windows.1