mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +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 "mainapplication.h"
|
||||||
#include "instancemanager.h"
|
#include "instancemanager.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
@ -41,38 +40,11 @@
|
||||||
|
|
||||||
#ifndef ENABLE_TESTS
|
#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
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
setlocale(LC_ALL, "en_US.utf8");
|
setlocale(LC_ALL, "en_US.utf8");
|
||||||
|
|
||||||
QList<char*> qtWebEngineChromiumFlags;
|
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
if (!getenv("QT_QPA_PLATFORMTHEME")) {
|
if (!getenv("QT_QPA_PLATFORMTHEME")) {
|
||||||
auto xdgEnv = qgetenv("XDG_CURRENT_DESKTOP");
|
auto xdgEnv = qgetenv("XDG_CURRENT_DESKTOP");
|
||||||
|
@ -94,10 +66,6 @@ main(int argc, char* argv[])
|
||||||
*/
|
*/
|
||||||
unsetenv("QT_STYLE_OVERRIDE");
|
unsetenv("QT_STYLE_OVERRIDE");
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_WEBENGINE
|
|
||||||
qtWebEngineChromiumFlags << disableWebSecurity;
|
|
||||||
qtWebEngineChromiumFlags << singleProcess;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QApplication::setApplicationName(QStringLiteral("Jami"));
|
QApplication::setApplicationName(QStringLiteral("Jami"));
|
||||||
QApplication::setOrganizationDomain(QStringLiteral("jami.net"));
|
QApplication::setOrganizationDomain(QStringLiteral("jami.net"));
|
||||||
|
@ -107,9 +75,15 @@ main(int argc, char* argv[])
|
||||||
QApplication::setHighDpiScaleFactorRoundingPolicy(
|
QApplication::setHighDpiScaleFactorRoundingPolicy(
|
||||||
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
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"));
|
app.setDesktopFileName(QStringLiteral("jami"));
|
||||||
#if defined(Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
if (macutils::isMetalSupported()) {
|
if (macutils::isMetalSupported()) {
|
||||||
|
|
|
@ -283,16 +283,6 @@ MainApplication::parseArguments()
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.addVersionOption();
|
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",
|
QCommandLineOption webDebugOption(QStringList() << "remote-debugging-port",
|
||||||
"Web debugging port.",
|
"Web debugging port.",
|
||||||
"port");
|
"port");
|
||||||
|
|
Loading…
Add table
Reference in a new issue