Changeset View
Changeset View
Standalone View
Standalone View
libs/handler.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
69 | { | 69 | { | ||
70 | initKdedModule(); | 70 | initKdedModule(); | ||
71 | QDBusConnection::sessionBus().connect(QStringLiteral(AGENT_SERVICE), | 71 | QDBusConnection::sessionBus().connect(QStringLiteral(AGENT_SERVICE), | ||
72 | QStringLiteral(AGENT_PATH), | 72 | QStringLiteral(AGENT_PATH), | ||
73 | QStringLiteral(AGENT_IFACE), | 73 | QStringLiteral(AGENT_IFACE), | ||
74 | QStringLiteral("registered"), | 74 | QStringLiteral("registered"), | ||
75 | this, SLOT(initKdedModule())); | 75 | this, SLOT(initKdedModule())); | ||
76 | 76 | | |||
77 | QDBusConnection::sessionBus().connect(QStringLiteral(AGENT_SERVICE), | ||||
78 | QStringLiteral(AGENT_PATH), | ||||
79 | QStringLiteral(AGENT_IFACE), | ||||
80 | QStringLiteral("secretsError"), | ||||
81 | this, SLOT(secretAgentError(QString, QString))); | ||||
82 | | ||||
77 | // Interval (in ms) between attempts to scan for wifi networks | 83 | // Interval (in ms) between attempts to scan for wifi networks | ||
78 | m_wirelessScanRetryTimer.setInterval(2000); | 84 | m_wirelessScanRetryTimer.setInterval(2000); | ||
79 | m_wirelessScanRetryTimer.setSingleShot(true); | 85 | m_wirelessScanRetryTimer.setSingleShot(true); | ||
80 | } | 86 | } | ||
81 | 87 | | |||
82 | Handler::~Handler() | 88 | Handler::~Handler() | ||
83 | { | 89 | { | ||
84 | } | 90 | } | ||
▲ Show 20 Lines • Show All 368 Lines • ▼ Show 20 Line(s) | |||||
453 | { | 459 | { | ||
454 | QDBusMessage initMsg = QDBusMessage::createMethodCall(QStringLiteral(AGENT_SERVICE), | 460 | QDBusMessage initMsg = QDBusMessage::createMethodCall(QStringLiteral(AGENT_SERVICE), | ||
455 | QStringLiteral(AGENT_PATH), | 461 | QStringLiteral(AGENT_PATH), | ||
456 | QStringLiteral(AGENT_IFACE), | 462 | QStringLiteral(AGENT_IFACE), | ||
457 | QStringLiteral("init")); | 463 | QStringLiteral("init")); | ||
458 | QDBusConnection::sessionBus().send(initMsg); | 464 | QDBusConnection::sessionBus().send(initMsg); | ||
459 | } | 465 | } | ||
460 | 466 | | |||
467 | void Handler::secretAgentError(const QString &connectionPath, const QString &message) | ||||
468 | { | ||||
469 | // If the password was wrong, forget it | ||||
470 | removeConnection(connectionPath); | ||||
471 | emit connectionActivationFailed(connectionPath, message); | ||||
472 | } | ||||
473 | | ||||
461 | void Handler::replyFinished(QDBusPendingCallWatcher * watcher) | 474 | void Handler::replyFinished(QDBusPendingCallWatcher * watcher) | ||
462 | { | 475 | { | ||
463 | QDBusPendingReply<> reply = *watcher; | 476 | QDBusPendingReply<> reply = *watcher; | ||
464 | if (reply.isError() || !reply.isValid()) { | 477 | if (reply.isError() || !reply.isValid()) { | ||
465 | KNotification *notification = nullptr; | 478 | KNotification *notification = nullptr; | ||
466 | QString error = reply.error().message(); | 479 | QString error = reply.error().message(); | ||
467 | Handler::HandlerAction action = (Handler::HandlerAction)watcher->property("action").toUInt(); | 480 | Handler::HandlerAction action = (Handler::HandlerAction)watcher->property("action").toUInt(); | ||
468 | switch (action) { | 481 | switch (action) { | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |