Changeset View
Changeset View
Standalone View
Standalone View
libs/handler.cpp
Show First 20 Lines • Show All 408 Lines • ▼ Show 20 Line(s) | |||||
409 | } | 409 | } | ||
410 | 410 | | |||
411 | void Handler::requestScan() | 411 | void Handler::requestScan() | ||
412 | { | 412 | { | ||
413 | Q_FOREACH (NetworkManager::Device::Ptr device, NetworkManager::networkInterfaces()) { | 413 | Q_FOREACH (NetworkManager::Device::Ptr device, NetworkManager::networkInterfaces()) { | ||
414 | if (device->type() == NetworkManager::Device::Wifi) { | 414 | if (device->type() == NetworkManager::Device::Wifi) { | ||
415 | NetworkManager::WirelessDevice::Ptr wifiDevice = device.objectCast<NetworkManager::WirelessDevice>(); | 415 | NetworkManager::WirelessDevice::Ptr wifiDevice = device.objectCast<NetworkManager::WirelessDevice>(); | ||
416 | if (wifiDevice) { | 416 | if (wifiDevice) { | ||
417 | QDBusPendingReply<> reply = wifiDevice->requestScan(); | 417 | wifiDevice->requestScan(); | ||
418 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); | | |||
419 | watcher->setProperty("action", Handler::RequestScan); | | |||
420 | connect(watcher, &QDBusPendingCallWatcher::finished, this, &Handler::replyFinished); | | |||
421 | } | 418 | } | ||
422 | } | 419 | } | ||
423 | } | 420 | } | ||
424 | } | 421 | } | ||
425 | 422 | | |||
426 | void Handler::initKdedModule() | 423 | void Handler::initKdedModule() | ||
427 | { | 424 | { | ||
428 | QDBusMessage initMsg = QDBusMessage::createMethodCall(QStringLiteral(AGENT_SERVICE), | 425 | QDBusMessage initMsg = QDBusMessage::createMethodCall(QStringLiteral(AGENT_SERVICE), | ||
Show All 26 Lines | 439 | switch (action) { | |||
455 | case Handler::DeactivateConnection: | 452 | case Handler::DeactivateConnection: | ||
456 | notification = new KNotification("FailedToDeactivateConnection", KNotification::CloseOnTimeout, this); | 453 | notification = new KNotification("FailedToDeactivateConnection", KNotification::CloseOnTimeout, this); | ||
457 | notification->setTitle(i18n("Failed to deactivate %1", watcher->property("connection").toString())); | 454 | notification->setTitle(i18n("Failed to deactivate %1", watcher->property("connection").toString())); | ||
458 | break; | 455 | break; | ||
459 | case Handler::RemoveConnection: | 456 | case Handler::RemoveConnection: | ||
460 | notification = new KNotification("FailedToRemoveConnection", KNotification::CloseOnTimeout, this); | 457 | notification = new KNotification("FailedToRemoveConnection", KNotification::CloseOnTimeout, this); | ||
461 | notification->setTitle(i18n("Failed to remove %1", watcher->property("connection").toString())); | 458 | notification->setTitle(i18n("Failed to remove %1", watcher->property("connection").toString())); | ||
462 | break; | 459 | break; | ||
463 | case Handler::RequestScan: | | |||
464 | /* INFO: Disabled for now as wifi scanning is now automatic | | |||
465 | notification = new KNotification("FailedToRequestScan", KNotification::CloseOnTimeout, this); | | |||
466 | notification->setTitle(i18n("Failed to request scan")); | | |||
467 | */ | | |||
468 | break; | | |||
469 | case Handler::UpdateConnection: | 460 | case Handler::UpdateConnection: | ||
470 | notification = new KNotification("FailedToUpdateConnection", KNotification::CloseOnTimeout, this); | 461 | notification = new KNotification("FailedToUpdateConnection", KNotification::CloseOnTimeout, this); | ||
471 | notification->setTitle(i18n("Failed to update connection %1", watcher->property("connection").toString())); | 462 | notification->setTitle(i18n("Failed to update connection %1", watcher->property("connection").toString())); | ||
472 | break; | 463 | break; | ||
473 | default: | 464 | default: | ||
474 | break; | 465 | break; | ||
475 | } | 466 | } | ||
476 | 467 | | |||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |