Fix slash to backslash conversions in url hashes for opening links in incognito (#4307)

* Pass link as argument instead of in command string when opening incognito links

* Update CHANGELOG.md

* Make changelog message more user facing

* Remove now unused argument for getCommand
This commit is contained in:
askepticaldreamer 2023-01-19 00:03:35 -08:00 committed by GitHub
parent d1690943d4
commit 6ba1cf6ca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View file

@ -23,6 +23,7 @@
- Bugfix: Fixed crash that could occur when closing down a split at the wrong time. (#4277)
- Bugfix: Fixed crash that could occur when closing down the last of a channel when reloading emotes. (#4278)
- Bugfix: Fixed scrollbar highlight colors when changing message history limit. (#4288)
- Bugfix: Fixed an issue on Windows when opening links in incognito mode that contained forward slashes in hash (#4307)
- Dev: Remove protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256)
- Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198)
- Dev: Migrated to C++ 20 (#4252, #4257)

View file

@ -45,7 +45,7 @@ QString injectPrivateSwitch(QString command)
return QString();
}
QString getCommand(const QString &link)
QString getCommand()
{
// get default browser prog id
auto browserId = QSettings("HKEY_CURRENT_"
@ -74,9 +74,6 @@ QString getCommand(const QString &link)
return QString();
}
// link
command += " " + link;
return command;
}
#endif
@ -88,7 +85,7 @@ namespace chatterino {
bool supportsIncognitoLinks()
{
#ifdef Q_OS_WIN
return !getCommand("").isNull();
return !getCommand().isNull();
#else
return false;
#endif
@ -97,10 +94,10 @@ bool supportsIncognitoLinks()
bool openLinkIncognito(const QString &link)
{
#ifdef Q_OS_WIN
auto command = getCommand(link);
auto command = getCommand();
// TODO: split command into program path and incognito argument
return QProcess::startDetached(command, {});
return QProcess::startDetached(command, {link});
#else
return false;
#endif