Skip to content

Commit

Permalink
Explicitly require C++20 to build
Browse files Browse the repository at this point in the history
Otherwise the build fails on Windows due to use of designated
initializers in solarinputmodel.cpp.

Also fix -Wdeprecated-this-capture warnings in backendconnection.cpp
and basedevicemodel.cpp.
  • Loading branch information
blammit committed Feb 17, 2025
1 parent 8ad0a6c commit 2eaaeaa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("Building VenusOS for ${CMAKE_SYSTEM_NAME}")
message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
Expand Down
2 changes: 1 addition & 1 deletion src/backendconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void BackendConnection::initMqttConnection(const QString &address)
producer->continueConnect();
}
});
connect(mqttProducer, &VeQItemMqttProducer::connectionStateChanged, this, [=] {
connect(mqttProducer, &VeQItemMqttProducer::connectionStateChanged, this, [&mqttProducer, this] {
setState(mqttProducer->connectionState());
});
connect(mqttProducer, &VeQItemMqttProducer::errorChanged,
Expand Down
8 changes: 4 additions & 4 deletions src/basedevicemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void BaseDevice::setServiceUid(const QString &serviceUid)
}

if (m_serviceUid != serviceUid) {
maybeEmitValidChanged([=]() {
maybeEmitValidChanged([serviceUid, this]() {
m_serviceUid = serviceUid;
emit serviceUidChanged();
});
Expand All @@ -50,7 +50,7 @@ int BaseDevice::deviceInstance() const
void BaseDevice::setDeviceInstance(int deviceInstance)
{
if (m_deviceInstance != deviceInstance) {
maybeEmitValidChanged([=]() {
maybeEmitValidChanged([deviceInstance, this]() {
m_deviceInstance = deviceInstance;
emit deviceInstanceChanged();
});
Expand Down Expand Up @@ -78,7 +78,7 @@ QString BaseDevice::productName() const
void BaseDevice::setProductName(const QString &productName)
{
if (m_productName != productName) {
maybeEmitValidChanged([=]() {
maybeEmitValidChanged([productName, this]() {
m_productName = productName;
emit productNameChanged();
});
Expand All @@ -93,7 +93,7 @@ QString BaseDevice::customName() const
void BaseDevice::setCustomName(const QString &customName)
{
if (m_customName != customName) {
maybeEmitValidChanged([=]() {
maybeEmitValidChanged([customName, this]() {
m_customName = customName;
emit customNameChanged();
});
Expand Down

0 comments on commit 2eaaeaa

Please sign in to comment.