summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todoeditor.cpp4
-rw-r--r--core/pim/todo/todotemplatemanager.cpp14
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,
20 e->init( cur ); 20 e->init( cur );
21 21
22 22
23#if defined(Q_WS_QWS) || defined(_WS_QWS_)
24 e->showMaximized(); 23 e->showMaximized();
25#endif
26 24
27 int ret = e->exec(); 25 int ret = e->exec();
28 if ( QDialog::Accepted == ret ) { 26 if ( QDialog::Accepted == ret ) {
@@ -43,9 +41,7 @@ OTodo Editor::edit( QWidget *,
43 e->init( todo ); 41 e->init( todo );
44 e->setCaption( QObject::tr( "Edit Task" ) ); 42 e->setCaption( QObject::tr( "Edit Task" ) );
45 43
46#if defined(Q_WS_QWS) || defined(_WS_QWS_)
47 e->showMaximized(); 44 e->showMaximized();
48#endif
49 int ret = e->exec(); 45 int ret = e->exec();
50 46
51 OTodo ev = e->todo(); 47 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() {
13 m_path = Global::applicationFileName("todolist", "templates.xml"); 13 m_path = Global::applicationFileName("todolist", "templates.xml");
14} 14}
15TemplateManager::~TemplateManager() { 15TemplateManager::~TemplateManager() {
16 16 save();
17} 17}
18void TemplateManager::load() { 18void TemplateManager::load() {
19 Config conf("todolist_templates"); 19 Config conf("todolist_templates");
@@ -31,16 +31,18 @@ void TemplateManager::load() {
31 if (str.isEmpty() ) 31 if (str.isEmpty() )
32 continue; 32 continue;
33 33
34 m_templates.insert( str, 34 m_templates.insert( str, ev );
35 ev );
36 } 35 }
37} 36}
38void TemplateManager::save() { 37void TemplateManager::save() {
38 qWarning("Saving!!!!");
39 Config conf("todolist_templates"); 39 Config conf("todolist_templates");
40 40
41 OTodoAccessXML *res = new OTodoAccessXML( "template", 41 OTodoAccessXML *res = new OTodoAccessXML( "template",
42 m_path ); 42 m_path );
43 OTodoAccess db(res); 43 OTodoAccess db(res);
44 db.load();
45 db.clear();
44 46
45 47
46 QMap<QString, OTodo>::Iterator it; 48 QMap<QString, OTodo>::Iterator it;
@@ -56,7 +58,11 @@ void TemplateManager::save() {
56void TemplateManager::addEvent( const QString& str, 58void TemplateManager::addEvent( const QString& str,
57 const OTodo& ev) { 59 const OTodo& ev) {
58 qWarning("AddEvent"+ str ); 60 qWarning("AddEvent"+ str );
59 m_templates.replace( str, ev ); 61 OTodo todo = ev;
62 if( ev.uid() == 0 )
63 todo.setUid(1); // generate a new uid
64
65 m_templates.replace( str, todo );
60} 66}
61void TemplateManager::removeEvent( const QString& str ) { 67void TemplateManager::removeEvent( const QString& str ) {
62 m_templates.remove( str ); 68 m_templates.remove( str );