From b73e9f4996b81008613251092def2a6579fa1660 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sun, 29 Oct 2023 21:12:59 +0100 Subject: [PATCH] Qt 6.7 (#1650) * Do not validate values for options without value * Clean-up * ws281x include files workaround * Revert "ws281x include files workaround" This reverts commit 1b983087183e3c563a191edd34a318cfd0cdace1. * Use https://github.com/hyperion-project/rpi_ws281x while fix is applied in original repository --- .gitmodules | 4 ++-- CMakeLists.txt | 11 +++++------ libsrc/commandline/Parser.cpp | 25 ++++++++++++++----------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.gitmodules b/.gitmodules index 624c175c..2fd17349 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "dependencies/external/rpi_ws281x"] path = dependencies/external/rpi_ws281x - url = https://github.com/jgarff/rpi_ws281x - branch = master + url = https://github.com/hyperion-project/rpi_ws281x + branch = main [submodule "dependencies/external/flatbuffers"] path = dependencies/external/flatbuffers url = https://github.com/google/flatbuffers diff --git a/CMakeLists.txt b/CMakeLists.txt index 813cb750..32bbb7d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,10 +222,11 @@ if (HYPERION_LIGHT) SET ( DEFAULT_OSX OFF ) SET ( DEFAULT_QT OFF ) SET ( DEFAULT_V4L2 OFF ) - SET ( DEFAULT_AUDIO OFF ) SET ( DEFAULT_X11 OFF ) SET ( DEFAULT_XCB OFF ) + SET ( DEFAULT_AUDIO OFF ) + # Disable Input Servers SET ( DEFAULT_BOBLIGHT_SERVER OFF ) SET ( DEFAULT_CEC OFF ) @@ -274,15 +275,13 @@ message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}") option(ENABLE_X11 "Enable the X11 grabber" ${DEFAULT_X11}) message(STATUS "ENABLE_X11 = ${ENABLE_X11}") -option(ENABLE_AUDIO "Enable the AUDIO grabber" ${DEFAULT_AUDIO}) -message(STATUS "ENABLE_AUDIO = ${ENABLE_AUDIO}") - -option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} ) -message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}") option(ENABLE_XCB "Enable the XCB grabber" ${DEFAULT_XCB}) message(STATUS "ENABLE_XCB = ${ENABLE_XCB}") +option(ENABLE_AUDIO "Enable the AUDIO grabber" ${DEFAULT_AUDIO}) +message(STATUS "ENABLE_AUDIO = ${ENABLE_AUDIO}") + removeIndent() message(STATUS "Input options:") diff --git a/libsrc/commandline/Parser.cpp b/libsrc/commandline/Parser.cpp index 0bceb682..df58fe1f 100644 --- a/libsrc/commandline/Parser.cpp +++ b/libsrc/commandline/Parser.cpp @@ -14,19 +14,22 @@ bool Parser::parse(const QStringList &arguments) return false; } - for(Option * option : _options) + for(Option * option : std::as_const(_options)) { - QString value = this->value(*option); - if (!option->validate(*this, value)) { - const QString error = option->getError(); - if (!error.isEmpty()) { - _errorText = tr("\"%1\" is not a valid option for %2, %3").arg(value, option->name(), error); + if (!option->valueName().isEmpty()) + { + QString value = this->value(*option); + if (!option->validate(*this, value)) { + const QString error = option->getError(); + if (!error.isEmpty()) { + _errorText = tr("\"%1\" is not a valid option for %2, %3").arg(value, option->name(), error); + } + else + { + _errorText = tr("\"%1\" is not a valid option for %2").arg(value, option->name()); + } + return false; } - else - { - _errorText = tr("\"%1\" is not a valid option for %2").arg(value, option->name()); - } - return false; } } return true;