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 @@ -15,3 +15,3 @@ TemplateManager::TemplateManager() { TemplateManager::~TemplateManager() { - + save(); } @@ -33,4 +33,3 @@ void TemplateManager::load() { - m_templates.insert( str, - ev ); + m_templates.insert( str, ev ); } @@ -38,2 +37,3 @@ void TemplateManager::load() { void TemplateManager::save() { + qWarning("Saving!!!!"); Config conf("todolist_templates"); @@ -43,2 +43,4 @@ void TemplateManager::save() { OTodoAccess db(res); + db.load(); + db.clear(); @@ -58,3 +60,7 @@ void TemplateManager::addEvent( const QString& str, 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 ); } |