Skip to content

Commit

Permalink
Don't use contextless connects
Browse files Browse the repository at this point in the history
Not strictly necessary, but best practice, enforced in Qt 6.7
since we're defining QT_NO_CONTEXTLESS_CONNECT.

See https://bugreports.qt.io/browse/QTBUG-116296 for background.
  • Loading branch information
pcolby committed Jan 2, 2024
1 parent ae271c7 commit 1275332
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cli/abstractcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AbstractCommand::AbstractCommand(QObject * const parent) : QObject(parent),
#else
&PokitDiscoveryAgent::errorOccurred,
#endif
[](const PokitDiscoveryAgent::Error &error) {
this, [](const PokitDiscoveryAgent::Error &error) {
qCWarning(lc).noquote() << tr("Bluetooth discovery error:") << error;
QTimer::singleShot(0, QCoreApplication::instance(), [](){
QCoreApplication::exit(EXIT_FAILURE);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/abstractpokitservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ bool AbstractPokitServicePrivate::createServiceObject()
connect(service, &QLowEnergyService::characteristicChanged,
this, &AbstractPokitServicePrivate::characteristicChanged);

connect(service, &QLowEnergyService::descriptorRead,
connect(service, &QLowEnergyService::descriptorRead, this,
[](const QLowEnergyDescriptor &descriptor, const QByteArray &value){
qCDebug(lc).noquote() << tr(R"(Descriptor "%1" (%2) read.)")
.arg(descriptor.name(), descriptor.uuid().toString());
Q_UNUSED(value)
});

connect(service, &QLowEnergyService::descriptorWritten,
connect(service, &QLowEnergyService::descriptorWritten, this,
[](const QLowEnergyDescriptor &descriptor, const QByteArray &newValue){
qCDebug(lc).noquote() << tr(R"(Descriptor "%1" (%2) written.)")
.arg(descriptor.name(), descriptor.uuid().toString());
Expand Down

0 comments on commit 1275332

Please sign in to comment.