<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/123263/">https://git.reviewboard.kde.org/r/123263/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On April 5th, 2015, 5:54 nachm. UTC, <b>Lamarque Souza</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/123263/diff/1/?file=360131#file360131line79" style="color: black; font-weight: bold; text-decoration: underline;">src/solid/devices/backends/kdeconnect/kdeconnectbattery.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">79</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Is it possible to retrieve a correct value for this and the other values below (timeToEmpty, timeToFull, etc)?</p></pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I suppose, but that needs implementing on the KDE Connect side</p></pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On April 5th, 2015, 5:54 nachm. UTC, <b>Lamarque Souza</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/123263/diff/1/?file=360137#file360137line116" style="color: black; font-weight: bold; text-decoration: underline;">src/solid/devices/backends/kdeconnect/kdeconnectmanager.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">116</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">pendingDeviceList</span><span class="p">.</span><span class="n">waitForFinished</span><span class="p">();</span> <span class="c1">// urgh...</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Answering your question from this patch's description: yes, I prefer that you call onDeviceAdded() slot for each device appended here. You can also use a watcher in this class' constructor to update m_devices asynchronously. Otherwise, no KdeConnectManager::deviceAdded() signal is emitted during KdeConnectManager startup even though m_devices is not empty. This method should just return the ids from m_devices.</p></pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ok, thanks, I wasn't sure how that internally works.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">So I populate the list async and emit a deviceAdded signal for each of them no matter whether I found them on the first sweep or when they were actually added afterwards.</p></pre>
<br />




<p>- Kai Uwe</p>


<br />
<p>On April 5th, 2015, 3:57 nachm. UTC, Kai Uwe Broulik wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Solid, Albert Vaca Cintora and Emmanuel Pescosta.</div>
<div>By Kai Uwe Broulik.</div>


<p style="color: grey;"><i>Updated April 5, 2015, 3:57 nachm.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
solid
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This adds a KDE Connect backend to Solid enabling us to show phone battery status in the device notifier, and have the phone appear in the device notifier like an external storage.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It is pretty synchronous at the moment. Any ideas how I could improve that? I guess when someone wants to get devices, it creates a new device interface and calls allDevices() or devicesFromQuery() immediately afterwards, so I cannot just do that stuff async and defer population? Or call deviceAdded for each of the initial ones once I have them?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It requires adjustment in the kdeconnect KIO slave so it can handle addresses like kdeconnect://org/kde/kdeconnect/123456 or kdeconnect:udi=/org/kde/kdeconnect/123456 (like mtp kio does) because all Dolphin or the device notifier have is the UDI. It also needs a new device action that matches "Portable Media Player" with the "kdeconnect" protocol, similar to mtp.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">By adjusting the predicate in Dolphin's Places sidebar (and probably the file dialog) to query for the "kdeconnect" protocol, we can have its places automatically updated without having KDE Connect manually mess with KFilePlaces.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">With some crash fixes already pushed to plasma-workspace it works pretty well.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/solid/devices/CMakeLists.txt <span style="color: grey">(9271ae1)</span></li>

 <li>src/solid/devices/backends/kdeconnect/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectbattery.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectbattery.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectdevice.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectdevice.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectdeviceinterface.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectmanager.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectmanager.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/backends/kdeconnect/kdeconnectportablemediaplayer.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/solid/devices/managerbase.cpp <span style="color: grey">(eee4de5)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/123263/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>