mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 03:53:23 +02:00
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
This commit is contained in:
parent
46ca469bec
commit
ca85303110
2 changed files with 8 additions and 44 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue