fix remote debugging

This commit is contained in:
Malte Jürgens 2022-08-01 19:59:01 +02:00
parent af107168db
commit 95d391e869
2 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,5 @@
#include "main.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "virtmic.h" #include "virtmic.h"
@ -20,10 +22,9 @@ int main(int argc, char *argv[]) {
QCommandLineOption virtmicOption("virtmic", "Start the Virtual Microphone", QCommandLineOption virtmicOption("virtmic", "Start the Virtual Microphone",
"target"); "target");
parser.addOption(virtmicOption); parser.addOption(virtmicOption);
#ifdef DEBUG QCommandLineOption degubOption("remote-debugging",
parser.addOption(QCommandLineOption( "Open Chromium Remote Debugging on port 9222");
"remote-debugging-port", "Chromium Remote Debugging Port", "port")); parser.addOption(degubOption);
#endif
parser.process(app); parser.process(app);
if (parser.isSet(virtmicOption)) { if (parser.isSet(virtmicOption)) {
@ -34,6 +35,11 @@ int main(int argc, char *argv[]) {
"--enable-features=WebRTCPipeWireCapturer " + "--enable-features=WebRTCPipeWireCapturer " +
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS")); qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
if (parser.isSet(degubOption))
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
"--remote-debugging-port=9222 " +
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
MainWindow w; MainWindow w;
w.show(); w.show();

6
src/main.h Normal file
View file

@ -0,0 +1,6 @@
#pragma once
#include <QString>
int main(int argc, char *argv[]);
void addToEnvVar(const char *var, const char *val);