-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 46 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 2 |
3 files changed, 34 insertions, 18 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index f4b3ddb..201f863 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,10 +1,12 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.19 ************ | 3 | ********** VERSION 2.1.19 ************ |
4 | 4 | ||
5 | Fixed a crash in journal view and a crash in setting a todo to stopped when KO/Pi saved the file when "stop todo" dialog was shown. | 5 | Fixed a crash in journal view. |
6 | Fixed a crash at setting a todo to stopped if KO/Pi saved the file while "stop todo" dialog was shown. | ||
6 | Fixed a minor problem with the marcus bains line (whatever that is). | 7 | Fixed a minor problem with the marcus bains line (whatever that is). |
8 | Fixed a crash when setting a todo to complete from the show dialog which was called from the What's Next View. | ||
7 | 9 | ||
8 | ********** VERSION 2.1.18 ************ | 10 | ********** VERSION 2.1.18 ************ |
9 | 11 | ||
10 | Pi-Sync mode: | 12 | Pi-Sync mode: |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 00c2d97..27d755e 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -501,9 +501,10 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | |||
501 | ///////////////////////////////////////////////////////////////////////////// | 501 | ///////////////////////////////////////////////////////////////////////////// |
502 | 502 | ||
503 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 503 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
504 | KOrg::BaseView(calendar,parent,name) | 504 | KOrg::BaseView(calendar,parent,name) |
505 | { | 505 | { |
506 | mActiveItem = 0; | ||
506 | mCategoryPopupMenu = 0; | 507 | mCategoryPopupMenu = 0; |
507 | mPendingUpdateBeforeRepaint = false; | 508 | mPendingUpdateBeforeRepaint = false; |
508 | isFlatDisplay = false; | 509 | isFlatDisplay = false; |
509 | mNavigator = 0; | 510 | mNavigator = 0; |
@@ -806,30 +807,40 @@ void KOTodoView::paintEvent(QPaintEvent * pevent) | |||
806 | } | 807 | } |
807 | KOrg::BaseView::paintEvent( pevent); | 808 | KOrg::BaseView::paintEvent( pevent); |
808 | } | 809 | } |
809 | 810 | ||
811 | void KOTodoView::clearList( bool saveCurrentItem ) // default true | ||
812 | { | ||
813 | if ( mTodoListView->childCount() ) { | ||
814 | if ( saveCurrentItem ) | ||
815 | storeCurrentItem(); | ||
816 | mTodoListView->clear(); | ||
817 | mTodoMap.clear(); | ||
818 | } | ||
819 | } | ||
810 | void KOTodoView::updateView() | 820 | void KOTodoView::updateView() |
811 | { | 821 | { |
822 | mActiveItem = 0; | ||
812 | pendingSubtodo = 0; | 823 | pendingSubtodo = 0; |
813 | if ( mBlockUpdate ) { | 824 | if ( mBlockUpdate ) { |
814 | return; | 825 | return; |
815 | } | 826 | } |
816 | if ( !isVisible() ) { | 827 | if ( !isVisible() ) { |
817 | mPendingUpdateBeforeRepaint = true; | 828 | clearList (); |
818 | return; | 829 | mPendingUpdateBeforeRepaint = true; |
830 | return; | ||
819 | } | 831 | } |
820 | //qDebug("KOTodoView::updateView() %x", this); | 832 | //qDebug("KOTodoView::updateView() %x", this); |
821 | if ( isFlatDisplay ) { | 833 | if ( isFlatDisplay ) { |
822 | displayAllFlat(); | 834 | displayAllFlat(); |
823 | return; | 835 | return; |
824 | } | 836 | } |
825 | storeCurrentItem(); | ||
826 | //qDebug("update "); | 837 | //qDebug("update "); |
827 | // kdDebug() << "KOTodoView::updateView()" << endl; | 838 | // kdDebug() << "KOTodoView::updateView()" << endl; |
828 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 839 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
829 | 840 | ||
830 | 841 | clearList (); | |
831 | mTodoListView->clear(); | 842 | |
832 | if ( mName == "todolistsmall" ) { | 843 | if ( mName == "todolistsmall" ) { |
833 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 844 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
834 | int ps = fo.pointSize() -2; | 845 | int ps = fo.pointSize() -2; |
835 | if ( ps > 12 ) | 846 | if ( ps > 12 ) |
@@ -863,9 +874,8 @@ void KOTodoView::updateView() | |||
863 | 874 | ||
864 | // Put for each Event a KOTodoViewItem in the list view. Don't rely on a | 875 | // Put for each Event a KOTodoViewItem in the list view. Don't rely on a |
865 | // specific order of events. That means that we have to generate parent items | 876 | // specific order of events. That means that we have to generate parent items |
866 | // recursively for proper hierarchical display of Todos. | 877 | // recursively for proper hierarchical display of Todos. |
867 | mTodoMap.clear(); | ||
868 | Todo *todo; | 878 | Todo *todo; |
869 | todo = todoList.first();// todo; todo = todoList.next()) { | 879 | todo = todoList.first();// todo; todo = todoList.next()) { |
870 | while ( todo ) { | 880 | while ( todo ) { |
871 | bool next = true; | 881 | bool next = true; |
@@ -973,9 +983,10 @@ void KOTodoView::resetCurrentItem() | |||
973 | } | 983 | } |
974 | } | 984 | } |
975 | } | 985 | } |
976 | processSelectionChange(); | 986 | processSelectionChange(); |
977 | QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); | 987 | if ( mName != "todolistsmall" ) |
988 | QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); | ||
978 | } | 989 | } |
979 | void KOTodoView::resetFocusToList() | 990 | void KOTodoView::resetFocusToList() |
980 | { | 991 | { |
981 | topLevelWidget()->setActiveWindow(); | 992 | topLevelWidget()->setActiveWindow(); |
@@ -1099,14 +1110,16 @@ void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, | |||
1099 | } | 1110 | } |
1100 | 1111 | ||
1101 | void KOTodoView::editItem(QListViewItem *item ) | 1112 | void KOTodoView::editItem(QListViewItem *item ) |
1102 | { | 1113 | { |
1103 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | 1114 | if ( item ) |
1115 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | ||
1104 | } | 1116 | } |
1105 | 1117 | ||
1106 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) | 1118 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) |
1107 | { | 1119 | { |
1108 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | 1120 | if ( item ) |
1121 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | ||
1109 | } | 1122 | } |
1110 | 1123 | ||
1111 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) | 1124 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) |
1112 | { | 1125 | { |
@@ -1356,9 +1369,9 @@ void KOTodoView::toggleRunningItem() | |||
1356 | int yy = (QApplication::desktop()->height()-hei)/2; | 1369 | int yy = (QApplication::desktop()->height()-hei)/2; |
1357 | tp.setGeometry( xx,yy,wid,hei ); | 1370 | tp.setGeometry( xx,yy,wid,hei ); |
1358 | } | 1371 | } |
1359 | tp.exec(); | 1372 | tp.exec(); |
1360 | updateTodo ( t, 0 ); | 1373 | updateTodo ( t, KOGlobals::EVENTEDITED ); |
1361 | } else { | 1374 | } else { |
1362 | KOStartTodoPrefs tp ( t->summary(), this ); | 1375 | KOStartTodoPrefs tp ( t->summary(), this ); |
1363 | if (QApplication::desktop()->width() <= 800 ){ | 1376 | if (QApplication::desktop()->width() <= 800 ){ |
1364 | int wid = tp.width(); | 1377 | int wid = tp.width(); |
@@ -1373,9 +1386,9 @@ void KOTodoView::toggleRunningItem() | |||
1373 | t->setRunning( true ); | 1386 | t->setRunning( true ); |
1374 | updateView(); | 1387 | updateView(); |
1375 | } else { | 1388 | } else { |
1376 | t->setRunning( true ); | 1389 | t->setRunning( true ); |
1377 | updateTodo ( t, 0 ); | 1390 | updateTodo ( t, KOGlobals::EVENTEDITED ); |
1378 | } | 1391 | } |
1379 | } | 1392 | } |
1380 | } | 1393 | } |
1381 | 1394 | ||
@@ -1504,18 +1517,18 @@ void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) | |||
1504 | } | 1517 | } |
1505 | 1518 | ||
1506 | void KOTodoView::displayAllFlat() | 1519 | void KOTodoView::displayAllFlat() |
1507 | { | 1520 | { |
1508 | storeCurrentItem(); | 1521 | |
1522 | mActiveItem = 0; | ||
1509 | pendingSubtodo = 0; | 1523 | pendingSubtodo = 0; |
1510 | if ( mBlockUpdate ) { | 1524 | if ( mBlockUpdate ) { |
1511 | return; | 1525 | return; |
1512 | } | 1526 | } |
1527 | clearList (); | ||
1513 | mPopupMenu->setItemChecked( 8,true ); | 1528 | mPopupMenu->setItemChecked( 8,true ); |
1514 | isFlatDisplay = true; | 1529 | isFlatDisplay = true; |
1515 | QPtrList<Todo> todoList = calendar()->todos(); | 1530 | QPtrList<Todo> todoList = calendar()->todos(); |
1516 | mTodoMap.clear(); | ||
1517 | mTodoListView->clear(); | ||
1518 | Todo *todo; | 1531 | Todo *todo; |
1519 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 1532 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
1520 | if ( checkTodo( todo ) ) { | 1533 | if ( checkTodo( todo ) ) { |
1521 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1534 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
@@ -1695,11 +1708,12 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) | |||
1695 | e->accept(); | 1708 | e->accept(); |
1696 | } | 1709 | } |
1697 | } | 1710 | } |
1698 | } | 1711 | } |
1712 | |||
1699 | void KOTodoView::updateTodo( Todo * t, int type ) | 1713 | void KOTodoView::updateTodo( Todo * t, int type ) |
1700 | { | 1714 | { |
1701 | if ( mBlockUpdate) | 1715 | if ( mBlockUpdate ) |
1702 | return; | 1716 | return; |
1703 | 1717 | ||
1704 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1718 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
1705 | itemIterator = mTodoMap.find(t); | 1719 | itemIterator = mTodoMap.find(t); |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index a8e90e2..9180015 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -173,9 +173,9 @@ class KOTodoView : public KOrg::BaseView | |||
173 | void saveLayout(KConfig *config, const QString &group) const; | 173 | void saveLayout(KConfig *config, const QString &group) const; |
174 | void restoreLayout(KConfig *config, const QString &group); | 174 | void restoreLayout(KConfig *config, const QString &group); |
175 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} | 175 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} |
176 | QString getWhatsThisText(QPoint p); | 176 | QString getWhatsThisText(QPoint p); |
177 | void clearList() {mTodoListView->clear(); } | 177 | void clearList( bool saveCurrentItem = true ); |
178 | 178 | ||
179 | public slots: | 179 | public slots: |
180 | void updateView(); | 180 | void updateView(); |
181 | void updateConfig(); | 181 | void updateConfig(); |