gui: main: Add --no-sandbox
This commit is contained in:
parent
ea1d027621
commit
2e3b008207
30
gui/main.cpp
30
gui/main.cpp
@ -4,6 +4,7 @@
|
|||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QCommandLineParser>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "searchresult.h"
|
#include "searchresult.h"
|
||||||
@ -65,22 +66,23 @@ int main(int argc, char *argv[])
|
|||||||
QString socketPath = "/tmp/looqs-spawner";
|
QString socketPath = "/tmp/looqs-spawner";
|
||||||
if(argc > 1)
|
if(argc > 1)
|
||||||
{
|
{
|
||||||
Common::setupAppInfo();
|
|
||||||
QApplication a(argc, argv);
|
|
||||||
QString arg = argv[1];
|
QString arg = argv[1];
|
||||||
if(arg == "ipc")
|
if(arg == "ipc")
|
||||||
{
|
{
|
||||||
|
Common::setupAppInfo();
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
IpcServer *ipcserver = new IpcServer();
|
IpcServer *ipcserver = new IpcServer();
|
||||||
qDebug() << "Launching ipc";
|
qDebug() << "Launching IPC Server";
|
||||||
if(!ipcserver->startSpawner(socketPath))
|
if(!ipcserver->startSpawner(socketPath))
|
||||||
{
|
{
|
||||||
qCritical() << "Error failed to spawn";
|
qCritical() << "Error failed to spawn";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
qDebug() << "Launched";
|
qDebug() << "Launched IPC Server";
|
||||||
}
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
QProcess process;
|
QProcess process;
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << "ipc";
|
args << "ipc";
|
||||||
@ -91,7 +93,25 @@ int main(int argc, char *argv[])
|
|||||||
QMessageBox::critical(nullptr, "Error", errorMsg);
|
QMessageBox::critical(nullptr, "Error", errorMsg);
|
||||||
}
|
}
|
||||||
Common::setupAppInfo();
|
Common::setupAppInfo();
|
||||||
|
QCommandLineParser parser;
|
||||||
|
parser.addOption({{"s", "no-sandbox"}, "Disable sandboxing"});
|
||||||
|
QStringList appArgs;
|
||||||
|
for(int i = 0; i < argc; i++)
|
||||||
|
{
|
||||||
|
appArgs.append(argv[i]);
|
||||||
|
}
|
||||||
|
parser.parse(appArgs);
|
||||||
|
|
||||||
|
if(!parser.isSet("no-sandbox"))
|
||||||
|
{
|
||||||
enableSandbox(socketPath);
|
enableSandbox(socketPath);
|
||||||
|
qInfo() << "Sandbox: on";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qInfo() << "Sandbox: off";
|
||||||
|
}
|
||||||
|
// Keep this post sandbox, afterwards does not work (suspect due to threads, but unconfirmed)
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user