Add support for opening links in incognito mode on Linux & BSD (#4745)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Sam Heybey
2023-08-06 09:57:01 -04:00
committed by GitHub
parent 168f346c81
commit 69c983e0d9
18 changed files with 741 additions and 61 deletions
+4 -4
View File
@@ -88,7 +88,7 @@ void setRegisteredForStartup(bool isRegistered)
}
}
QString getAssociatedCommand(AssociationQueryType queryType, LPCWSTR query)
QString getAssociatedExecutable(AssociationQueryType queryType, LPCWSTR query)
{
static HINSTANCE shlwapi = LoadLibrary(L"shlwapi");
if (shlwapi == nullptr)
@@ -122,7 +122,7 @@ QString getAssociatedCommand(AssociationQueryType queryType, LPCWSTR query)
}
DWORD resultSize = 0;
if (FAILED(assocQueryString(flags, ASSOCSTR_COMMAND, query, nullptr,
if (FAILED(assocQueryString(flags, ASSOCSTR_EXECUTABLE, query, nullptr,
nullptr, &resultSize)))
{
return QString();
@@ -137,8 +137,8 @@ QString getAssociatedCommand(AssociationQueryType queryType, LPCWSTR query)
QString result;
auto buf = new wchar_t[resultSize];
if (SUCCEEDED(assocQueryString(flags, ASSOCSTR_COMMAND, query, nullptr, buf,
&resultSize)))
if (SUCCEEDED(assocQueryString(flags, ASSOCSTR_EXECUTABLE, query, nullptr,
buf, &resultSize)))
{
// QString::fromWCharArray expects the length in characters *not
// including* the null terminator, but AssocQueryStringW calculates