[cli] Show all reachable devices
Summary: Devices that were reachable but not paired were not shown. This makes it impossible to initiate paring BUG: 402088 Test Plan: Have a unpaired device reachable. Without the patch kdeconnect-cli -l does not show it. With the patch it is shown Reviewers: #kde_connect, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D17788
This commit is contained in:
parent
b73472735f
commit
6262c09de8
1 changed files with 2 additions and 2 deletions
|
@ -84,14 +84,14 @@ int main(int argc, char** argv)
|
||||||
if (parser.isSet(QStringLiteral("my-id"))) {
|
if (parser.isSet(QStringLiteral("my-id"))) {
|
||||||
QTextStream(stdout) << iface.selfId() << endl;
|
QTextStream(stdout) << iface.selfId() << endl;
|
||||||
} else if (parser.isSet(QStringLiteral("l")) || parser.isSet(QStringLiteral("a"))) {
|
} else if (parser.isSet(QStringLiteral("l")) || parser.isSet(QStringLiteral("a"))) {
|
||||||
bool paired = true, reachable = false;
|
bool reachable = false;
|
||||||
if (parser.isSet(QStringLiteral("a"))) {
|
if (parser.isSet(QStringLiteral("a"))) {
|
||||||
reachable = true;
|
reachable = true;
|
||||||
} else {
|
} else {
|
||||||
blockOnReply(iface.acquireDiscoveryMode(id));
|
blockOnReply(iface.acquireDiscoveryMode(id));
|
||||||
QThread::sleep(2);
|
QThread::sleep(2);
|
||||||
}
|
}
|
||||||
const QStringList devices = blockOnReply<QStringList>(iface.devices(reachable, paired));
|
const QStringList devices = blockOnReply<QStringList>(iface.devices(reachable, false));
|
||||||
|
|
||||||
bool displayCount = true;
|
bool displayCount = true;
|
||||||
for (const QString& id : devices) {
|
for (const QString& id : devices) {
|
||||||
|
|
Loading…
Reference in a new issue