summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp21
-rw-r--r--korganizer/kotodoview.h2
2 files changed, 17 insertions, 6 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 395325c..935a5f5 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -732,4 +732,5 @@ void KOTodoView::storeCurrentItem()
mCurItem = 0;
mCurItemRootParent = 0;
+ mCurItemParent = 0;
mCurItemAbove = 0;
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
@@ -740,4 +741,5 @@ void KOTodoView::storeCurrentItem()
mCurItemAbove = activeItemAbove->todo();
mCurItemRootParent = mCurItem;
+ mCurItemParent = mCurItemRootParent->relatedTo();
while ( mCurItemRootParent->relatedTo() != 0 )
mCurItemRootParent = mCurItemRootParent->relatedTo();
@@ -751,4 +753,5 @@ void KOTodoView::resetCurrentItem()
KOTodoViewItem* foundItem = 0;
KOTodoViewItem* foundItemRoot = 0;
+ KOTodoViewItem* foundItemParent = 0;
KOTodoViewItem* foundItemAbove = 0;
if ( mTodoListView->firstChild () ) {
@@ -762,14 +765,22 @@ void KOTodoView::resetCurrentItem()
foundItemAbove = item;
- } else if ( item->todo() == mCurItemRootParent ) {
+ }
+ if ( item->todo() == mCurItemRootParent ) {
foundItemRoot = item;
}
+ if ( item->todo() == mCurItemParent ) {
+ foundItemParent = item;
+ }
item = (KOTodoViewItem*)item->itemBelow();
}
if ( ! foundItem ) {
- if ( foundItemRoot )
- foundItem = foundItemRoot;
- else
- foundItem = foundItemAbove;
+ if ( foundItemParent ) {
+ foundItem = foundItemParent;
+ } else {
+ if ( foundItemRoot )
+ foundItem = foundItemRoot;
+ else
+ foundItem = foundItemAbove;
+ }
}
}
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 39976cf..d0788a9 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -258,5 +258,5 @@ class KOTodoView : public KOrg::BaseView
void storeCurrentItem();
void resetCurrentItem();
- Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
+ Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove;
};