mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-23 17:56:50 +03:00
Merge pull request #17004 from Chocobo1/fixes
Improve compatiability with various platforms
This commit is contained in:
commit
80f624e4cc
3 changed files with 5 additions and 6 deletions
|
@ -774,7 +774,7 @@ void Application::applyMemoryWorkingSetLimit()
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
const SIZE_T maxSize = memoryWorkingSetLimit() * MiB;
|
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))
|
if (!::SetProcessWorkingSetSizeEx(::GetCurrentProcess(), minSize, maxSize, QUOTA_LIMITS_HARDWS_MAX_ENABLE))
|
||||||
{
|
{
|
||||||
const DWORD errorCode = ::GetLastError();
|
const DWORD errorCode = ::GetLastError();
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace
|
||||||
::RegQueryValueExW(handle, nameWStr.c_str(), NULL, &type, NULL, &cbData);
|
::RegQueryValueExW(handle, nameWStr.c_str(), NULL, &type, NULL, &cbData);
|
||||||
DWORD cBuffer = (cbData / sizeof(WCHAR)) + 1;
|
DWORD cBuffer = (cbData / sizeof(WCHAR)) + 1;
|
||||||
LPWSTR lpData = new WCHAR[cBuffer];
|
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;
|
QString result;
|
||||||
if (res == ERROR_SUCCESS)
|
if (res == ERROR_SUCCESS)
|
||||||
|
@ -171,7 +171,6 @@ namespace
|
||||||
if (res == ERROR_SUCCESS)
|
if (res == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
QStringList versions = getRegSubkeys(hkPythonCore);
|
QStringList versions = getRegSubkeys(hkPythonCore);
|
||||||
qDebug("Python versions nb: %d", versions.size());
|
|
||||||
versions.sort();
|
versions.sort();
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
|
@ -151,10 +151,10 @@ namespace
|
||||||
*/
|
*/
|
||||||
bool doesQFileIconProviderWork()
|
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;
|
QFileIconProvider provider;
|
||||||
const QIcon testIcon1 = provider.icon(QFileInfo(PSEUDO_UNIQUE_FILE_NAME + u".pdf"));
|
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"));
|
const QIcon testIcon2 = provider.icon(QFileInfo((PSEUDO_UNIQUE_FILE_NAME + u".png").data()));
|
||||||
return (!testIcon1.isNull() || !testIcon2.isNull());
|
return (!testIcon1.isNull() || !testIcon2.isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue