summaryrefslogtreecommitdiff
path: root/core/pim/todo/todotemplatemanager.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/todotemplatemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotemplatemanager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/pim/todo/todotemplatemanager.cpp b/core/pim/todo/todotemplatemanager.cpp
index eeac51b..0b20d5a 100644
--- a/core/pim/todo/todotemplatemanager.cpp
+++ b/core/pim/todo/todotemplatemanager.cpp
@@ -1,6 +1,7 @@
1#include <opie2/odebug.h>
1#include <opie2/otodoaccess.h> 2#include <opie2/otodoaccess.h>
2#include <opie2/otodoaccessxml.h> 3#include <opie2/otodoaccessxml.h>
3 4
4#include <qpe/config.h> 5#include <qpe/config.h>
5#include <qpe/global.h> 6#include <qpe/global.h>
6 7
@@ -32,13 +33,13 @@ void TemplateManager::load() {
32 continue; 33 continue;
33 34
34 m_templates.insert( str, ev ); 35 m_templates.insert( str, ev );
35 } 36 }
36} 37}
37void TemplateManager::save() { 38void TemplateManager::save() {
38 qWarning("Saving!!!!"); 39 Opie::Core::owarn << "Saving!!!!" << oendl;
39 Config conf("todolist_templates"); 40 Config conf("todolist_templates");
40 41
41 OPimTodoAccessXML *res = new OPimTodoAccessXML( "template", 42 OPimTodoAccessXML *res = new OPimTodoAccessXML( "template",
42 m_path ); 43 m_path );
43 OPimTodoAccess db(res); 44 OPimTodoAccess db(res);
44 db.load(); 45 db.load();
@@ -46,21 +47,21 @@ void TemplateManager::save() {
46 47
47 48
48 QMap<QString, OPimTodo>::Iterator it; 49 QMap<QString, OPimTodo>::Iterator it;
49 for ( it = m_templates.begin(); it != m_templates.end(); ++it ) { 50 for ( it = m_templates.begin(); it != m_templates.end(); ++it ) {
50 OPimTodo ev = it.data(); 51 OPimTodo ev = it.data();
51 conf.setGroup( QString::number( ev.uid() ) ); 52 conf.setGroup( QString::number( ev.uid() ) );
52 qWarning("Name" + it.key() ); 53 Opie::Core::owarn << "Name " << it.key() << oendl;
53 conf.writeEntry("Name", it.key() ); 54 conf.writeEntry("Name", it.key() );
54 db.add( ev ); 55 db.add( ev );
55 } 56 }
56 db.save(); 57 db.save();
57} 58}
58void TemplateManager::addEvent( const QString& str, 59void TemplateManager::addEvent( const QString& str,
59 const OPimTodo& ev) { 60 const OPimTodo& ev) {
60 qWarning("AddEvent"+ str ); 61 Opie::Core::owarn << "AddEvent " << str << oendl;
61 OPimTodo todo = ev; 62 OPimTodo todo = ev;
62 if( ev.uid() == 0 ) 63 if( ev.uid() == 0 )
63 todo.setUid(1); // generate a new uid 64 todo.setUid(1); // generate a new uid
64 65
65 m_templates.replace( str, todo ); 66 m_templates.replace( str, todo );
66} 67}