Don't show connection notifications for unpaired devices

This commit is contained in:
Albert Vaca 2013-08-07 19:15:53 +02:00
parent f2aff3c7ca
commit 003052093d

View file

@ -143,14 +143,17 @@ void Daemon::onNewDeviceLink(const NetworkPackage& identityPackage, DeviceLink*
Device* device = mDevices[id]; Device* device = mDevices[id];
device->addLink(dl); device->addLink(dl);
if (device->paired()) {
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
notification->setPixmap(KIcon("dialog-ok").pixmap(48, 48)); notification->setPixmap(KIcon("dialog-ok").pixmap(48, 48));
notification->setComponentData(KComponentData("kdeconnect", "kdeconnect")); notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
notification->setTitle(device->name()); notification->setTitle(device->name());
notification->setText("Succesfully connected"); notification->setText("Succesfully connected");
notification->sendEvent(); notification->sendEvent();
}
emit deviceStatusChanged(id); emit deviceStatusChanged(id);
} else { } else {
qDebug() << "It is a new device"; qDebug() << "It is a new device";