<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/120036/">https://git.reviewboard.kde.org/r/120036/</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">First of all, I'm fine with this approach if this gets chosen, all matters is that end up working reliably and depends from the exact use case.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That said, what did strike to me, is that the problem that seems to be solved seems to overlap something else in an almost exact way.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
The fact that the note file gets watched for change seems to suggest the possibility of more plasmoids attached to the same note (correct me if i'm wrong, wether this is an use case managed or not) that seems <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">exactly</em> the use case of dataengines, NoteManager is very near to a DataEngine subclass and AbstractNoteLoader and subclasses look exactly fitting a DataContainer subclass, especially what you get is having one single instance of the dataengine for all existing note plasmoids and one datacontainer per note id (if two plasmoids connect to the same note, they will share it) so once one note is updated any eventual clients all update at once. Then yeah, i know currently the syntax to call services from qml is very boilerplatey, i would like it was a tad less painful, would need to be able to register slots dynamically on an object from c++ tough</p></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="https://git.reviewboard.kde.org/r/120036/diff/1/?file=309277#file309277line39" style="color: black; font-weight: bold; text-decoration: underline;">applets/notes/plugin/filesystemnoteloader.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">39</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">KDirWatch</span> <span class="o">*</span><span class="n">m_watcher</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;">I wonder if wasn't prettier/more efficient if Note and NoteManager instances were actually shared between the eventual multiple note instances.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">a dirwatch is better tough if (and i think only if) you plan to access to notes from multiple processes at once</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/120036/diff/1/?file=309279#file309279line2" style="color: black; font-weight: bold; text-decoration: underline;">applets/notes/plugin/note.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">2</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * <one line to give the library's name and an idea of what it does.></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;">copy and paste :p</p></pre>
 </div>
</div>
<br />



<p>- Marco Martin</p>


<br />
<p>On settembre 2nd, 2014, 11:02 a.m. UTC, David Edmundson 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 Plasma.</div>
<div>By David Edmundson.</div>


<p style="color: grey;"><i>Updated Set. 2, 2014, 11:02 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdeplasma-addons
</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;">The design:<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
 There's a NoteLoader class, currently we just hardcode loading the FileNoteLoader. The backend is refcounted between plasmoids.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
 NoteLoader acts as a factory class for creating Notes, which can be subclassed and do whatever that needs to do (like loading async-ly)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The QML side saves data on loss of focus and exit. We use explicitly different loading and saving to different properties to avoid the mess of two classes trying to write to the same property.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">To explain the design, here are my long term goals:</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">never lose data if we wipe the relevant plasmarc</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">the same notes editable in plasmawindowed as the desktop</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">have the same note data on two containments</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">easily make an Akonadi backend for notes so we share between knotes (hence the abstract layer ATM). </li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">allows the user to be creative (store in git, sync to owncloud, whatever). Not stuff we should add in the UI, but we enable the user to do whatever.</li>
</ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I envision the settings module listing available notes. By default it just creates a new note when you make a new plasmoid so 4.x behaviour is still exactly the same as before /unless/ you go hunting for more things.</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>applets/notes/plugin/note.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/notemanager.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/filesystemnoteloader.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/filesystemnoteloader.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/note.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/abstractnoteloader.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/documenthandler.h <span style="color: grey">(fd3bdd0)</span></li>

 <li>applets/notes/plugin/documenthandler.cpp <span style="color: grey">(b0a603a)</span></li>

 <li>applets/notes/CMakeLists.txt <span style="color: grey">(c980cb0)</span></li>

 <li>applets/notes/package/contents/config/main.xml <span style="color: grey">(a614f7e)</span></li>

 <li>applets/notes/package/contents/ui/main.qml <span style="color: grey">(1213f48)</span></li>

 <li>applets/notes/plugin/abstractnoteloader.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/notemanager.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>applets/notes/plugin/notesplugin.cpp <span style="color: grey">(890caeb)</span></li>

</ul>

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






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








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