summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 6709811..f3afa5f 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -25,4 +25,7 @@
#include "todotable.h"
+#include <opie/tododb.h>
+#include <opie/todovcalresource.h>
+
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
@@ -33,5 +36,5 @@
#include <qpe/qpemessagebox.h>
#include <qpe/resource.h>
-#include <qpe/task.h>
+//#include <qpe/task.h>
#include <qpe/qpetoolbar.h>
@@ -216,5 +219,5 @@ void TodoWindow::slotNew()
NewTaskDialog e( id, this, 0, TRUE );
- Task todo;
+ ToDoEvent todo;
#if defined(Q_WS_QWS) || defined(_WS_QWS_)
@@ -222,9 +225,9 @@ void TodoWindow::slotNew()
#endif
int ret = e.exec();
-
+ qWarning("finished" );
if ( ret == QDialog::Accepted ) {
table->setPaintingEnabled( false );
todo = e.todoEntry();
- todo.assignUid();
+ //todo.assignUid();
table->addEntry( todo );
table->setPaintingEnabled( true );
@@ -276,5 +279,5 @@ void TodoWindow::slotEdit()
}
- Task todo = table->currentEntry();
+ ToDoEvent todo = table->currentEntry();
NewTaskDialog e( todo, this, 0, TRUE );
@@ -350,6 +353,5 @@ void TodoWindow::populateCategories()
completedAction->setOn( table->showCompleted() );
- int id,
- rememberId;
+ int id, rememberId;
id = 1;
catMenu->insertItem( tr( "All Categories" ), id++ );
@@ -444,6 +446,7 @@ void TodoWindow::setDocument( const QString &filename )
if ( filename.find(".vcs") != int(filename.length()) - 4 ) return;
- QValueList<Task> tl = Task::readVCalendar( filename );
- for( QValueList<Task>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
+ ToDoDB todoDB(filename, new ToDoVCalResource() );
+ QValueList<ToDoEvent> tl = todoDB.rawToDos();
+ for( QValueList<ToDoEvent>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
table->addEntry( *it );
}
@@ -455,7 +458,9 @@ void TodoWindow::slotBeam()
{
unlink( beamfile ); // delete if exists
- Task c = table->currentEntry();
+ ToDoEvent c = table->currentEntry();
mkdir("/tmp/obex/", 0755);
- Task::writeVCalendar( beamfile, c );
+ ToDoDB todoDB( beamfile, new ToDoVCalResource() );
+ todoDB.addEvent( c );
+ todoDB.save();
Ir *ir = new Ir( this );
connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );