Review Request 120036: Note loading in Notes Plasmoid
David Edmundson
david at davidedmundson.co.uk
Tue Sep 2 13:17:08 UTC 2014
> On Sept. 2, 2014, 11:59 a.m., Marco Martin wrote:
> > 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.
> >
> > 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.
> > 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 *exactly* 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
>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)
The multiple plasmoids attached to one note is /a/ benefit. In my head it was only an edge case, such as if you want one note on multiple activities.
The other case being when they can be changed externally from another app. Either from external syncing or editing via plasmawindowed. In those cases the dataengine wouldn't help.
Plus I needed to make sure updating all worked for when we add Akonadi, which to be honest was the main reason :)
> On Sept. 2, 2014, 11:59 a.m., Marco Martin wrote:
> > applets/notes/plugin/filesystemnoteloader.cpp, line 39
> > <https://git.reviewboard.kde.org/r/120036/diff/1/?file=309277#file309277line39>
> >
> > I wonder if wasn't prettier/more efficient if Note and NoteManager instances were actually shared between the eventual multiple note instances.
> >
> > a dirwatch is better tough if (and i think only if) you plan to access to notes from multiple processes at once
Note manager is shared.
- David
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120036/#review65706
-----------------------------------------------------------
On Sept. 2, 2014, 11:02 a.m., David Edmundson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120036/
> -----------------------------------------------------------
>
> (Updated Sept. 2, 2014, 11:02 a.m.)
>
>
> Review request for Plasma.
>
>
> Repository: kdeplasma-addons
>
>
> Description
> -------
>
> The design:
> There's a NoteLoader class, currently we just hardcode loading the FileNoteLoader. The backend is refcounted between plasmoids.
> NoteLoader acts as a factory class for creating Notes, which can be subclassed and do whatever that needs to do (like loading async-ly)
>
> 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.
>
> To explain the design, here are my long term goals:
>
> - never lose data if we wipe the relevant plasmarc
> - the same notes editable in plasmawindowed as the desktop
> - have the same note data on two containments
> - easily make an Akonadi backend for notes so we share between knotes (hence the abstract layer ATM).
> - 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.
>
> 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.
>
>
> Diffs
> -----
>
> applets/notes/plugin/note.cpp PRE-CREATION
> applets/notes/plugin/notemanager.h PRE-CREATION
> applets/notes/plugin/filesystemnoteloader.h PRE-CREATION
> applets/notes/plugin/filesystemnoteloader.cpp PRE-CREATION
> applets/notes/plugin/note.h PRE-CREATION
> applets/notes/plugin/abstractnoteloader.cpp PRE-CREATION
> applets/notes/plugin/documenthandler.h fd3bdd0
> applets/notes/plugin/documenthandler.cpp b0a603a
> applets/notes/CMakeLists.txt c980cb0
> applets/notes/package/contents/config/main.xml a614f7e
> applets/notes/package/contents/ui/main.qml 1213f48
> applets/notes/plugin/abstractnoteloader.h PRE-CREATION
> applets/notes/plugin/notemanager.cpp PRE-CREATION
> applets/notes/plugin/notesplugin.cpp 890caeb
>
> Diff: https://git.reviewboard.kde.org/r/120036/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> David Edmundson
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140902/3ff471f8/attachment.html>
More information about the Plasma-devel
mailing list