summaryrefslogtreecommitdiffstats
path: root/kmail/kmheaders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmheaders.cpp')
-rw-r--r--kmail/kmheaders.cpp210
1 files changed, 105 insertions, 105 deletions
diff --git a/kmail/kmheaders.cpp b/kmail/kmheaders.cpp
index d8c30d074..9d721e9da 100644
--- a/kmail/kmheaders.cpp
+++ b/kmail/kmheaders.cpp
@@ -92,9 +92,9 @@ TQPixmap* KMHeaders::pixReadFwdReplied = 0;
//-----------------------------------------------------------------------------
-KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *tqparent,
+KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *parent,
const char *name) :
- KListView( tqparent, name ),
+ KListView( parent, name ),
mIgnoreSortOrderChanges( false )
{
static bool pixmapsLoaded = false;
@@ -920,26 +920,26 @@ void KMHeaders::msgAdded(int id)
msgId = "";
TQString replyToId = mFolder->getMsgBase(id)->replyToIdMD5();
- SortCacheItem *tqparent = findParent( sci );
- if (!tqparent && mSubjThreading) {
- tqparent = findParentBySubject( sci );
- if (tqparent && sci->isImperfectlyThreaded()) {
- // The tqparent we found could be by subject, in which case it is
+ SortCacheItem *parent = findParent( sci );
+ if (!parent && mSubjThreading) {
+ parent = findParentBySubject( sci );
+ if (parent && sci->isImperfectlyThreaded()) {
+ // The parent we found could be by subject, in which case it is
// possible, that it would be preferrable to thread it below us,
// not the other way around. Check that. This is not only
// cosmetic, as getting this wrong leads to circular threading.
- if (msgId == mFolder->getMsgBase(tqparent->item()->msgId())->replyToIdMD5()
- || msgId == mFolder->getMsgBase(tqparent->item()->msgId())->replyToAuxIdMD5())
- tqparent = NULL;
+ if (msgId == mFolder->getMsgBase(parent->item()->msgId())->replyToIdMD5()
+ || msgId == mFolder->getMsgBase(parent->item()->msgId())->replyToAuxIdMD5())
+ parent = NULL;
}
}
- if (tqparent && mFolder->getMsgBase(tqparent->id())->isWatched())
+ if (parent && mFolder->getMsgBase(parent->id())->isWatched())
mFolder->getMsgBase(id)->setqStatus( KMMsgStatusWatched );
- else if (tqparent && mFolder->getMsgBase(tqparent->id())->isIgnored())
+ else if (parent && mFolder->getMsgBase(parent->id())->isIgnored())
mFolder->getMsgBase(id)->setqStatus( KMMsgStatusIgnored );
- if (tqparent)
- hi = new HeaderItem( tqparent->item(), id );
+ if (parent)
+ hi = new HeaderItem( parent->item(), id );
else
hi = new HeaderItem( this, id );
@@ -955,7 +955,7 @@ void KMHeaders::msgAdded(int id)
mSortCacheItems.replace(msgId, sci);
/* Add to the list of potential parents for subject threading. But only if
* we are top level. */
- if (mSubjThreading && tqparent) {
+ if (mSubjThreading && parent) {
TQString subjMD5 = mFolder->getMsgBase(id)->strippedSubjectMD5();
if (subjMD5.isEmpty()) {
mFolder->getMsgBase(id)->initStrippedSubjectMD5();
@@ -977,7 +977,7 @@ void KMHeaders::msgAdded(int id)
sci->setSubjectThreadingList( mSubjectLists[subjMD5] );
}
}
- // The message we just added might be a better tqparent for one of the as of
+ // The message we just added might be a better parent for one of the as of
// yet imperfectly threaded messages. Let's find out.
/* In case the current item is taken during reparenting, prevent qlistview
@@ -1017,8 +1017,8 @@ void KMHeaders::msgAdded(int id)
TQListViewItem *newParent = mItems[id];
TQListViewItem *msg = mItems[tryMe];
- if (msg->tqparent())
- msg->tqparent()->takeItem(msg);
+ if (msg->parent())
+ msg->parent()->takeItem(msg);
else
takeItem(msg);
newParent->insertItem(msg);
@@ -1029,7 +1029,7 @@ void KMHeaders::msgAdded(int id)
if (perfectParent) {
mImperfectlyThreadedList.removeRef (mItems[tryMe]);
- // The item was imperfectly thread before, now it's tqparent
+ // The item was imperfectly thread before, now it's parent
// is there. Update the .sorted file accordingly.
TQString sortFile = KMAIL_SORT_FILE(mFolder);
FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+");
@@ -1115,12 +1115,12 @@ void KMHeaders::msgRemoved(int id, TQString msgId )
if ( mSubjThreading && removedItem->sortCacheItem()->subjectThreadingList() )
removedItem->sortCacheItem()->subjectThreadingList()->removeRef( removedItem->sortCacheItem() );
- // Retqparent tqchildren of item.
+ // Reparent tqchildren of item.
TQListViewItem *myParent = removedItem;
TQListViewItem *myChild = myParent->firstChild();
TQListViewItem *threadRoot = myParent;
- while (threadRoot->tqparent())
- threadRoot = threadRoot->tqparent();
+ while (threadRoot->parent())
+ threadRoot = threadRoot->parent();
TQString key = static_cast<HeaderItem*>(threadRoot)->key(mSortCol, !mSortDescending);
TQPtrList<TQListViewItem> childList;
@@ -1148,25 +1148,25 @@ void KMHeaders::msgRemoved(int id, TQString msgId )
TQListViewItem *lvi = *it;
HeaderItem *item = static_cast<HeaderItem*>(lvi);
SortCacheItem *sci = item->sortCacheItem();
- SortCacheItem *tqparent = findParent( sci );
- if ( !tqparent && mSubjThreading )
- tqparent = findParentBySubject( sci );
+ SortCacheItem *parent = findParent( sci );
+ if ( !parent && mSubjThreading )
+ parent = findParentBySubject( sci );
- Q_ASSERT( !tqparent || tqparent->item() != removedItem );
+ Q_ASSERT( !parent || parent->item() != removedItem );
myParent->takeItem(lvi);
- if ( tqparent && tqparent->item() != item && tqparent->item() != removedItem ) {
- tqparent->item()->insertItem(lvi);
- tqparent->addSortedChild( sci );
+ if ( parent && parent->item() != item && parent->item() != removedItem ) {
+ parent->item()->insertItem(lvi);
+ parent->addSortedChild( sci );
} else {
insertItem(lvi);
mRoot->addSortedChild( sci );
}
- if ((!tqparent || sci->isImperfectlyThreaded())
+ if ((!parent || sci->isImperfectlyThreaded())
&& !mImperfectlyThreadedList.containsRef(item))
mImperfectlyThreadedList.append(item);
- if (tqparent && !sci->isImperfectlyThreaded()
+ if (parent && !sci->isImperfectlyThreaded()
&& mImperfectlyThreadedList.containsRef(item))
mImperfectlyThreadedList.removeRef(item);
}
@@ -1242,8 +1242,8 @@ TQPtrList<TQListViewItem> KMHeaders::currentThread() const
// ...find the top-level item:
TQListViewItem *topOfThread = curItem;
- while ( topOfThread->tqparent() )
- topOfThread = topOfThread->tqparent();
+ while ( topOfThread->parent() )
+ topOfThread = topOfThread->parent();
// collect the items in this thread:
TQPtrList<TQListViewItem> list;
@@ -1266,8 +1266,8 @@ void KMHeaders::setThreadtqStatus(KMMsgtqStatus status, bool toggle)
if (item->isSelected() ) {
// ...find the top-level item:
TQListViewItem *top = item;
- while ( top->tqparent() )
- top = top->tqparent();
+ while ( top->parent() )
+ top = top->parent();
if (!topOfThreads.contains(top)) {
topOfThreads.append(top);
}
@@ -1313,11 +1313,11 @@ int KMHeaders::slotFilterMsg(KMMessage *msg)
kmkernel->emergencyExit( i18n("Unable to process messages: " ) + TQString::fromLocal8Bit(strerror(errno)));
return 2;
}
- if (msg->tqparent()) { // unGet this msg
+ if (msg->parent()) { // unGet this msg
int idx = -1;
KMFolder * p = 0;
KMMsgDict::instance()->getLocation( msg, &p, &idx );
- assert( p == msg->tqparent() ); assert( idx >= 0 );
+ assert( p == msg->parent() ); assert( idx >= 0 );
p->unGetMsg( idx );
}
@@ -1328,13 +1328,13 @@ int KMHeaders::slotFilterMsg(KMMessage *msg)
void KMHeaders::slotExpandOrCollapseThread( bool expand )
{
if ( !isThreaded() ) return;
- // find top-level tqparent of currentItem().
+ // find top-level parent of currentItem().
TQListViewItem *item = currentItem();
if ( !item ) return;
clearSelection();
item->setSelected( true );
- while ( item->tqparent() )
- item = item->tqparent();
+ while ( item->parent() )
+ item = item->parent();
HeaderItem * hdrItem = static_cast<HeaderItem*>(item);
hdrItem->setOpenRecursive( expand );
if ( !expand ) // collapse can hide the current item:
@@ -1358,8 +1358,8 @@ void KMHeaders::slotExpandOrCollapseAllThreads( bool expand )
if ( !expand ) { // collapse can hide the current item:
TQListViewItem * item = currentItem();
if( item ) {
- while ( item->tqparent() )
- item = item->tqparent();
+ while ( item->parent() )
+ item = item->parent();
setCurrentMsg( static_cast<HeaderItem*>(item)->msgId() );
}
}
@@ -1713,7 +1713,7 @@ void KMHeaders::setSelected( TQListViewItem *item, bool selected )
if ( item->isVisible() )
KListView::setSelected( item, selected );
- // If the item is the tqparent of a closed thread recursively select
+ // If the item is the parent of a closed thread recursively select
// tqchildren .
if ( isThreaded() && !item->isOpen() && item->firstChild() ) {
TQListViewItem *nextRoot = item->itemBelow();
@@ -1826,7 +1826,7 @@ void KMHeaders::selectNextMessage()
if (lvi && below ) {
while (temp) {
temp->firstChild();
- temp = temp->tqparent();
+ temp = temp->parent();
}
lvi->tqrepaint();
/* test to see if we need to unselect messages on back track */
@@ -1864,7 +1864,7 @@ void KMHeaders::selectPrevMessage()
if (lvi && above) {
while (temp) {
temp->firstChild();
- temp = temp->tqparent();
+ temp = temp->parent();
}
lvi->tqrepaint();
/* test to see if we need to unselect messages on back track */
@@ -2000,8 +2000,8 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept
// root and recursively sort all of that ancestors tqchildren.
if (item) {
TQListViewItem *next = item;
- while (next->tqparent())
- next = next->tqparent();
+ while (next->parent())
+ next = next->parent();
next = static_cast<HeaderItem*>(next)->firstChildNonConst();
while (next && (next != item))
if (static_cast<HeaderItem*>(next)->firstChildNonConst())
@@ -2010,7 +2010,7 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept
next = next->nextSibling();
else {
while (next && (next != item)) {
- next = next->tqparent();
+ next = next->parent();
if (next == item)
break;
if (next && next->nextSibling()) {
@@ -2288,7 +2288,7 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e)
&& ( mPressPos.x() >= header()->cellPos( header()->mapToActual( 0 ) ) );
if ( rootDecoClicked ) {
- // Check if our item is the tqparent of a closed thread and if so, if the root
+ // Check if our item is the parent of a closed thread and if so, if the root
// decoration of the item was clicked (i.e. the +/- sign) which would expand
// the thread. In that case, deselect all tqchildren, so opening the thread
// doesn't cause a flicker.
@@ -2315,7 +2315,7 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e)
}
if ( rootDecoClicked ) {
- // select the thread's tqchildren after closing if the tqparent is selected
+ // select the thread's tqchildren after closing if the parent is selected
if ( lvi && !lvi->isOpen() && lvi->isSelected() )
setSelected( lvi, true );
}
@@ -2324,12 +2324,12 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e)
if ( lvi != currentItem() )
highlightMessage( lvi );
/* Explicitely set selection state. This is necessary because we want to
- * also select all tqchildren of closed threads when the tqparent is selected. */
+ * also select all tqchildren of closed threads when the parent is selected. */
- // unless ctrl tqmask, set selected if it isn't already
+ // unless ctrl mask, set selected if it isn't already
if ( !( e->state() & ControlButton ) && !wasSelected )
setSelected( lvi, true );
- // if ctrl tqmask, toggle selection
+ // if ctrl mask, toggle selection
if ( e->state() & ControlButton )
setSelected( lvi, !wasSelected );
@@ -2768,7 +2768,7 @@ bool KMHeaders::writeSortOrder()
KMMsgBase *kmb;
while(HeaderItem *i = items.pop()) {
- int parent_id = -1; //no tqparent, top level
+ int parent_id = -1; //no parent, top level
if (threaded) {
kmb = mFolder->getMsgBase( i->msgId() );
assert(kmb); // I have seen 0L come out of this, called from
@@ -2782,7 +2782,7 @@ bool KMHeaders::writeSortOrder()
if (p)
parent_id = p->id();
- // We now have either found a tqparent, or set it to -1, which means that
+ // We now have either found a parent, or set it to -1, which means that
// it will be reevaluated when a message is added, for example. If there
// is no replyToId and no replyToAuxId and the message is not prefixed,
// this message is top level, and will always be, so no need to
@@ -2792,7 +2792,7 @@ bool KMHeaders::writeSortOrder()
&& !kmb->subjectIsPrefixed() )
parent_id = -2;
// FIXME also mark messages with -1 as -2 a certain amount of time after
- // their arrival, since it becomes very unlikely that a new tqparent for
+ // their arrival, since it becomes very unlikely that a new parent for
// them will show up. (Ingo suggests a month.) -till
}
internalWriteItem(sortStream, mFolder, i->msgId(), parent_id,
@@ -2828,13 +2828,13 @@ void KMHeaders::appendItemToSortFile(HeaderItem *khi)
{
TQString sortFile = KMAIL_SORT_FILE(mFolder);
if(FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+")) {
- int parent_id = -1; //no tqparent, top level
+ int parent_id = -1; //no parent, top level
if (isThreaded()) {
SortCacheItem *sci = khi->sortCacheItem();
KMMsgBase *kmb = mFolder->getMsgBase( khi->msgId() );
- if(sci->tqparent() && !sci->isImperfectlyThreaded())
- parent_id = sci->tqparent()->id();
+ if(sci->parent() && !sci->isImperfectlyThreaded())
+ parent_id = sci->parent()->id();
else if(kmb->replyToIdMD5().isEmpty()
&& kmb->replyToAuxIdMD5().isEmpty()
&& !kmb->subjectIsPrefixed())
@@ -2872,7 +2872,7 @@ void KMHeaders::dirtySortOrder(int column)
// -----------------
void SortCacheItem::updateSortFile( FILE *sortStream, KMFolder *folder,
- bool waiting_for_tqparent, bool update_discover)
+ bool waiting_for_parent, bool update_discover)
{
if(mSortOffset == -1) {
fseek(sortStream, 0, SEEK_END);
@@ -2882,7 +2882,7 @@ void SortCacheItem::updateSortFile( FILE *sortStream, KMFolder *folder,
}
int parent_id = -1;
- if(!waiting_for_tqparent) {
+ if(!waiting_for_parent) {
if(mParent && !isImperfectlyThreaded())
parent_id = mParent->id();
}
@@ -2931,9 +2931,9 @@ void KMHeaders::printThreadingTree()
}
for (int i = 0; i < (int)mItems.size(); ++i) {
HeaderItem *item = mItems[i];
- int parentCacheId = item->sortCacheItem()->tqparent()?item->sortCacheItem()->tqparent()->id():0;
- kdDebug( 5006 ) << "SortCacheItem: " << item->sortCacheItem()->id() << " tqparent: " << parentCacheId << endl;
- kdDebug( 5006 ) << "Item: " << item << " sortCache: " << item->sortCacheItem() << " tqparent: " << item->sortCacheItem()->tqparent() << endl;
+ int parentCacheId = item->sortCacheItem()->parent()?item->sortCacheItem()->parent()->id():0;
+ kdDebug( 5006 ) << "SortCacheItem: " << item->sortCacheItem()->id() << " parent: " << parentCacheId << endl;
+ kdDebug( 5006 ) << "Item: " << item << " sortCache: " << item->sortCacheItem() << " parent: " << item->sortCacheItem()->parent() << endl;
}
kdDebug(5006) << endl;
}
@@ -2962,8 +2962,8 @@ void KMHeaders::buildSubjectThreadingTree( TQMemArray<SortCacheItem *> sortCache
for(int x = 0; x < mFolder->count(); x++) {
// Only a lot items that are now toplevel
- if ( sortCache[x]->tqparent()
- && sortCache[x]->tqparent()->id() != -666 ) continue;
+ if ( sortCache[x]->parent()
+ && sortCache[x]->parent()->id() != -666 ) continue;
KMMsgBase *mi = mFolder->getMsgBase(x);
TQString subjMD5 = mi->strippedSubjectMD5();
if (subjMD5.isEmpty()) {
@@ -2996,19 +2996,19 @@ void KMHeaders::buildSubjectThreadingTree( TQMemArray<SortCacheItem *> sortCache
SortCacheItem* KMHeaders::findParent(SortCacheItem *item)
{
- SortCacheItem *tqparent = NULL;
- if (!item) return tqparent;
+ SortCacheItem *parent = NULL;
+ if (!item) return parent;
KMMsgBase *msg = mFolder->getMsgBase(item->id());
TQString replyToIdMD5 = msg->replyToIdMD5();
item->setImperfectlyThreaded(true);
/* First, try if the message our Reply-To header points to
* is available to thread below. */
if(!replyToIdMD5.isEmpty()) {
- tqparent = mSortCacheItems[replyToIdMD5];
- if (tqparent)
+ parent = mSortCacheItems[replyToIdMD5];
+ if (parent)
item->setImperfectlyThreaded(false);
}
- if (!tqparent) {
+ if (!parent) {
// If we dont have a replyToId, or if we have one and the
// corresponding message is not in this folder, as happens
// if you keep your outgoing messages in an OUTBOX, for
@@ -3017,15 +3017,15 @@ SortCacheItem* KMHeaders::findParent(SortCacheItem *item)
// contains the second to last one.
TQString ref = msg->replyToAuxIdMD5();
if (!ref.isEmpty())
- tqparent = mSortCacheItems[ref];
+ parent = mSortCacheItems[ref];
}
- return tqparent;
+ return parent;
}
SortCacheItem* KMHeaders::findParentBySubject(SortCacheItem *item)
{
- SortCacheItem *tqparent = NULL;
- if (!item) return tqparent;
+ SortCacheItem *parent = NULL;
+ if (!item) return parent;
KMMsgBase *msg = mFolder->getMsgBase(item->id());
@@ -3033,7 +3033,7 @@ SortCacheItem* KMHeaders::findParentBySubject(SortCacheItem *item)
// This is necessary to make for example cvs commit mailing lists
// work as expected without having to turn threading off alltogether.
if (!msg->subjectIsPrefixed())
- return tqparent;
+ return parent;
TQString replyToIdMD5 = msg->replyToIdMD5();
TQString subjMD5 = msg->strippedSubjectMD5();
@@ -3043,7 +3043,7 @@ SortCacheItem* KMHeaders::findParentBySubject(SortCacheItem *item)
for (TQPtrListIterator<SortCacheItem> it2(*mSubjectLists[subjMD5]);
it2.current(); ++it2) {
KMMsgBase *mb = mFolder->getMsgBase((*it2)->id());
- if ( !mb ) return tqparent;
+ if ( !mb ) return parent;
// make sure it's not ourselves
if ( item == (*it2) ) continue;
int delta = msg->date() - mb->date();
@@ -3052,12 +3052,12 @@ SortCacheItem* KMHeaders::findParentBySubject(SortCacheItem *item)
if (delta > 0 ) {
// Don't use parents more than 6 weeks older than us.
if (delta < 3628899)
- tqparent = (*it2);
+ parent = (*it2);
break;
}
}
}
- return tqparent;
+ return parent;
}
bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
@@ -3118,7 +3118,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
SortCacheItem *item;
unsigned long serNum, parentSerNum;
- int id, len, tqparent, x;
+ int id, len, parent, x;
TQChar *tmp_qchar = 0;
int tmp_qchar_len = 0;
const int mFolderCount = mFolder->count();
@@ -3158,14 +3158,14 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
continue;
}
if (parentSerNum < KMAIL_RESERVED) {
- tqparent = (int)parentSerNum - KMAIL_RESERVED;
+ parent = (int)parentSerNum - KMAIL_RESERVED;
} else {
- KMMsgDict::instance()->getLocation(parentSerNum - KMAIL_RESERVED, &folder, &tqparent);
+ KMMsgDict::instance()->getLocation(parentSerNum - KMAIL_RESERVED, &folder, &parent);
if (folder != mFolder)
- tqparent = -1;
+ parent = -1;
}
if ((id < 0) || (id >= mFolderCount) ||
- (tqparent < -2) || (tqparent >= mFolderCount)) { // sanity checking
+ (parent < -2) || (parent >= mFolderCount)) { // sanity checking
kdDebug(5006) << "Whoa.1! " << __FILE__ << ":" << __LINE__ << endl;
error = true;
continue;
@@ -3183,15 +3183,15 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
} else {
item = sortCache[id] = new SortCacheItem(id, key, offset);
}
- if (threaded && tqparent != -2) {
- if(tqparent == -1) {
+ if (threaded && parent != -2) {
+ if(parent == -1) {
unparented.append(item);
mRoot->addUnsortedChild(item);
} else {
- if( ! sortCache[tqparent] ) {
- sortCache[tqparent] = new SortCacheItem;
+ if( ! sortCache[parent] ) {
+ sortCache[parent] = new SortCacheItem;
}
- sortCache[tqparent]->addUnsortedChild(item);
+ sortCache[parent]->addUnsortedChild(item);
}
} else {
if(x < sorted_count )
@@ -3258,8 +3258,8 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
SHOW_TIMER(holes);
}
- // Make sure we've placed everything in tqparent/child relationship. All
- // messages with a tqparent id of -1 in the sort file are reevaluated here.
+ // Make sure we've placed everything in parent/child relationship. All
+ // messages with a parent id of -1 in the sort file are reevaluated here.
if (threaded) buildThreadingTree( sortCache );
TQPtrList<SortCacheItem> toBeSubjThreaded;
@@ -3269,10 +3269,10 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
for(TQPtrListIterator<SortCacheItem> it(unparented); it.current(); ++it) {
SortCacheItem *item = (*it);
- SortCacheItem *tqparent = findParent( item );
- // If we have a tqparent, make sure it's not ourselves
- if ( tqparent && (tqparent != (*it)) ) {
- tqparent->addUnsortedChild((*it));
+ SortCacheItem *parent = findParent( item );
+ // If we have a parent, make sure it's not ourselves
+ if ( parent && (parent != (*it)) ) {
+ parent->addUnsortedChild((*it));
if(sortStream)
(*it)->updateSortFile(sortStream, mFolder);
} else {
@@ -3289,10 +3289,10 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
buildSubjectThreadingTree( sortCache );
for(TQPtrListIterator<SortCacheItem> it(toBeSubjThreaded); it.current(); ++it) {
SortCacheItem *item = (*it);
- SortCacheItem *tqparent = findParentBySubject( item );
+ SortCacheItem *parent = findParentBySubject( item );
- if ( tqparent ) {
- tqparent->addUnsortedChild((*it));
+ if ( parent ) {
+ parent->addUnsortedChild((*it));
if(sortStream)
(*it)->updateSortFile(sortStream, mFolder);
} else {
@@ -3348,11 +3348,11 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
/* Otherwise use the next item of the unsorted list */
new_kci = unsorted[unsorted_off++];
}
- if(new_kci->item() || new_kci->tqparent() != i) //could happen if you reparent
+ if(new_kci->item() || new_kci->parent() != i) //could happen if you reparent
continue;
if(threaded && i->item()) {
- // If the tqparent is watched or ignored, propagate that to it's
+ // If the parent is watched or ignored, propagate that to it's
// tqchildren
if (mFolder->getMsgBase(i->id())->isWatched())
mFolder->getMsgBase(new_kci->id())->setqStatus(KMMsgStatusWatched);
@@ -3406,7 +3406,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
sortCache[x]->setItem(mItems[sortCache[x]->id()] = khi);
}
// Add all imperfectly threaded items to a list, so they can be
- // reevaluated when a new message arrives which might be a better tqparent.
+ // reevaluated when a new message arrives which might be a better parent.
// Important for messages arriving out of order.
if (threaded && sortCache[x]->isImperfectlyThreaded()) {
mImperfectlyThreadedList.append(sortCache[x]->item());
@@ -3620,12 +3620,12 @@ TQValueList< TQ_UINT32 > KMHeaders::selectedVisibleSernums()
TQListViewItemIterator it(this, TQListViewItemIterator::Selected|TQListViewItemIterator::Visible);
while( it.current() ) {
if ( it.current()->isSelected() && it.current()->isVisible() ) {
- if ( it.current()->tqparent() && ( !it.current()->tqparent()->isOpen() ) ) {
- // the item's tqparent is closed, don't traverse any more of this subtree
- TQListViewItem * lastAncestorWithSiblings = it.current()->tqparent();
+ if ( it.current()->parent() && ( !it.current()->parent()->isOpen() ) ) {
+ // the item's parent is closed, don't traverse any more of this subtree
+ TQListViewItem * lastAncestorWithSiblings = it.current()->parent();
// travel towards the root until we find an ancestor with siblings
while ( ( lastAncestorWithSiblings->depth() > 0 ) && !lastAncestorWithSiblings->nextSibling() )
- lastAncestorWithSiblings = lastAncestorWithSiblings->tqparent();
+ lastAncestorWithSiblings = lastAncestorWithSiblings->parent();
// move the iterator to that ancestor's next sibling
it = TQListViewItemIterator( lastAncestorWithSiblings->nextSibling() );
continue;