Browse Source

Merge pull request #17004 from Chocobo1/fixes

Improve compatiability with various platforms
adaptive-webui-19844
Chocobo1 3 years ago committed by GitHub
parent
commit
80f624e4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/app/application.cpp
  2. 3
      src/base/utils/foreignapps.cpp
  3. 6
      src/gui/torrentcontentmodel.cpp

2
src/app/application.cpp

@ -774,7 +774,7 @@ void Application::applyMemoryWorkingSetLimit() @@ -774,7 +774,7 @@ void Application::applyMemoryWorkingSetLimit()
#ifdef Q_OS_WIN
const SIZE_T maxSize = memoryWorkingSetLimit() * MiB;
const SIZE_T minSize = std::min((64 * MiB), (maxSize / 2));
const auto minSize = std::min<SIZE_T>((64 * MiB), (maxSize / 2));
if (!::SetProcessWorkingSetSizeEx(::GetCurrentProcess(), minSize, maxSize, QUOTA_LIMITS_HARDWS_MAX_ENABLE))
{
const DWORD errorCode = ::GetLastError();

3
src/base/utils/foreignapps.cpp

@ -136,7 +136,7 @@ namespace @@ -136,7 +136,7 @@ namespace
::RegQueryValueExW(handle, nameWStr.c_str(), NULL, &type, NULL, &cbData);
DWORD cBuffer = (cbData / sizeof(WCHAR)) + 1;
LPWSTR lpData = new WCHAR[cBuffer];
LONG res = ::RegQueryValueExW(handle, nameWStr.c_str(), NULL, &type, (LPBYTE)lpData, &cbData);
LONG res = ::RegQueryValueExW(handle, nameWStr.c_str(), NULL, &type, reinterpret_cast<LPBYTE>(lpData), &cbData);
QString result;
if (res == ERROR_SUCCESS)
@ -171,7 +171,6 @@ namespace @@ -171,7 +171,6 @@ namespace
if (res == ERROR_SUCCESS)
{
QStringList versions = getRegSubkeys(hkPythonCore);
qDebug("Python versions nb: %d", versions.size());
versions.sort();
bool found = false;

6
src/gui/torrentcontentmodel.cpp

@ -151,10 +151,10 @@ namespace @@ -151,10 +151,10 @@ namespace
*/
bool doesQFileIconProviderWork()
{
const QString PSEUDO_UNIQUE_FILE_NAME = u"/tmp/qBittorrent-test-QFileIconProvider-845eb448-7ad5-4cdb-b764-b3f322a266a9"_qs;
const Path PSEUDO_UNIQUE_FILE_NAME = Utils::Fs::tempPath() / Path(u"qBittorrent-test-QFileIconProvider-845eb448-7ad5-4cdb-b764-b3f322a266a9"_qs);
QFileIconProvider provider;
const QIcon testIcon1 = provider.icon(QFileInfo(PSEUDO_UNIQUE_FILE_NAME + u".pdf"));
const QIcon testIcon2 = provider.icon(QFileInfo(PSEUDO_UNIQUE_FILE_NAME + u".png"));
const QIcon testIcon1 = provider.icon(QFileInfo((PSEUDO_UNIQUE_FILE_NAME + u".pdf").data()));
const QIcon testIcon2 = provider.icon(QFileInfo((PSEUDO_UNIQUE_FILE_NAME + u".png").data()));
return (!testIcon1.isNull() || !testIcon2.isNull());
}

Loading…
Cancel
Save