Changeset View
Changeset View
Standalone View
Standalone View
libs/handler.cpp
Show First 20 Lines • Show All 434 Lines • ▼ Show 20 Line(s) | 430 | { | |||
---|---|---|---|---|---|
435 | connect(watcher, &QDBusPendingCallWatcher::finished, this, &Handler::replyFinished); | 435 | connect(watcher, &QDBusPendingCallWatcher::finished, this, &Handler::replyFinished); | ||
436 | } | 436 | } | ||
437 | 437 | | |||
438 | void Handler::requestScan(const QString &interface) | 438 | void Handler::requestScan(const QString &interface) | ||
439 | { | 439 | { | ||
440 | for (NetworkManager::Device::Ptr device : NetworkManager::networkInterfaces()) { | 440 | for (NetworkManager::Device::Ptr device : NetworkManager::networkInterfaces()) { | ||
441 | if (device->type() == NetworkManager::Device::Wifi) { | 441 | if (device->type() == NetworkManager::Device::Wifi) { | ||
442 | NetworkManager::WirelessDevice::Ptr wifiDevice = device.objectCast<NetworkManager::WirelessDevice>(); | 442 | NetworkManager::WirelessDevice::Ptr wifiDevice = device.objectCast<NetworkManager::WirelessDevice>(); | ||
443 | if (wifiDevice) { | 443 | | ||
444 | if (wifiDevice && wifiDevice->state() != NetworkManager::WirelessDevice::Unavailable) { | ||||
444 | if (!interface.isEmpty() && interface != wifiDevice->interfaceName()) { | 445 | if (!interface.isEmpty() && interface != wifiDevice->interfaceName()) { | ||
445 | continue; | 446 | continue; | ||
446 | } | 447 | } | ||
448 | | ||||
447 | qCDebug(PLASMA_NM) << "Requesting wifi scan on device" << wifiDevice->interfaceName(); | 449 | qCDebug(PLASMA_NM) << "Requesting wifi scan on device" << wifiDevice->interfaceName(); | ||
448 | QDBusPendingReply<> reply = wifiDevice->requestScan(); | 450 | QDBusPendingReply<> reply = wifiDevice->requestScan(); | ||
449 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); | 451 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); | ||
450 | watcher->setProperty("action", Handler::RequestScan); | 452 | watcher->setProperty("action", Handler::RequestScan); | ||
451 | watcher->setProperty("interface", wifiDevice->interfaceName()); | 453 | watcher->setProperty("interface", wifiDevice->interfaceName()); | ||
452 | connect(watcher, &QDBusPendingCallWatcher::finished, this, &Handler::replyFinished); | 454 | connect(watcher, &QDBusPendingCallWatcher::finished, this, &Handler::replyFinished); | ||
453 | } | 455 | } | ||
454 | } | 456 | } | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 517 | case Handler::RemoveConnection: | |||
518 | break; | 520 | break; | ||
519 | case Handler::UpdateConnection: | 521 | case Handler::UpdateConnection: | ||
520 | notification = new KNotification("FailedToUpdateConnection", KNotification::CloseOnTimeout, this); | 522 | notification = new KNotification("FailedToUpdateConnection", KNotification::CloseOnTimeout, this); | ||
521 | notification->setTitle(i18n("Failed to update connection %1", watcher->property("connection").toString())); | 523 | notification->setTitle(i18n("Failed to update connection %1", watcher->property("connection").toString())); | ||
522 | break; | 524 | break; | ||
523 | case Handler::RequestScan: | 525 | case Handler::RequestScan: | ||
524 | { | 526 | { | ||
525 | const QString interface = watcher->property("interface").toString(); | 527 | const QString interface = watcher->property("interface").toString(); | ||
526 | qCDebug(PLASMA_NM) << "Wireless scan on" << interface << "failed:" << error; | 528 | qCWarning(PLASMA_NM) << "Wireless scan on" << interface << "failed:" << error; | ||
527 | scanRequestFailed(interface); | 529 | scanRequestFailed(interface); | ||
528 | break; | 530 | break; | ||
529 | } | 531 | } | ||
530 | default: | 532 | default: | ||
531 | break; | 533 | break; | ||
532 | } | 534 | } | ||
533 | 535 | | |||
534 | if (notification) { | 536 | if (notification) { | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |