<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 />











<div>



<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#file360131line42" 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">42</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="c1">// </span><span class="cs">TODO</span><span class="c1"> async</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <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;">You can do what Android does here: set a default percentage value (-1 ou 0) and let the onChargeChanged() slot to update to the correct value when it cames.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">For charging state you can create a watcher from the QDBusPendingReply() object above and connect a slot to update m_charging variable. You can do the same for m_chargePercent if you wish.</p></pre>
 </div>
</div>
<br />

<div>



<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#file360131line45" 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">45</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">m_chargePercent</span> <span class="o">=</span> <span class="n">qMax</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">percentageReply</span><span class="p">.</span><span class="n">value</span><span class="p">());</span> <span class="c1">// FIXME should not be neccessary</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <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;">If there was any error during dbus call calling value() will lead to crash().</p></pre>
 </div>
</div>
<br />

<div>



<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>

 <div style="margin-left: 2em;">

  <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>
 </div>
</div>
<br />

<div>



<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>

 <div style="margin-left: 2em;">

  <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>
 </div>
</div>
<br />



<p>- Lamarque Souza</p>


<br />
<p>On April 5th, 2015, 3:57 p.m. 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 p.m.</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>