Listen to KDE Connect device signals
ClosedPublic

Authored by broulik on Nov 15 2018, 3:04 AM.

Details

Summary

Makes sure we detect devices being added, removed, or becoming (in)visible at runtime.

Test Plan

Probably never touched this code after it "worked as a proof of concept"

  • Turned wifi on on my phone, kde connect device context menu entry showed up
  • turned wifi off on my phone, kde connect device context menu entry vanished
  • reloaded extension while phone was connected: still got context menu entry
  • sending links to phone still works

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Nov 15 2018, 3:04 AM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 15 2018, 3:04 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Nov 15 2018, 3:04 AM
bruns added a subscriber: bruns.Nov 15 2018, 3:22 AM
apol added a subscriber: apol.Nov 15 2018, 8:26 AM

+1 LGTM the KDE Connect parts.

host/kdeconnectplugin.cpp
184

Never saw this kind of change, what's the difference?

fvogt added inline comments.Nov 15 2018, 6:05 PM
extension/extension.js
156 ↗(On Diff #45496)

Can you explain how that makes the creation fail?

host/kdeconnectplugin.cpp
154

You could just do

if(m_devices.removeOne(deviceId))
    sendData(...)

if the order of removing and sendData is not important.

broulik updated this revision to Diff 46011.Nov 22 2018, 2:30 PM
broulik updated this revision to Diff 46012.
broulik updated this revision to Diff 46013.Nov 22 2018, 2:43 PM
  • Check if device is already known just before emitting
Restricted Application added a project: KDE Connect. · View Herald TranscriptNov 22 2018, 2:43 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
broulik updated this revision to Diff 46015.Nov 22 2018, 2:45 PM
  • Check earlier
fvogt accepted this revision.Nov 22 2018, 2:46 PM
This revision is now accepted and ready to land.Nov 22 2018, 2:46 PM
This revision was automatically updated to reflect the committed changes.