Skip to content
Snippets Groups Projects
Commit ca853031 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

logging: fix file logging with no parameter

Remove trailing webengine parameters by not synthesizing command-line args. Use the env var QTWEBENGINE_CHROMIUM_FLAGS instead.

Gitlab: #1074
Change-Id: Ibc2a4f75317bd502a3cca96758ef72264babe255
parent 46ca469b
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,6 @@
#include "mainapplication.h"
#include "instancemanager.h"
#include "utils.h"
#include "version.h"
#include <QCryptographicHash>
......@@ -41,38 +40,11 @@
#ifndef ENABLE_TESTS
static char**
parseInputArgument(int& argc, char* argv[], QList<char*> argsToParse)
{
/*
* Forcefully append argsToParse.
*/
int oldArgc = argc;
argc += argsToParse.size();
auto newArgv = new char*[argc];
for (int i = 0; i < oldArgc; i++) {
newArgv[i] = argv[i];
}
for (int i = oldArgc; i < argc; i++) {
newArgv[i] = argsToParse.at(i - oldArgc);
}
return newArgv;
}
#ifdef WITH_WEBENGINE
// Qt WebEngine Chromium Flags
static char disableWebSecurity[] {"--disable-web-security"};
static char singleProcess[] {"--single-process"};
#endif
int
main(int argc, char* argv[])
{
setlocale(LC_ALL, "en_US.utf8");
QList<char*> qtWebEngineChromiumFlags;
#ifdef Q_OS_LINUX
if (!getenv("QT_QPA_PLATFORMTHEME")) {
auto xdgEnv = qgetenv("XDG_CURRENT_DESKTOP");
......@@ -94,10 +66,6 @@ main(int argc, char* argv[])
*/
unsetenv("QT_STYLE_OVERRIDE");
#endif
#ifdef WITH_WEBENGINE
qtWebEngineChromiumFlags << disableWebSecurity;
qtWebEngineChromiumFlags << singleProcess;
#endif
QApplication::setApplicationName(QStringLiteral("Jami"));
QApplication::setOrganizationDomain(QStringLiteral("jami.net"));
......@@ -107,9 +75,15 @@ main(int argc, char* argv[])
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
auto newArgv = parseInputArgument(argc, argv, qtWebEngineChromiumFlags);
#ifdef WITH_WEBENGINE
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
"--disable-web-security"
" --single-process");
QtWebEngineQuick::initialize();
#endif
MainApplication app(argc, argv);
MainApplication app(argc, newArgv);
app.setDesktopFileName(QStringLiteral("jami"));
#if defined(Q_OS_MACOS)
if (macutils::isMetalSupported()) {
......
......@@ -283,16 +283,6 @@ MainApplication::parseArguments()
parser.addHelpOption();
parser.addVersionOption();
// These options are potentially forced into the arg list.
QCommandLineOption webSecurityDisableOption(QStringList() << "disable-web-security");
parser.addOption(webSecurityDisableOption);
QCommandLineOption noSandboxOption(QStringList() << "no-sandbox");
parser.addOption(noSandboxOption);
QCommandLineOption singleProcessOption(QStringList() << "single-process");
parser.addOption(singleProcessOption);
QCommandLineOption webDebugOption(QStringList() << "remote-debugging-port",
"Web debugging port.",
"port");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment