summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-14 09:30:55 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-20 21:10:13 +0200
commit1bbd0db1190193f29297881b42c25947b4bf87bd (patch)
treec54611c4cb6185052a9608e022751ed9a4eb86d8
parent34a2c3c2e3c09c513a04406ad46838af5ff4eff8 (diff)
Handle non-ascii names for pulseaudio5.15
Uses percentage encoded utf8. Task-number: QTBUG-85363 Change-Id: Idabe6ff9a66897792732b9ebb648f54a84e86bb8 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--src/core/content_main_delegate_qt.cpp3
-rw-r--r--src/core/web_engine_context.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 2d7d1eb57..cf8582ef2 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -224,7 +224,8 @@ void ContentMainDelegateQt::PreSandboxStartup()
#endif
if (parsedCommandLine->HasSwitch(service_manager::switches::kApplicationName)) {
- const std::string appName = parsedCommandLine->GetSwitchValueASCII(service_manager::switches::kApplicationName);
+ std::string appName = parsedCommandLine->GetSwitchValueASCII(service_manager::switches::kApplicationName);
+ appName = QByteArray::fromPercentEncoding(QByteArray::fromStdString(appName)).toStdString();
QCoreApplication::setApplicationName(QString::fromStdString(appName));
#if defined(OS_LINUX)
media::AudioManager::SetGlobalAppName(appName);
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index c7add160b..6d76a818d 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -580,7 +580,7 @@ WebEngineContext::WebEngineContext()
setupProxyPac(parsedCommandLine);
parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
- parsedCommandLine->AppendSwitchASCII(service_manager::switches::kApplicationName, QCoreApplication::applicationName().toStdString());
+ parsedCommandLine->AppendSwitchASCII(service_manager::switches::kApplicationName, QCoreApplication::applicationName().toUtf8().toPercentEncoding().toStdString());
// Enable sandboxing on OS X and Linux (Desktop / Embedded) by default.
bool disable_sandbox = qEnvironmentVariableIsSet(kDisableSandboxEnv);