<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/107473/">http://git.reviewboard.kde.org/r/107473/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On November 26th, 2012, 6:16 p.m., <b>Matěj Laitl</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <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, thanks for your work!

First, I must acknowledge that our current file playlist code is a big mess and it certainly needs cleanup and code deduplication, your work is therefore greatly appreciated. I have reviewed just one file when it came to my mind: instead of introducing LazyPlaylistFile, the lazy-loading logic should be incorporated directly to PlaylistFile! There's no reason to have playlist files without lazy loading.

Could you please rework the patch eliminating LazyPlaylistFile? Also please pay attention to code style (e.g. spaces around parameters etc.) and to document methods along the way. (you seem to add methods to PlaylistFile. Please keep the public interface minimal usable - the setName() / setFilename() / setUrl() looks really scary - what does what? Does the file get renamed?) I understand this is mainly existing mess, not your new code. :-|</pre>
 </blockquote>




 <p>On November 26th, 2012, 6:17 p.m., <b>Matěj Laitl</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Also thanks for writing test-case along with your patch! This is appreciated.</pre>
 </blockquote>





 <p>On November 26th, 2012, 7:53 p.m., <b>Tatjana Gornak</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <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,

initially I've considered implementation of lazy-loading in playlistfiles, but there is a problem with constant methods. For example: virtual method Playlist::name() const. In case of XSPFPlaylist it calls method XSPFPlaylist::title(), but to get title you need to  load playlist, thereore title() can not be a constant method.</pre>
 </blockquote>





 <p>On November 27th, 2012, 12:14 p.m., <b>Matěj Laitl</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I see. I've submitted https://git.reviewboard.kde.org/r/107484/ to ease your work. With it, I propose the following:

 * PlaylistFile subclasses return cached name (initially just name part of the filename/url) in name(), without triggering anything. (also applies to description)
 * PlaylistFile subclasses return already loaded tracks in tracks(), without triggering anything
 * only thing that triggers file loading is triggerTrackLoad(), where you start a background job (ThreadWeaver::Job) to load the tracks. If the playlists has metadata in file, you update it and call notifyObserversMetadataChanged()
 * PlaylistManager::downloadPlaylist() is moved as a helper method to FilePlaylist and incorporated to the backgroundJob that performs the playlist loading.</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So you propose not to maintain the current behavior, but just go with it and refactor the playlists?</pre>
<br />








<p>- Edward Hades</p>


<br />
<p>On November 26th, 2012, 12:10 p.m., Tatjana Gornak wrote:</p>






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

<div>Review request for Amarok.</div>
<div>By Tatjana Gornak.</div>


<p style="color: grey;"><i>Updated Nov. 26, 2012, 12:10 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;">I've started my changes with an implementation of a ASXPlaylist class,
due this work I've found that implementation of different playlist file
types has different logic, as result I end up with a rewriting
playlist's implementations.

As example of difference:
  -- Constructor M3UPlaylist::M3UPlaylist( const KUrl &url ) sets a url, but
     does not load playlist, therefore loading of playlist are
posponed till data from playlist are actualy needed (lazy loading)
     On the other hand constructor XSPFPlaylist::XSPFPlaylist( const
KUrl &url, bool autoAppend )  loads playlist.

The main idea of proposed changes is to create a unify code for
processing playlist files:
  -- lazy loading through LazyLoadPlaylist
  -- common functionality was moved to PlaylistFile.

It is worth to be noticed that this patch changes structure of
playlist's classes, bit does not changes their behavior, even if this behavior
is inconsistent in some cases.

In following patch-requests I plan to submit ASX Playlist parser and
organize playlists processing in more consistent way.</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;">1) All unit-tests were passed.
2) For all playlists I've also checked loading and
   saving through gui.</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/CMakeLists.txt <span style="color: grey">(b70147d)</span></li>

 <li>src/core-impl/playlists/types/file/LazyPlaylistFile.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/core-impl/playlists/types/file/LazyPlaylistFile.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/core-impl/playlists/types/file/PlaylistFile.h <span style="color: grey">(4322da9)</span></li>

 <li>src/core-impl/playlists/types/file/PlaylistFile.cpp <span style="color: grey">(2730354)</span></li>

 <li>src/core-impl/playlists/types/file/PlaylistFileSupport.cpp <span style="color: grey">(2dcc0cd)</span></li>

 <li>src/core-impl/playlists/types/file/m3u/M3UPlaylist.h <span style="color: grey">(3176c45)</span></li>

 <li>src/core-impl/playlists/types/file/m3u/M3UPlaylist.cpp <span style="color: grey">(2395260)</span></li>

 <li>src/core-impl/playlists/types/file/pls/PLSPlaylist.h <span style="color: grey">(e974539)</span></li>

 <li>src/core-impl/playlists/types/file/pls/PLSPlaylist.cpp <span style="color: grey">(3ba154a)</span></li>

 <li>src/core-impl/playlists/types/file/xspf/XSPFPlaylist.h <span style="color: grey">(ebf3235)</span></li>

 <li>src/core-impl/playlists/types/file/xspf/XSPFPlaylist.cpp <span style="color: grey">(bbcecc3)</span></li>

 <li>src/core/playlists/Playlist.h <span style="color: grey">(5cf11f2)</span></li>

 <li>src/playlistmanager/file/PlaylistFileProvider.cpp <span style="color: grey">(e4e7284)</span></li>

 <li>tests/core-impl/playlists/types/file/CMakeLists.txt <span style="color: grey">(ef69236)</span></li>

 <li>tests/core-impl/playlists/types/file/TestLazyPlaylistFile.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/core-impl/playlists/types/file/TestLazyPlaylistFile.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/core-impl/playlists/types/file/m3u/TestM3UPlaylist.cpp <span style="color: grey">(0f19e1b)</span></li>

</ul>

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




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








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