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





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hi, sorry for the delay replying, I had a king of work emergency. Please see some comments below.</pre>
 <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="http://git.reviewboard.kde.org/r/112023/diff/2/?file=184588#file184588line39" style="color: black; font-weight: bold; text-decoration: underline;">src/core/collections/Collection.h</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

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

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">namespace Playlists {</pre></td>

  </tr>
 </tbody>



 
 

 <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">39</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">enum</span> <span class="n">WriteState</span> <span class="p">{</span></pre></td>
  </tr>

  <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">40</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">Writable</span><span class="p">,</span></pre></td>
  </tr>

  <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">41</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">TemporarilyNotWritable</span><span class="p">,</span></pre></td>
  </tr>

  <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="n">NotWritable</span> <span class="c1">// permanently</span></pre></td>
  </tr>

  <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">43</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="p">};</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'd love if this could be named WritableState, as WriteState triggers something very different in my mind. Code is written once and read many times, it is therefore hopefully worth the effort.</pre>
</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="http://git.reviewboard.kde.org/r/112023/diff/2/?file=184588#file184588line131" style="color: black; font-weight: bold; text-decoration: underline;">src/core/collections/Collection.h</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

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

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">namespace Collections</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">125</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="cm">/**</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">131</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="cm">/**</span></pre></td>
  </tr>

 </tbody>


 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">126</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             * Return <span class="hl">tru</span>e if this collection can be written to<span class="hl"> (tracks added, removed).</span></span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">132</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             * Return <span class="hl">Collections::Writabl</span>e if this collection can <span class="hl">actually </span>be written to</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">127</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             * Convenience short-cut for calling CollectionLocation's<span class="hl"> isWritable.</span></span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">133</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             *<span class="hl"> (tracks added, removed).</span> Convenience short-cut for calling CollectionLocation's</span></pre></td>
  </tr>

 </tbody>


 
 

 <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">134</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             * isWritable. A collection might be of a writeable type in principle but be in</span></pre></td>
  </tr>

  <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">135</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             * read-only mode right now (error occured, permission problem, ...).</span></pre></td>
  </tr>

 </tbody>


 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">128</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             */</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">136</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">             */</span></pre></td>
  </tr>

 </tbody>


 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">129</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">virtual</span> <span class="kt"><span class="hl">bool</span></span> <span class="n">isWritable</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">137</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">virtual</span> <span class="n"><span class="hl">Collections</span></span><span class="o"><span class="hl">::</span></span><span class="n"><span class="hl">WriteState</span></span> <span class="n">isWritable</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I must say I don't like a method named isSomething() returning non-bool. We tend to adhere to Qt naming style and in Qt, isSomething() really means that Something is a bool.

I suggest this:
virtual WritableState writableState() const;

I also suggest a convenience non-virtual method:
bool isWritable() const;

As most users don't care whether non-writability if permanent or temporary, they could continue using isWritable() without changes, which would shrink this patch. It should be however checked that no subclass implements it. (or, can we use C++11 final keyword already?)

^^^ the same applies to CollectionLocation too.</pre>
</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="http://git.reviewboard.kde.org/r/112023/diff/2/?file=184590#file184590line33" style="color: black; font-weight: bold; text-decoration: underline;">src/core/collections/CollectionLocation.h</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

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

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">namespace Collections {</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">32</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">class</span> <span class="n">Collection</span><span class="p">;</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">33</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">class</span> <span class="n">Collection</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">33</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">class</span> <span class="n">QueryMaker</span><span class="p">;</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">34</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">class</span> <span class="n">QueryMaker</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">These fwd-declarations are no longer needed.</pre>
</div>
<br />



<p>- MatÄ›j</p>


<br />
<p>On August 25th, 2013, 11:09 p.m. CEST, Frank Meerkoetter wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Amarok.</div>
<div>By Frank Meerkoetter.</div>


<p style="color: grey;"><i>Updated Aug. 25, 2013, 11:09 p.m.</i></p>






<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;">The fix in https://git.reviewboard.kde.org/r/111991/ fixes isWriteable() for UMS collections. This has the effect that if an UMS-collection is actually non-writeable the copy/move operations will be missing from the TreeView/Filebrowser context menus. There is no clue to the user what is going on.

This patch is introducing a new method to the Collection interface so we can differentiate between collections that are non-writeable by principle and collections that just happen to be non-writeable right now (for what ever reason).

I use this changed collection interface to disable move/copy actions (as opposed to hide) for non-writeable UMS-colllections. This should give the user at least a hint what is going on.

Unfortunately i haven't found a way to display a tooltip ("Currently readonly"). The action is offering an setTooltip() method but now effect was observed.
</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;">I have tested with an USB-stick that is writeable and another one that is non-writeable. I have also observed that for the FileBrowser the "Local collection" is still shown as active.
 </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/browsers/CollectionTreeItemModel.cpp <span style="color: grey">(1ac4463)</span></li>

 <li>src/browsers/CollectionTreeView.cpp <span style="color: grey">(6fad164)</span></li>

 <li>src/browsers/filebrowser/FileView.cpp <span style="color: grey">(ad200eb)</span></li>

 <li>src/core-impl/collections/db/sql/SqlCollectionLocation.h <span style="color: grey">(da1b2e5)</span></li>

 <li>src/core-impl/collections/db/sql/SqlCollectionLocation.cpp <span style="color: grey">(3b55f66)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodCollection.h <span style="color: grey">(14fdd40)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodCollection.cpp <span style="color: grey">(36738d7)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodCollectionLocation.h <span style="color: grey">(cc27e19)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodCollectionLocation.cpp <span style="color: grey">(f8105f9)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodMeta.cpp <span style="color: grey">(6beca0a)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodPlaylist.cpp <span style="color: grey">(61c60ba)</span></li>

 <li>src/core-impl/collections/ipodcollection/IpodPlaylistProvider.cpp <span style="color: grey">(dcef4c2)</span></li>

 <li>src/core-impl/collections/mediadevicecollection/MediaDeviceCollectionLocation.h <span style="color: grey">(e40529f)</span></li>

 <li>src/core-impl/collections/mediadevicecollection/MediaDeviceCollectionLocation.cpp <span style="color: grey">(603ceff)</span></li>

 <li>src/core-impl/collections/mediadevicecollection/MediaDeviceMeta.cpp <span style="color: grey">(4a419d5)</span></li>

 <li>src/core-impl/collections/nepomukcollection/NepomukCollection.h <span style="color: grey">(c5d7a13)</span></li>

 <li>src/core-impl/collections/nepomukcollection/NepomukCollection.cpp <span style="color: grey">(77aef8e)</span></li>

 <li>src/core-impl/collections/playdarcollection/PlaydarCollection.h <span style="color: grey">(1a7ec89)</span></li>

 <li>src/core-impl/collections/playdarcollection/PlaydarCollection.cpp <span style="color: grey">(5c2349d)</span></li>

 <li>src/core-impl/collections/support/FileCollectionLocation.h <span style="color: grey">(9bd303e)</span></li>

 <li>src/core-impl/collections/support/FileCollectionLocation.cpp <span style="color: grey">(4b9b4b0)</span></li>

 <li>src/core-impl/collections/support/TrashCollectionLocation.h <span style="color: grey">(239a977)</span></li>

 <li>src/core-impl/collections/support/TrashCollectionLocation.cpp <span style="color: grey">(61c2e49)</span></li>

 <li>src/core-impl/collections/umscollection/UmsCollection.cpp <span style="color: grey">(a73fd34)</span></li>

 <li>src/core-impl/collections/umscollection/UmsCollectionLocation.h <span style="color: grey">(6cfe4df)</span></li>

 <li>src/core-impl/collections/umscollection/UmsCollectionLocation.cpp <span style="color: grey">(cef90d7)</span></li>

 <li>src/core/collections/Collection.h <span style="color: grey">(94d24d7)</span></li>

 <li>src/core/collections/Collection.cpp <span style="color: grey">(01a2e8c)</span></li>

 <li>src/core/collections/CollectionLocation.h <span style="color: grey">(7a1ed1e)</span></li>

 <li>src/core/collections/CollectionLocation.cpp <span style="color: grey">(2385570)</span></li>

 <li>src/services/ServiceCollectionLocation.h <span style="color: grey">(cea3b84)</span></li>

 <li>src/services/ServiceCollectionLocation.cpp <span style="color: grey">(d1cb0d8)</span></li>

 <li>src/services/mp3tunes/Mp3tunesService.cpp <span style="color: grey">(ed2b006)</span></li>

 <li>src/services/mp3tunes/Mp3tunesServiceCollectionLocation.h <span style="color: grey">(2b06cb4)</span></li>

 <li>src/services/mp3tunes/Mp3tunesServiceCollectionLocation.cpp <span style="color: grey">(6aaa66d)</span></li>

 <li>src/synchronization/MasterSlaveSynchronizationJob.cpp <span style="color: grey">(1979701)</span></li>

 <li>src/synchronization/OneWaySynchronizationJob.cpp <span style="color: grey">(99f504c)</span></li>

 <li>src/synchronization/UnionJob.cpp <span style="color: grey">(8602044)</span></li>

 <li>tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp <span style="color: grey">(ab41db3)</span></li>

 <li>tests/core/collections/CollectionLocationTest.cpp <span style="color: grey">(720fa6a)</span></li>

 <li>tests/core/collections/TestCollection.cpp <span style="color: grey">(72a8b3b)</span></li>

 <li>tests/synchronization/TestMasterSlaveSynchronizationJob.cpp <span style="color: grey">(b8b59c4)</span></li>

 <li>tests/synchronization/TestOneWaySynchronizationJob.cpp <span style="color: grey">(ce7a2b5)</span></li>

 <li>tests/synchronization/TestUnionJob.cpp <span style="color: grey">(2343577)</span></li>

</ul>

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







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








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