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.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 2002e87..9424c23 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -293,13 +293,12 @@ QPopupMenu* MainWindow::contextMenu( int , bool recur ) {
; // FIXME
}
return menu;
}
QPopupMenu* MainWindow::options() {
- owarn << "Options" << oendl;
return m_options;
}
QPopupMenu* MainWindow::edit() {
return m_edit;
}
QToolBar* MainWindow::toolbar() {
@@ -312,20 +311,18 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) {
int cat = 0;
if ( m_curCat != QWidget::tr("All Categories") )
cat = currentCatId();
if ( m_curCat == QWidget::tr("Unfiled") )
cat = -1;
- owarn << " Category " << cat << " " << m_curCat << oendl;
-
- int filter = 1;
+ int filter = OPimTodoAccess::FilterCategory;
if (!m_completed )
- filter |= 4;
+ filter |= OPimTodoAccess::DoNotShowCompleted;
if (m_overdue)
- filter |= 2;
+ filter |= OPimTodoAccess::OnlyOverDue;
return m_todoMgr.sorted( asc, sortOrder, filter, cat );
}
OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) {
int cat = 0;
if ( m_curCat != QWidget::tr("All Categories") )
@@ -371,13 +368,12 @@ void MainWindow::closeEvent( QCloseEvent* e ) {
if (m_syncing ) {
e->accept();
return;
}
bool quit = false;
if ( m_todoMgr.saveAll() ){
- owarn << "saved" << oendl;
quit = true;
}else {
if ( QMessageBox::critical( this, QWidget::tr("Out of space"),
QWidget::tr("Todo was unable\n"
"to save your changes.\n"
"Free up some space\n"
@@ -534,13 +530,12 @@ void MainWindow::slotEdit() {
* set the category
*/
void MainWindow::setCategory( int c) {
if ( c <= 0 ) return;
- owarn << "Iterating over cats " << c << oendl;
for ( unsigned int i = 1; i < m_catMenu->count(); i++ )
m_catMenu->setItemChecked(i, c == (int)i );
if (c == 1 ) {
m_curCat = QString::null;
setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("All Categories" ) );
@@ -680,13 +675,12 @@ void MainWindow::slotShowDue(bool ov) {
raiseCurrentView();
}
void MainWindow::slotShow( int uid ) {
if ( uid == 0 ) return;
- owarn << "slotShow" << oendl;
currentShow()->slotShow( event( uid ) );
m_stack->raiseWidget( currentShow()->widget() );
}
void MainWindow::slotShowNext() {
int l = currentView()->next();
if (l!=0)
@@ -739,13 +733,12 @@ void MainWindow::updateList() {
}
void MainWindow::setReadAhead( uint count ) {
if (m_todoMgr.todoDB() )
m_todoMgr.todoDB()->setReadAhead( count );
}
void MainWindow::slotQuickEntered() {
- owarn << "entered" << oendl;
OPimTodo todo = quickEditor()->todo();
if (todo.isEmpty() )
return;
m_todoMgr.add( todo );
currentView()->addEvent( todo );
@@ -786,13 +779,12 @@ void MainWindow::slotComplete( const OPimTodo& todo ) {
* if there is a next occurence
* from the duedate of the last recurrance
*/
QDate date;
if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) {
int dayDiff = to.dueDate().daysTo( date );
- owarn << "day diff is " << dayDiff << oendl;
QDate inval;
/* generate a new uid for the old record */
to.setUid( 1 );
/* add the old one cause it has a new UID here cause it was spin off */
m_todoMgr.add( to );
@@ -950,21 +942,19 @@ namespace {
}
return nonMatching;
}
void addAlarms( const OPimNotifyManager::Alarms& als, int uid ) {
OPimNotifyManager::Alarms::ConstIterator it;
for ( it = als.begin(); it != als.end(); ++it ) {
- owarn << "Adding alarm for " << (*it).dateTime().toString() << oendl;
AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid );
}
}
void removeAlarms( const OPimNotifyManager::Alarms& als, int uid ) {
OPimNotifyManager::Alarms::ConstIterator it;
for ( it = als.begin(); it != als.end(); ++it ) {
- owarn << "Removinf alarm for " << (*it).dateTime().toString() << oendl;
AlarmServer::deleteAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid );
}
}
}
void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) {