From 1f1861485d842507bbb5c930cddd4a026922deef Mon Sep 17 00:00:00 2001 From: Refuhr Date: Wed, 29 Jul 2026 16:16:45 +0200 Subject: [PATCH] refactor: keep the gs_usb option out of non-Windows builds The radio button was only disabled elsewhere, which advertised a connection type that platform can never offer. Hide it instead, and guard the gs_usb.h include so nothing outside Windows reaches for it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XZnuZJ7zc3e8hk6C8bGDZN --- connections/canconfactory.cpp | 2 ++ connections/newconnectiondialog.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/connections/canconfactory.cpp b/connections/canconfactory.cpp index 84c85d4..a52b512 100644 --- a/connections/canconfactory.cpp +++ b/connections/canconfactory.cpp @@ -7,7 +7,9 @@ #include "lawicel_serial.h" #include "canserver.h" #include "canlogserver.h" +#ifdef Q_OS_WIN #include "gs_usb.h" +#endif using namespace CANCon; diff --git a/connections/newconnectiondialog.cpp b/connections/newconnectiondialog.cpp index 97d8476..2444eac 100644 --- a/connections/newconnectiondialog.cpp +++ b/connections/newconnectiondialog.cpp @@ -37,9 +37,9 @@ NewConnectionDialog::NewConnectionDialog(QVector* gvretips, QVectorrbGSUSB, &QAbstractButton::clicked, this, &NewConnectionDialog::handleConnTypeChanged); #ifndef Q_OS_WIN - //on Linux and macOS the kernel gs_usb driver already exposes these devices as SocketCAN - ui->rbGSUSB->setEnabled(false); - ui->rbGSUSB->setToolTip("Connect gs_usb devices through SocketCAN on this platform"); + //on Linux and macOS the kernel gs_usb driver already exposes these devices as SocketCAN, + //so there is nothing here to offer and the option is left out entirely + ui->rbGSUSB->setVisible(false); #endif connect(ui->cbDeviceType, QOverload::of(&QComboBox::currentIndexChanged), this, &NewConnectionDialog::handleDeviceTypeChanged);