Diffstat (limited to 'core/pim/todo/todotemplatemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/todotemplatemanager.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/core/pim/todo/todotemplatemanager.cpp b/core/pim/todo/todotemplatemanager.cpp index 5b83f76..eeac51b 100644 --- a/core/pim/todo/todotemplatemanager.cpp +++ b/core/pim/todo/todotemplatemanager.cpp @@ -1,10 +1,10 @@ +#include <opie2/otodoaccess.h> +#include <opie2/otodoaccessxml.h> + #include <qpe/config.h> #include <qpe/global.h> -#include <opie/otodoaccess.h> -#include <opie/otodoaccessxml.h> - #include "todotemplatemanager.h" using namespace Todo; @@ -16,17 +16,17 @@ TemplateManager::~TemplateManager() { save(); } void TemplateManager::load() { Config conf("todolist_templates"); - OTodoAccessXML *xml = new OTodoAccessXML( QString::fromLatin1("template"), + OPimTodoAccessXML *xml = new OPimTodoAccessXML( QString::fromLatin1("template"), m_path ); - OTodoAccess todoDB(xml ); + OPimTodoAccess todoDB(xml ); todoDB.load(); - OTodoAccess::List::Iterator it; - OTodoAccess::List list = todoDB.allRecords(); + OPimTodoAccess::List::Iterator it; + OPimTodoAccess::List list = todoDB.allRecords(); for ( it = list.begin(); it != list.end(); ++it ) { - OTodo ev = (*it); + OPimTodo ev = (*it); conf.setGroup( QString::number( ev.uid() ) ); QString str = conf.readEntry("Name", QString::null ); if (str.isEmpty() ) continue; @@ -37,45 +37,45 @@ void TemplateManager::load() { void TemplateManager::save() { qWarning("Saving!!!!"); Config conf("todolist_templates"); - OTodoAccessXML *res = new OTodoAccessXML( "template", + OPimTodoAccessXML *res = new OPimTodoAccessXML( "template", m_path ); - OTodoAccess db(res); + OPimTodoAccess db(res); db.load(); db.clear(); - QMap<QString, OTodo>::Iterator it; + QMap<QString, OPimTodo>::Iterator it; for ( it = m_templates.begin(); it != m_templates.end(); ++it ) { - OTodo ev = it.data(); + OPimTodo ev = it.data(); conf.setGroup( QString::number( ev.uid() ) ); qWarning("Name" + it.key() ); conf.writeEntry("Name", it.key() ); db.add( ev ); } db.save(); } void TemplateManager::addEvent( const QString& str, - const OTodo& ev) { + const OPimTodo& ev) { qWarning("AddEvent"+ str ); - OTodo todo = ev; + OPimTodo todo = ev; if( ev.uid() == 0 ) - todo.setUid(1); // generate a new uid - + todo.setUid(1); // generate a new uid + m_templates.replace( str, todo ); } void TemplateManager::removeEvent( const QString& str ) { m_templates.remove( str ); } QStringList TemplateManager::templates() const { QStringList list; - QMap<QString, OTodo>::ConstIterator it; + QMap<QString, OPimTodo>::ConstIterator it; for (it = m_templates.begin(); it != m_templates.end(); ++it ) { list << it.key(); } return list; } -OTodo TemplateManager::templateEvent( const QString& templateName ) { +OPimTodo TemplateManager::templateEvent( const QString& templateName ) { return m_templates[templateName]; } |