-rw-r--r-- | core/pim/todo/todoeditor.cpp | 4 | ||||
-rw-r--r-- | core/pim/todo/todotemplatemanager.cpp | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index 5aa7097..c204325 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp @@ -20,9 +20,7 @@ OTodo Editor::newTodo( int cur, e->init( cur ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) e->showMaximized(); -#endif int ret = e->exec(); if ( QDialog::Accepted == ret ) { @@ -43,9 +41,7 @@ OTodo Editor::edit( QWidget *, e->init( todo ); e->setCaption( QObject::tr( "Edit Task" ) ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) e->showMaximized(); -#endif int ret = e->exec(); OTodo ev = e->todo(); 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 @@ -13,7 +13,7 @@ TemplateManager::TemplateManager() { m_path = Global::applicationFileName("todolist", "templates.xml"); } TemplateManager::~TemplateManager() { - + save(); } void TemplateManager::load() { Config conf("todolist_templates"); @@ -31,16 +31,18 @@ void TemplateManager::load() { if (str.isEmpty() ) continue; - m_templates.insert( str, - ev ); + m_templates.insert( str, ev ); } } void TemplateManager::save() { + qWarning("Saving!!!!"); Config conf("todolist_templates"); OTodoAccessXML *res = new OTodoAccessXML( "template", m_path ); OTodoAccess db(res); + db.load(); + db.clear(); QMap<QString, OTodo>::Iterator it; @@ -56,7 +58,11 @@ void TemplateManager::save() { 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 ) { m_templates.remove( str ); |