Diffstat (limited to 'core/pim/todo/todotemplatemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/todotemplatemanager.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/pim/todo/todotemplatemanager.cpp b/core/pim/todo/todotemplatemanager.cpp index 02941ac..5b83f76 100644 --- a/core/pim/todo/todotemplatemanager.cpp +++ b/core/pim/todo/todotemplatemanager.cpp @@ -14,5 +14,5 @@ TemplateManager::TemplateManager() { } TemplateManager::~TemplateManager() { - + save(); } void TemplateManager::load() { @@ -32,9 +32,9 @@ void TemplateManager::load() { continue; - m_templates.insert( str, - ev ); + m_templates.insert( str, ev ); } } void TemplateManager::save() { + qWarning("Saving!!!!"); Config conf("todolist_templates"); @@ -42,4 +42,6 @@ void TemplateManager::save() { m_path ); OTodoAccess db(res); + db.load(); + db.clear(); @@ -57,5 +59,9 @@ void TemplateManager::addEvent( const QString& str, const OTodo& ev) { qWarning("AddEvent"+ str ); - m_templates.replace( str, ev ); + OTodo todo = ev; + if( ev.uid() == 0 ) + todo.setUid(1); // generate a new uid + + m_templates.replace( str, todo ); } void TemplateManager::removeEvent( const QString& str ) { |