mirror of
https://invent.kde.org/network/kdeconnect-kde.git
synced 2025-12-22 12:14:23 +01:00
Only show paired, reachable devices in CLI with -a
The help text indicates that the -a flag for kdeconnect-cli is supposed to list available devices, i.e. devices that are both paired and reachable. Prior to this change, devices are only filtered on reachability when the flag is passed. BUG: 442571
This commit is contained in:
@@ -81,14 +81,14 @@ int main(int argc, char** argv)
|
||||
if (parser.isSet(QStringLiteral("my-id"))) {
|
||||
QTextStream(stdout) << iface.selfId() << endl;
|
||||
} else if (parser.isSet(QStringLiteral("l")) || parser.isSet(QStringLiteral("a"))) {
|
||||
bool reachable = false;
|
||||
bool available = false;
|
||||
if (parser.isSet(QStringLiteral("a"))) {
|
||||
reachable = true;
|
||||
available = true;
|
||||
} else {
|
||||
blockOnReply(iface.acquireDiscoveryMode(id));
|
||||
QThread::sleep(2);
|
||||
}
|
||||
const QStringList devices = blockOnReply<QStringList>(iface.devices(reachable, false));
|
||||
const QStringList devices = blockOnReply<QStringList>(iface.devices(available, available));
|
||||
|
||||
bool displayCount = true;
|
||||
for (const QString& id : devices) {
|
||||
|
||||
Reference in New Issue
Block a user