Some Thought on KNotes Catagory
Tags:soc
KNotes uses KCal::Journal(which provides a Journal in the sense of RFC2445) to save info. After read RFC2445,I found Journal has some good properties to meet our demands, like “categories”
or “related”. These two property also can occur more than once. That’s perfect.
I summed up the main threads of bug#41341 discussion as following:
I don’t quite agree take category as a note. The most inportant meaning of doing so is that it reduce the change, because some function like “New” or “Rename” can be reused.
But I don’t think so. In fact, I found the functions can be reused may be only “New” ,”Rename”. Surely many function can be override, but many other function like “Delete” will be changed a lot.
Another question is if it is necessary to set up a “ROOT” note as the parent of all notes and categories? Otherwise if you delete a category note and want to save the notes, how can you use same function move these notes to root or to another category? It’s certain that a if can work, but I don’t like it… But if a ROOT note must be added, there will be a extra work on upgrade.
After thinking over the serveral method, I found the focus is on “How to store category information”. There are serveral ways:
Method A:
Using category node. Store related information in parent using property “related”.
Advantage:
Disadvantage:
Method B:
Store related information in notes using property “categories”. In fact, no catagory instance exists.
Advantage:
Disadvantage:
More:
Because there aren’t many notes to deal with, I don’t think the efficiency is very important here.
Method B+:
On the basis of Method B, add temperory catagories instance to assist.
Advantage:
Disadvantage:
How to implement, seems a little complex… Maybe counteract the advantage of Method B.
Method C:
Bring in catagory instance.
Advantage:
Disadvantage:
How to implement….
The four method below is my initial ideas. Please tell me your opinion.
These days I will continue study the source code and method of developing kdepim.