From 95d391e8697af2e1f15f82c5451a2f710ea5d210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Mon, 1 Aug 2022 19:59:01 +0200 Subject: [PATCH] fix remote debugging --- src/main.cpp | 14 ++++++++++---- src/main.h | 6 ++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/main.h diff --git a/src/main.cpp b/src/main.cpp index 97ed6ad..879f40a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,5 @@ +#include "main.h" + #include "mainwindow.h" #include "virtmic.h" @@ -20,10 +22,9 @@ int main(int argc, char *argv[]) { QCommandLineOption virtmicOption("virtmic", "Start the Virtual Microphone", "target"); parser.addOption(virtmicOption); -#ifdef DEBUG - parser.addOption(QCommandLineOption( - "remote-debugging-port", "Chromium Remote Debugging Port", "port")); -#endif + QCommandLineOption degubOption("remote-debugging", + "Open Chromium Remote Debugging on port 9222"); + parser.addOption(degubOption); parser.process(app); if (parser.isSet(virtmicOption)) { @@ -34,6 +35,11 @@ int main(int argc, char *argv[]) { "--enable-features=WebRTCPipeWireCapturer " + qgetenv("QTWEBENGINE_CHROMIUM_FLAGS")); + if (parser.isSet(degubOption)) + qputenv("QTWEBENGINE_CHROMIUM_FLAGS", + "--remote-debugging-port=9222 " + + qgetenv("QTWEBENGINE_CHROMIUM_FLAGS")); + MainWindow w; w.show(); diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..c9ee7d0 --- /dev/null +++ b/src/main.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +int main(int argc, char *argv[]); +void addToEnvVar(const char *var, const char *val);