From 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 13 Apr 2011 00:46:47 +0000 Subject: Initial conversion of kdepim to TQt This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmheaders.cpp | 372 ++++++++++++++++++++++++++-------------------------- 1 file changed, 186 insertions(+), 186 deletions(-) (limited to 'kmail/kmheaders.cpp') diff --git a/kmail/kmheaders.cpp b/kmail/kmheaders.cpp index 5afc9d811..f20ceb994 100644 --- a/kmail/kmheaders.cpp +++ b/kmail/kmheaders.cpp @@ -22,7 +22,7 @@ using KMail::ActionScheduler; #include "messagecopyhelper.h" using KMail::MessageCopyHelper; #include "broadcaststatus.h" -using KPIM::BroadcasStatus; +using KPIM::BroadcastqStatus; #include "progressmanager.h" using KPIM::ProgressManager; using KPIM::ProgressItem; @@ -92,9 +92,9 @@ TQPixmap* KMHeaders::pixReadFwdReplied = 0; //----------------------------------------------------------------------------- -KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *parent, +KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *tqparent, const char *name) : - KListView( parent, name ), + KListView( tqparent, name ), mIgnoreSortOrderChanges( false ) { static bool pixmapsLoaded = false; @@ -129,7 +129,7 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *parent, mPopup = new KPopupMenu(this); mPopup->insertTitle(i18n("View Columns")); mPopup->setCheckable(true); - mPopup->insertItem(i18n("Status"), KPaintInfo::COL_STATUS); + mPopup->insertItem(i18n("tqStatus"), KPaintInfo::COL_STATUS); mPopup->insertItem(i18n("Important"), KPaintInfo::COL_IMPORTANT); mPopup->insertItem(i18n("Action Item"), KPaintInfo::COL_TODO); mPopup->insertItem(i18n("Attachment"), KPaintInfo::COL_ATTACHMENT); @@ -329,7 +329,7 @@ void KMHeaders::slotToggleColumn(int id, int mode) } case KPaintInfo::COL_STATUS: { - show = &mPaintInfo.showStatus; + show = &mPaintInfo.showtqStatus; col = &mPaintInfo.statusCol; width = pixNew->width() + 8; if ( *col == header()->mapToIndex( *col ) ) @@ -622,7 +622,7 @@ void KMHeaders::readFolderConfig (void) mCurrentItemSerNum = config->readNumEntry("CurrentSerialNum", 0); mPaintInfo.orderOfArrival = config->readBoolEntry( "OrderOfArrival", false ); - mPaintInfo.status = config->readBoolEntry( "Status", false ); + mPaintInfo.status = config->readBoolEntry( "tqStatus", false ); { //area for config group "Geometry" KConfigGroupSaver saver(config, "Geometry"); @@ -653,7 +653,7 @@ void KMHeaders::writeFolderConfig (void) config->writeEntry("CurrentSerialNum", sernum); config->writeEntry("OrderOfArrival", mPaintInfo.orderOfArrival); - config->writeEntry("Status", mPaintInfo.status); + config->writeEntry("tqStatus", mPaintInfo.status); } //----------------------------------------------------------------------------- @@ -669,7 +669,7 @@ void KMHeaders::writeConfig (void) config->writeEntry("showTodoColumn" , mPaintInfo.showTodo); config->writeEntry("showSpamHamColumn" , mPaintInfo.showSpamHam); config->writeEntry("showWatchedIgnoredColumn", mPaintInfo.showWatchedIgnored); - config->writeEntry("showStatusColumn" , mPaintInfo.showStatus); + config->writeEntry("showStatusColumn" , mPaintInfo.showtqStatus); config->writeEntry("showSignedColumn" , mPaintInfo.showSigned); config->writeEntry("showCryptoColumn" , mPaintInfo.showCrypto); config->writeEntry("showReceiverColumn" , mPaintInfo.showReceiver); @@ -700,7 +700,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread ) highlightMessage(0, false); disconnect(mFolder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)), - this, TQT_SLOT(setFolderInfoStatus())); + this, TQT_SLOT(setFolderInfotqStatus())); mFolder->markNewAsUnread(); writeFolderConfig(); @@ -719,7 +719,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread ) disconnect(mFolder, TQT_SIGNAL(closed()), this, TQT_SLOT(folderClosed())); disconnect( mFolder, TQT_SIGNAL( statusMsg( const TQString& ) ), - BroadcasStatus::instance(), TQT_SLOT( seStatusMsg( const TQString& ) ) ); + BroadcastqStatus::instance(), TQT_SLOT( seStatusMsg( const TQString& ) ) ); disconnect(mFolder, TQT_SIGNAL(viewConfigChanged()), this, TQT_SLOT(reset())); writeSortOrder(); mFolder->close("kmheaders"); @@ -752,9 +752,9 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread ) connect(mFolder, TQT_SIGNAL(closed()), this, TQT_SLOT(folderClosed())); connect(mFolder, TQT_SIGNAL(statusMsg(const TQString&)), - BroadcasStatus::instance(), TQT_SLOT( seStatusMsg( const TQString& ) ) ); + BroadcastqStatus::instance(), TQT_SLOT( seStatusMsg( const TQString& ) ) ); connect(mFolder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)), - this, TQT_SLOT(setFolderInfoStatus())); + this, TQT_SLOT(setFolderInfotqStatus())); connect(mFolder, TQT_SIGNAL(viewConfigChanged()), this, TQT_SLOT(reset())); // Not very nice, but if we go from nested to non-nested @@ -789,7 +789,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread ) END_TIMER(updateMsg); SHOW_TIMER(updateMsg); makeHeaderVisible(); - setFolderInfoStatus(); + setFolderInfotqStatus(); TQString colText = i18n( "Sender" ); if (mFolder && (mFolder->whoField().lower() == "to") && !mPaintInfo.showReceiver) @@ -803,7 +803,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread ) colText = i18n( "Subject" ); if (mPaintInfo.status) - colText = colText + i18n( " (Status)" ); + colText = colText + i18n( " (tqStatus)" ); setColumnText( mPaintInfo.subCol, colText); } @@ -920,26 +920,26 @@ void KMHeaders::msgAdded(int id) msgId = ""; TQString replyToId = mFolder->getMsgBase(id)->replyToIdMD5(); - 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 + 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 // 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(parent->item()->msgId())->replyToIdMD5() - || msgId == mFolder->getMsgBase(parent->item()->msgId())->replyToAuxIdMD5()) - parent = NULL; + if (msgId == mFolder->getMsgBase(tqparent->item()->msgId())->replyToIdMD5() + || msgId == mFolder->getMsgBase(tqparent->item()->msgId())->replyToAuxIdMD5()) + tqparent = NULL; } } - if (parent && mFolder->getMsgBase(parent->id())->isWatched()) - mFolder->getMsgBase(id)->seStatus( KMMsgStatusWatched ); - else if (parent && mFolder->getMsgBase(parent->id())->isIgnored()) - mFolder->getMsgBase(id)->seStatus( KMMsgStatusIgnored ); - if (parent) - hi = new HeaderItem( parent->item(), id ); + if (tqparent && mFolder->getMsgBase(tqparent->id())->isWatched()) + mFolder->getMsgBase(id)->setqStatus( KMMsgStatusWatched ); + else if (tqparent && mFolder->getMsgBase(tqparent->id())->isIgnored()) + mFolder->getMsgBase(id)->setqStatus( KMMsgStatusIgnored ); + if (tqparent) + hi = new HeaderItem( tqparent->item(), id ); else hi = new HeaderItem( this, id ); @@ -953,16 +953,16 @@ void KMHeaders::msgAdded(int id) if ( !msgId.isEmpty() ) mSortCacheItems.tqreplace(msgId, sci); - /* Add to the list of potential parents for subject threading. But only if + /* Add to the list of potential tqparents for subject threading. But only if * we are top level. */ - if (mSubjThreading && parent) { + if (mSubjThreading && tqparent) { TQString subjMD5 = mFolder->getMsgBase(id)->strippedSubjectMD5(); if (subjMD5.isEmpty()) { mFolder->getMsgBase(id)->initStrippedSubjectMD5(); subjMD5 = mFolder->getMsgBase(id)->strippedSubjectMD5(); } if( !subjMD5.isEmpty()) { - if ( !mSubjectLists.find(subjMD5) ) + if ( !mSubjectLists.tqfind(subjMD5) ) mSubjectLists.insert(subjMD5, new TQPtrList()); // insertion sort by date. See buildThreadTrees for details. int p=0; @@ -977,7 +977,7 @@ void KMHeaders::msgAdded(int id) sci->setSubjectThreadingList( mSubjectLists[subjMD5] ); } } - // The message we just added might be a better parent for one of the as of + // The message we just added might be a better tqparent 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 @@ -1006,7 +1006,7 @@ void KMHeaders::msgAdded(int id) if (msgId != otherMsg->replyToAuxIdMD5()) continue; else { - if (!otherId.isEmpty() && mSortCacheItems.find(otherId)) + if (!otherId.isEmpty() && mSortCacheItems.tqfind(otherId)) continue; else // Thread below us by aux id, but keep on the list of @@ -1017,8 +1017,8 @@ void KMHeaders::msgAdded(int id) TQListViewItem *newParent = mItems[id]; TQListViewItem *msg = mItems[tryMe]; - if (msg->parent()) - msg->parent()->takeItem(msg); + if (msg->tqparent()) + msg->tqparent()->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 parent + // The item was imperfectly thread before, now it's tqparent // is there. Update the .sorted file accordingly. TQString sortFile = KMAIL_SORT_FILE(mFolder); FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+"); @@ -1110,17 +1110,17 @@ void KMHeaders::msgRemoved(int id, TQString msgId ) if (mSortCacheItems[msgId] == removedItem->sortCacheItem()) mSortCacheItems.remove(msgId); } - // Remove the message from the list of potential parents for threading by + // Remove the message from the list of potential tqparents for threading by // subject. if ( mSubjThreading && removedItem->sortCacheItem()->subjectThreadingList() ) removedItem->sortCacheItem()->subjectThreadingList()->removeRef( removedItem->sortCacheItem() ); - // Reparent children of item. + // Retqparent tqchildren of item. TQListViewItem *myParent = removedItem; TQListViewItem *myChild = myParent->firstChild(); TQListViewItem *threadRoot = myParent; - while (threadRoot->parent()) - threadRoot = threadRoot->parent(); + while (threadRoot->tqparent()) + threadRoot = threadRoot->tqparent(); TQString key = static_cast(threadRoot)->key(mSortCol, !mSortDescending); TQPtrList childList; @@ -1148,26 +1148,26 @@ void KMHeaders::msgRemoved(int id, TQString msgId ) TQListViewItem *lvi = *it; HeaderItem *item = static_cast(lvi); SortCacheItem *sci = item->sortCacheItem(); - SortCacheItem *parent = findParent( sci ); - if ( !parent && mSubjThreading ) - parent = findParentBySubject( sci ); + SortCacheItem *tqparent = findParent( sci ); + if ( !tqparent && mSubjThreading ) + tqparent = findParentBySubject( sci ); - Q_ASSERT( !parent || parent->item() != removedItem ); + Q_ASSERT( !tqparent || tqparent->item() != removedItem ); myParent->takeItem(lvi); - if ( parent && parent->item() != item && parent->item() != removedItem ) { - parent->item()->insertItem(lvi); - parent->addSortedChild( sci ); + if ( tqparent && tqparent->item() != item && tqparent->item() != removedItem ) { + tqparent->item()->insertItem(lvi); + tqparent->addSortedChild( sci ); } else { insertItem(lvi); mRoot->addSortedChild( sci ); } - if ((!parent || sci->isImperfectlyThreaded()) - && !mImperfectlyThreadedList.tqcontainsRef(item)) + if ((!tqparent || sci->isImperfectlyThreaded()) + && !mImperfectlyThreadedList.containsRef(item)) mImperfectlyThreadedList.append(item); - if (parent && !sci->isImperfectlyThreaded() - && mImperfectlyThreadedList.tqcontainsRef(item)) + if (tqparent && !sci->isImperfectlyThreaded() + && mImperfectlyThreadedList.containsRef(item)) mImperfectlyThreadedList.removeRef(item); } } @@ -1220,7 +1220,7 @@ void KMHeaders::msgHeaderChanged(KMFolder*, int msgId) //----------------------------------------------------------------------------- -void KMHeaders::setMsgStatus (KMMsgStatus status, bool toggle) +void KMHeaders::setMsgtqStatus (KMMsgtqStatus status, bool toggle) { // kdDebug() << k_funcinfo << endl; SerNumList serNums = selectedVisibleSernums(); @@ -1242,8 +1242,8 @@ TQPtrList KMHeaders::currentThread() const // ...find the top-level item: TQListViewItem *topOfThread = curItem; - while ( topOfThread->parent() ) - topOfThread = topOfThread->parent(); + while ( topOfThread->tqparent() ) + topOfThread = topOfThread->tqparent(); // collect the items in this thread: TQPtrList list; @@ -1254,7 +1254,7 @@ TQPtrList KMHeaders::currentThread() const return list; } -void KMHeaders::setThreadStatus(KMMsgStatus status, bool toggle) +void KMHeaders::setThreadtqStatus(KMMsgtqStatus status, bool toggle) { TQPtrList curThread; @@ -1266,8 +1266,8 @@ void KMHeaders::setThreadStatus(KMMsgStatus status, bool toggle) if (item->isSelected() ) { // ...find the top-level item: TQListViewItem *top = item; - while ( top->parent() ) - top = top->parent(); + while ( top->tqparent() ) + top = top->tqparent(); if (!topOfThreads.tqcontains(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->parent()) { // unGet this msg + if (msg->tqparent()) { // unGet this msg int idx = -1; KMFolder * p = 0; KMMsgDict::instance()->getLocation( msg, &p, &idx ); - assert( p == msg->parent() ); assert( idx >= 0 ); + assert( p == msg->tqparent() ); 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 parent of currentItem(). + // find top-level tqparent of currentItem(). TQListViewItem *item = currentItem(); if ( !item ) return; clearSelection(); item->setSelected( true ); - while ( item->parent() ) - item = item->parent(); + while ( item->tqparent() ) + item = item->tqparent(); HeaderItem * hdrItem = static_cast(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->parent() ) - item = item->parent(); + while ( item->tqparent() ) + item = item->tqparent(); setCurrentMsg( static_cast(item)->msgId() ); } } @@ -1389,7 +1389,7 @@ void KMHeaders::styleChange( TQStyle& oldStyle ) } //----------------------------------------------------------------------------- -void KMHeaders::setFolderInfoStatus () +void KMHeaders::setFolderInfotqStatus () { if ( !mFolder ) return; TQString str; @@ -1403,7 +1403,7 @@ void KMHeaders::setFolderInfoStatus () : i18n( "0 messages" ); // no need for "0 unread" to be added here if ( mFolder->isReadOnly() ) str = i18n("%1 = n messages, m unread.", "%1 Folder is read-only.").arg( str ); - BroadcasStatus::instance()->seStatusMsg(str); + BroadcastqStatus::instance()->seStatusMsg(str); } //----------------------------------------------------------------------------- @@ -1452,7 +1452,7 @@ void KMHeaders::applyFiltersOnMsg() progressItem->updateProgress(); TQString statusMsg = i18n("Filtering message %1 of %2"); statusMsg = statusMsg.arg( msgCount ).arg( msgCountToFilter ); - KPIM::BroadcasStatus::instance()->seStatusMsg( statusMsg ); + KPIM::BroadcastqStatus::instance()->seStatusMsg( statusMsg ); KApplication::kApplication()->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput, 50 ); } @@ -1523,7 +1523,7 @@ void KMHeaders::deleteMsg () this, TQT_SLOT( slotMoveCompleted( KMCommand * ) ) ); command->start(); - BroadcasStatus::instance()->seStatusMsg(""); + BroadcastqStatus::instance()->seStatusMsg(""); // triggerUpdate(); } @@ -1620,7 +1620,7 @@ void KMHeaders::slotMoveCompleted( KMCommand *command ) if ( command->result() == KMCommand::OK ) { // make sure the current item is shown makeHeaderVisible(); - BroadcasStatus::instance()->seStatusMsg( + BroadcastqStatus::instance()->seStatusMsg( deleted ? i18n("Messages deleted successfully.") : i18n("Messages moved successfully") ); } else { /* The move failed or the user canceled it; reset the state of all @@ -1643,10 +1643,10 @@ void KMHeaders::slotMoveCompleted( KMCommand *command ) } triggerUpdate(); if ( command->result() == KMCommand::Failed ) - BroadcasStatus::instance()->seStatusMsg( + BroadcastqStatus::instance()->seStatusMsg( deleted ? i18n("Deleting messages failed.") : i18n("Moving messages failed.") ); else - BroadcasStatus::instance()->seStatusMsg( + BroadcastqStatus::instance()->seStatusMsg( deleted ? i18n("Deleting messages canceled.") : i18n("Moving messages canceled.") ); } mOwner->updateMessageActions(); @@ -1701,7 +1701,7 @@ void KMHeaders::setCurrentMsg(int cur) setSelectionAnchor( currentItem() ); } makeHeaderVisible(); - setFolderInfoStatus(); + setFolderInfotqStatus(); } //----------------------------------------------------------------------------- @@ -1713,8 +1713,8 @@ void KMHeaders::setSelected( TQListViewItem *item, bool selected ) if ( item->isVisible() ) KListView::setSelected( item, selected ); - // If the item is the parent of a closed thread recursively select - // children . + // If the item is the tqparent of a closed thread recursively select + // tqchildren . if ( isThreaded() && !item->isOpen() && item->firstChild() ) { TQListViewItem *nextRoot = item->itemBelow(); TQListViewItemIterator it( item->firstChild() ); @@ -1826,14 +1826,14 @@ void KMHeaders::selectNextMessage() if (lvi && below ) { while (temp) { temp->firstChild(); - temp = temp->parent(); + temp = temp->tqparent(); } lvi->tqrepaint(); /* test to see if we need to unselect messages on back track */ (below->isSelected() ? setSelected(lvi, false) : setSelected(below, true)); setCurrentItem(below); makeHeaderVisible(); - setFolderInfoStatus(); + setFolderInfotqStatus(); } } } @@ -1864,14 +1864,14 @@ void KMHeaders::selectPrevMessage() if (lvi && above) { while (temp) { temp->firstChild(); - temp = temp->parent(); + temp = temp->tqparent(); } lvi->tqrepaint(); /* test to see if we need to unselect messages on back track */ (above->isSelected() ? setSelected(lvi, false) : setSelected(above, true)); setCurrentItem(above); makeHeaderVisible(); - setFolderInfoStatus(); + setFolderInfotqStatus(); } } } @@ -1997,11 +1997,11 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept // first unread item. // // Find the ancestor of the unread item closest to the - // root and recursively sort all of that ancestors children. + // root and recursively sort all of that ancestors tqchildren. if (item) { TQListViewItem *next = item; - while (next->parent()) - next = next->parent(); + while (next->tqparent()) + next = next->tqparent(); next = static_cast(next)->firstChildNonConst(); while (next && (next != item)) if (static_cast(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->parent(); + next = next->tqparent(); if (next == item) break; if (next && next->nextSibling()) { @@ -2135,12 +2135,12 @@ void KMHeaders::highlightMessage(TQListViewItem* lvi, bool markitread) return; } - BroadcasStatus::instance()->seStatusMsg(""); + BroadcastqStatus::instance()->seStatusMsg(""); if (markitread && idx >= 0) setMsgRead(idx); mItems[idx]->irefresh(); mItems[idx]->tqrepaint(); emit selected( msg ); - setFolderInfoStatus(); + setFolderInfotqStatus(); } void KMHeaders::highlightCurrentThread() @@ -2288,9 +2288,9 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e) && ( mPressPos.x() >= header()->cellPos( header()->mapToActual( 0 ) ) ); if ( rootDecoClicked ) { - // Check if our item is the parent of a closed thread and if so, if the root + // Check if our item is the tqparent 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 children, so opening the thread + // the thread. In that case, deselect all tqchildren, so opening the thread // doesn't cause a flicker. if ( !lvi->isOpen() && lvi->firstChild() ) { TQListViewItem *nextRoot = lvi->itemBelow(); @@ -2303,7 +2303,7 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e) // let klistview do it's thing, expanding/collapsing, selection/deselection KListView::contentsMousePressEvent(e); - /* QListView's shift-select selects also invisible items. Until that is + /* TQListView's shift-select selects also invisible items. Until that is fixed, we have to deselect hidden items here manually, so the quick search doesn't mess things up. */ if ( e->state() & ShiftButton ) { @@ -2315,7 +2315,7 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e) } if ( rootDecoClicked ) { - // select the thread's children after closing if the parent is selected + // select the thread's tqchildren after closing if the tqparent is selected if ( lvi && !lvi->isOpen() && lvi->isSelected() ) setSelected( lvi, true ); } @@ -2324,7 +2324,7 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e) if ( lvi != currentItem() ) highlightMessage( lvi ); /* Explicitely set selection state. This is necessary because we want to - * also select all children of closed threads when the parent is selected. */ + * also select all tqchildren of closed threads when the tqparent is selected. */ // unless ctrl tqmask, set selected if it isn't already if ( !( e->state() & ControlButton ) && !wasSelected ) @@ -2344,21 +2344,21 @@ void KMHeaders::contentsMousePressEvent(TQMouseEvent* e) HeaderItem *item = static_cast( lvi ); KMMsgBase *msg = mFolder->getMsgBase(item->msgId()); if ( section == mPaintInfo.flagCol && flagsToggleable ) { - setMsgStatus( KMMsgStatusFlag, true ); + setMsgtqStatus( KMMsgStatusFlag, true ); } else if ( section == mPaintInfo.importantCol && flagsToggleable ) { - setMsgStatus( KMMsgStatusFlag, true ); + setMsgtqStatus( KMMsgStatusFlag, true ); } else if ( section == mPaintInfo.todoCol && flagsToggleable ) { - setMsgStatus( KMMsgStatusTodo, true ); + setMsgtqStatus( KMMsgStatusTodo, true ); } else if ( section == mPaintInfo.watchedIgnoredCol && flagsToggleable ) { if ( msg->isWatched() || msg->isIgnored() ) - setMsgStatus( KMMsgStatusIgnored, true ); + setMsgtqStatus( KMMsgStatusIgnored, true ); else - setMsgStatus( KMMsgStatusWatched, true ); + setMsgtqStatus( KMMsgStatusWatched, true ); } else if ( section == mPaintInfo.statusCol ) { if ( msg->isUnread() || msg->isNew() ) - setMsgStatus( KMMsgStatusRead ); + setMsgtqStatus( KMMsgStatusRead ); else - setMsgStatus( KMMsgStatusUnread ); + setMsgtqStatus( KMMsgStatusUnread ); } } } @@ -2645,7 +2645,7 @@ void KMHeaders::setSorting( int column, bool ascending ) colText = i18n( "Subject" ); if (mPaintInfo.status) - colText = colText + i18n( " (Status)" ); + colText = colText + i18n( " (tqStatus)" ); setColumnText( mPaintInfo.subCol, colText); } KListView::setSorting( column, ascending ); @@ -2660,23 +2660,23 @@ void KMHeaders::setSorting( int column, bool ascending ) //Flatten the list and write it to disk static void internalWriteItem(FILE *sortStream, KMFolder *folder, int msgid, - int parent_id, TQString key, + int tqparent_id, TQString key, bool update_discover=true) { unsigned long msgSerNum; - unsigned long parentSerNum; + unsigned long tqparentSerNum; msgSerNum = KMMsgDict::instance()->getMsgSerNum( folder, msgid ); - if (parent_id >= 0) - parentSerNum = KMMsgDict::instance()->getMsgSerNum( folder, parent_id ) + KMAIL_RESERVED; + if (tqparent_id >= 0) + tqparentSerNum = KMMsgDict::instance()->getMsgSerNum( folder, tqparent_id ) + KMAIL_RESERVED; else - parentSerNum = (unsigned long)(parent_id + KMAIL_RESERVED); + tqparentSerNum = (unsigned long)(tqparent_id + KMAIL_RESERVED); fwrite(&msgSerNum, sizeof(msgSerNum), 1, sortStream); - fwrite(&parentSerNum, sizeof(parentSerNum), 1, sortStream); + fwrite(&tqparentSerNum, sizeof(tqparentSerNum), 1, sortStream); TQ_INT32 len = key.length() * sizeof(TQChar); fwrite(&len, sizeof(len), 1, sortStream); if (len) - fwrite(key.tqunicode(), QMIN(len, KMAIL_MAX_KEY_LEN), 1, sortStream); + fwrite(key.tqunicode(), TQMIN(len, KMAIL_MAX_KEY_LEN), 1, sortStream); if (update_discover) { //update the discovered change count @@ -2768,7 +2768,7 @@ bool KMHeaders::writeSortOrder() KMMsgBase *kmb; while(HeaderItem *i = items.pop()) { - int parent_id = -1; //no parent, top level + int tqparent_id = -1; //no tqparent, top level if (threaded) { kmb = mFolder->getMsgBase( i->msgId() ); assert(kmb); // I have seen 0L come out of this, called from @@ -2781,8 +2781,8 @@ bool KMHeaders::writeSortOrder() p = mSortCacheItems[replymd5]; if (p) - parent_id = p->id(); - // We now have either found a parent, or set it to -1, which means that + tqparent_id = p->id(); + // We now have either found a tqparent, 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 @@ -2790,12 +2790,12 @@ bool KMHeaders::writeSortOrder() if (replymd5.isEmpty() && replyToAuxId.isEmpty() && !kmb->subjectIsPrefixed() ) - parent_id = -2; + tqparent_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 parent for + // their arrival, since it becomes very unlikely that a new tqparent for // them will show up. (Ingo suggests a month.) -till } - internalWriteItem(sortStream, mFolder, i->msgId(), parent_id, + internalWriteItem(sortStream, mFolder, i->msgId(), tqparent_id, i->key(mSortCol, !mSortDescending), false); //double check for magic headers sorted_count++; @@ -2813,9 +2813,9 @@ bool KMHeaders::writeSortOrder() if (sortStream && ferror(sortStream)) { fclose(sortStream); unlink(TQFile::encodeName(sortFile)); - kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl; + kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on tqdevice?)" << endl; kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl; - kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on device?)").arg( sortFile )); + kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on tqdevice?)").arg( sortFile )); } fclose(sortStream); ::rename(TQFile::encodeName(tempName), TQFile::encodeName(sortFile)); @@ -2828,20 +2828,20 @@ void KMHeaders::appendItemToSortFile(HeaderItem *khi) { TQString sortFile = KMAIL_SORT_FILE(mFolder); if(FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+")) { - int parent_id = -1; //no parent, top level + int tqparent_id = -1; //no tqparent, top level if (isThreaded()) { SortCacheItem *sci = khi->sortCacheItem(); KMMsgBase *kmb = mFolder->getMsgBase( khi->msgId() ); - if(sci->parent() && !sci->isImperfectlyThreaded()) - parent_id = sci->parent()->id(); + if(sci->tqparent() && !sci->isImperfectlyThreaded()) + tqparent_id = sci->tqparent()->id(); else if(kmb->replyToIdMD5().isEmpty() && kmb->replyToAuxIdMD5().isEmpty() && !kmb->subjectIsPrefixed()) - parent_id = -2; + tqparent_id = -2; } - internalWriteItem(sortStream, mFolder, khi->msgId(), parent_id, + internalWriteItem(sortStream, mFolder, khi->msgId(), tqparent_id, khi->key(mSortCol, !mSortDescending), false); //update the appended flag FIXME obsolete? @@ -2853,9 +2853,9 @@ void KMHeaders::appendItemToSortFile(HeaderItem *khi) if (sortStream && ferror(sortStream)) { fclose(sortStream); unlink(TQFile::encodeName(sortFile)); - kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl; + kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on tqdevice?)" << endl; kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl; - kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on device?)").arg( sortFile )); + kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on tqdevice?)").arg( sortFile )); } fclose(sortStream); } else { @@ -2872,7 +2872,7 @@ void KMHeaders::dirtySortOrder(int column) // ----------------- void SortCacheItem::updateSortFile( FILE *sortStream, KMFolder *folder, - bool waiting_for_parent, bool update_discover) + bool waiting_for_tqparent, bool update_discover) { if(mSortOffset == -1) { fseek(sortStream, 0, SEEK_END); @@ -2881,12 +2881,12 @@ void SortCacheItem::updateSortFile( FILE *sortStream, KMFolder *folder, fseek(sortStream, mSortOffset, SEEK_SET); } - int parent_id = -1; - if(!waiting_for_parent) { + int tqparent_id = -1; + if(!waiting_for_tqparent) { if(mParent && !isImperfectlyThreaded()) - parent_id = mParent->id(); + tqparent_id = mParent->id(); } - internalWriteItem(sortStream, folder, mId, parent_id, mKey, update_discover); + internalWriteItem(sortStream, folder, mId, tqparent_id, mKey, update_discover); } static bool compare_ascending = false; @@ -2931,9 +2931,9 @@ void KMHeaders::printThreadingTree() } for (int i = 0; i < (int)mItems.size(); ++i) { HeaderItem *item = mItems[i]; - 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; + int tqparentCacheId = item->sortCacheItem()->tqparent()?item->sortCacheItem()->tqparent()->id():0; + kdDebug( 5006 ) << "SortCacheItem: " << item->sortCacheItem()->id() << " tqparent: " << tqparentCacheId << endl; + kdDebug( 5006 ) << "Item: " << item << " sortCache: " << item->sortCacheItem() << " tqparent: " << item->sortCacheItem()->tqparent() << endl; } kdDebug(5006) << endl; } @@ -2962,8 +2962,8 @@ void KMHeaders::buildSubjectThreadingTree( TQMemArray sortCache for(int x = 0; x < mFolder->count(); x++) { // Only a lot items that are now toplevel - if ( sortCache[x]->parent() - && sortCache[x]->parent()->id() != -666 ) continue; + if ( sortCache[x]->tqparent() + && sortCache[x]->tqparent()->id() != -666 ) continue; KMMsgBase *mi = mFolder->getMsgBase(x); TQString subjMD5 = mi->strippedSubjectMD5(); if (subjMD5.isEmpty()) { @@ -2974,7 +2974,7 @@ void KMHeaders::buildSubjectThreadingTree( TQMemArray sortCache /* For each subject, keep a list of items with that subject * (stripped of prefixes) sorted by date. */ - if (!mSubjectLists.find(subjMD5)) + if (!mSubjectLists.tqfind(subjMD5)) mSubjectLists.insert(subjMD5, new TQPtrList()); /* Insertion sort by date. These lists are expected to be very small. * Also, since the messages are roughly ordered by date in the store, @@ -2996,36 +2996,36 @@ void KMHeaders::buildSubjectThreadingTree( TQMemArray sortCache SortCacheItem* KMHeaders::findParent(SortCacheItem *item) { - SortCacheItem *parent = NULL; - if (!item) return parent; + SortCacheItem *tqparent = NULL; + if (!item) return tqparent; 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()) { - parent = mSortCacheItems[replyToIdMD5]; - if (parent) + tqparent = mSortCacheItems[replyToIdMD5]; + if (tqparent) item->setImperfectlyThreaded(false); } - if (!parent) { + if (!tqparent) { // 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 // example, try the list of references, because the second // to last will likely be in this folder. replyToAuxIdMD5 - // tqcontains the second to last one. + // contains the second to last one. TQString ref = msg->replyToAuxIdMD5(); if (!ref.isEmpty()) - parent = mSortCacheItems[ref]; + tqparent = mSortCacheItems[ref]; } - return parent; + return tqparent; } SortCacheItem* KMHeaders::findParentBySubject(SortCacheItem *item) { - SortCacheItem *parent = NULL; - if (!item) return parent; + SortCacheItem *tqparent = NULL; + if (!item) return tqparent; KMMsgBase *msg = mFolder->getMsgBase(item->id()); @@ -3033,31 +3033,31 @@ 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 parent; + return tqparent; TQString replyToIdMD5 = msg->replyToIdMD5(); TQString subjMD5 = msg->strippedSubjectMD5(); if (!subjMD5.isEmpty() && mSubjectLists[subjMD5]) { - /* Iterate over the list of potential parents with the same + /* Iterate over the list of potential tqparents with the same * subject, and take the closest one by date. */ for (TQPtrListIterator it2(*mSubjectLists[subjMD5]); it2.current(); ++it2) { KMMsgBase *mb = mFolder->getMsgBase((*it2)->id()); - if ( !mb ) return parent; + if ( !mb ) return tqparent; // make sure it's not ourselves if ( item == (*it2) ) continue; int delta = msg->date() - mb->date(); // delta == 0 is not allowed, to avoid circular threading // with duplicates. if (delta > 0 ) { - // Don't use parents more than 6 weeks older than us. + // Don't use tqparents more than 6 weeks older than us. if (delta < 3628899) - parent = (*it2); + tqparent = (*it2); break; } } } - return parent; + return tqparent; } bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) @@ -3077,7 +3077,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) bool error = false; //threaded cases - TQPtrList unparented; + TQPtrList untqparented; mImperfectlyThreadedList.clear(); //cleanup @@ -3117,8 +3117,8 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) mSortInfo.ascending = (compare_ascending = ascending); SortCacheItem *item; - unsigned long serNum, parentSerNum; - int id, len, parent, x; + unsigned long serNum, tqparentSerNum; + int id, len, tqparent, x; TQChar *tmp_qchar = 0; int tmp_qchar_len = 0; const int mFolderCount = mFolder->count(); @@ -3131,7 +3131,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) KMFolder *folder; //parse if(!fread(&serNum, sizeof(serNum), 1, sortStream) || //short read means to end - !fread(&parentSerNum, sizeof(parentSerNum), 1, sortStream) || + !fread(&tqparentSerNum, sizeof(tqparentSerNum), 1, sortStream) || !fread(&len, sizeof(len), 1, sortStream)) { break; } @@ -3157,15 +3157,15 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) ++deleted_count; continue; } - if (parentSerNum < KMAIL_RESERVED) { - parent = (int)parentSerNum - KMAIL_RESERVED; + if (tqparentSerNum < KMAIL_RESERVED) { + tqparent = (int)tqparentSerNum - KMAIL_RESERVED; } else { - KMMsgDict::instance()->getLocation(parentSerNum - KMAIL_RESERVED, &folder, &parent); + KMMsgDict::instance()->getLocation(tqparentSerNum - KMAIL_RESERVED, &folder, &tqparent); if (folder != mFolder) - parent = -1; + tqparent = -1; } if ((id < 0) || (id >= mFolderCount) || - (parent < -2) || (parent >= mFolderCount)) { // sanity checking + (tqparent < -2) || (tqparent >= 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 && parent != -2) { - if(parent == -1) { - unparented.append(item); + if (threaded && tqparent != -2) { + if(tqparent == -1) { + untqparented.append(item); mRoot->addUnsortedChild(item); } else { - if( ! sortCache[parent] ) { - sortCache[parent] = new SortCacheItem; + if( ! sortCache[tqparent] ) { + sortCache[tqparent] = new SortCacheItem; } - sortCache[parent]->addUnsortedChild(item); + sortCache[tqparent]->addUnsortedChild(item); } } else { if(x < sorted_count ) @@ -3245,7 +3245,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) sortCache[x] = new SortCacheItem( x, HeaderItem::generate_key( this, msg, &mPaintInfo, sortOrder )); if(threaded) - unparented.append(sortCache[x]); + untqparented.append(sortCache[x]); else mRoot->addUnsortedChild(sortCache[x]); if(sortStream) @@ -3258,21 +3258,21 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) SHOW_TIMER(holes); } - // 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. + // 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. if (threaded) buildThreadingTree( sortCache ); TQPtrList toBeSubjThreaded; - if (threaded && !unparented.isEmpty()) { + if (threaded && !untqparented.isEmpty()) { CREATE_TIMER(reparent); START_TIMER(reparent); - for(TQPtrListIterator it(unparented); it.current(); ++it) { + for(TQPtrListIterator it(untqparented); it.current(); ++it) { SortCacheItem *item = (*it); - SortCacheItem *parent = findParent( item ); - // If we have a parent, make sure it's not ourselves - if ( parent && (parent != (*it)) ) { - parent->addUnsortedChild((*it)); + SortCacheItem *tqparent = findParent( item ); + // If we have a tqparent, make sure it's not ourselves + if ( tqparent && (tqparent != (*it)) ) { + tqparent->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 it(toBeSubjThreaded); it.current(); ++it) { SortCacheItem *item = (*it); - SortCacheItem *parent = findParentBySubject( item ); + SortCacheItem *tqparent = findParentBySubject( item ); - if ( parent ) { - parent->addUnsortedChild((*it)); + if ( tqparent ) { + tqparent->addUnsortedChild((*it)); if(sortStream) (*it)->updateSortFile(sortStream, mFolder); } else { @@ -3321,8 +3321,8 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) qsort(unsorted, unsorted_count, sizeof(SortCacheItem *), //sort compare_SortCacheItem); - /* The sorted list now tqcontains all sorted children of this item, while - * the (aptly named) unsorted array tqcontains all as of yet unsorted + /* The sorted list now contains all sorted tqchildren of this item, while + * the (aptly named) unsorted array contains all as of yet unsorted * ones. It has just been qsorted, so it is in itself sorted. These two * sorted lists are now merged into one. */ for(TQPtrListIterator it(*sorted); @@ -3348,16 +3348,16 @@ 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->parent() != i) //could happen if you reparent + if(new_kci->item() || new_kci->tqparent() != i) //could happen if you reparent continue; if(threaded && i->item()) { - // If the parent is watched or ignored, propagate that to it's - // children + // If the tqparent is watched or ignored, propagate that to it's + // tqchildren if (mFolder->getMsgBase(i->id())->isWatched()) - mFolder->getMsgBase(new_kci->id())->seStatus(KMMsgStatusWatched); + mFolder->getMsgBase(new_kci->id())->setqStatus(KMMsgStatusWatched); if (mFolder->getMsgBase(i->id())->isIgnored()) - mFolder->getMsgBase(new_kci->id())->seStatus(KMMsgStatusIgnored); + mFolder->getMsgBase(new_kci->id())->setqStatus(KMMsgStatusIgnored); khi = new HeaderItem(i->item(), new_kci->id(), new_kci->key()); } else { khi = new HeaderItem(this, new_kci->id(), new_kci->key()); @@ -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 parent. + // reevaluated when a new message arrives which might be a better tqparent. // Important for messages arriving out of order. if (threaded && sortCache[x]->isImperfectlyThreaded()) { mImperfectlyThreadedList.append(sortCache[x]->item()); @@ -3499,7 +3499,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread ) if ( sortStream ) fclose(sortStream); unlink(TQFile::encodeName(sortFile)); - kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl; + kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on tqdevice?)" << endl; kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl; return true; @@ -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()->parent() && ( !it.current()->parent()->isOpen() ) ) { - // the item's parent is closed, don't traverse any more of this subtree - TQListViewItem * lastAncestorWithSiblings = it.current()->parent(); + 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(); // travel towards the root until we find an ancestor with siblings while ( ( lastAncestorWithSiblings->depth() > 0 ) && !lastAncestorWithSiblings->nextSibling() ) - lastAncestorWithSiblings = lastAncestorWithSiblings->parent(); + lastAncestorWithSiblings = lastAncestorWithSiblings->tqparent(); // move the iterator to that ancestor's next sibling it = TQListViewItemIterator( lastAncestorWithSiblings->nextSibling() ); continue; -- cgit v1.2.1