summaryrefslogtreecommitdiffstats
path: root/kmail/kmheaders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmheaders.cpp')
-rw-r--r--kmail/kmheaders.cpp720
1 files changed, 360 insertions, 360 deletions
diff --git a/kmail/kmheaders.cpp b/kmail/kmheaders.cpp
index e2dd439d3..c0e5c4225 100644
--- a/kmail/kmheaders.cpp
+++ b/kmail/kmheaders.cpp
@@ -42,16 +42,16 @@ using namespace KPIM;
#include <klocale.h>
#include <kdebug.h>
-#include <qbuffer.h>
-#include <qeventloop.h>
-#include <qfile.h>
-#include <qheader.h>
-#include <qptrstack.h>
-#include <qptrqueue.h>
-#include <qpainter.h>
-#include <qtextcodec.h>
-#include <qstyle.h>
-#include <qlistview.h>
+#include <tqbuffer.h>
+#include <tqeventloop.h>
+#include <tqfile.h>
+#include <tqheader.h>
+#include <tqptrstack.h>
+#include <tqptrqueue.h>
+#include <tqpainter.h>
+#include <tqtextcodec.h>
+#include <tqstyle.h>
+#include <tqlistview.h>
#include <mimelib/enum.h>
#include <mimelib/field.h>
@@ -62,36 +62,36 @@ using namespace KPIM;
#include "textsource.h"
-QPixmap* KMHeaders::pixNew = 0;
-QPixmap* KMHeaders::pixUns = 0;
-QPixmap* KMHeaders::pixDel = 0;
-QPixmap* KMHeaders::pixRead = 0;
-QPixmap* KMHeaders::pixRep = 0;
-QPixmap* KMHeaders::pixQueued = 0;
-QPixmap* KMHeaders::pixTodo = 0;
-QPixmap* KMHeaders::pixSent = 0;
-QPixmap* KMHeaders::pixFwd = 0;
-QPixmap* KMHeaders::pixFlag = 0;
-QPixmap* KMHeaders::pixWatched = 0;
-QPixmap* KMHeaders::pixIgnored = 0;
-QPixmap* KMHeaders::pixSpam = 0;
-QPixmap* KMHeaders::pixHam = 0;
-QPixmap* KMHeaders::pixFullySigned = 0;
-QPixmap* KMHeaders::pixPartiallySigned = 0;
-QPixmap* KMHeaders::pixUndefinedSigned = 0;
-QPixmap* KMHeaders::pixFullyEncrypted = 0;
-QPixmap* KMHeaders::pixPartiallyEncrypted = 0;
-QPixmap* KMHeaders::pixUndefinedEncrypted = 0;
-QPixmap* KMHeaders::pixEncryptionProblematic = 0;
-QPixmap* KMHeaders::pixSignatureProblematic = 0;
-QPixmap* KMHeaders::pixAttachment = 0;
-QPixmap* KMHeaders::pixReadFwd = 0;
-QPixmap* KMHeaders::pixReadReplied = 0;
-QPixmap* KMHeaders::pixReadFwdReplied = 0;
-
-
-//-----------------------------------------------------------------------------
-KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent,
+TQPixmap* KMHeaders::pixNew = 0;
+TQPixmap* KMHeaders::pixUns = 0;
+TQPixmap* KMHeaders::pixDel = 0;
+TQPixmap* KMHeaders::pixRead = 0;
+TQPixmap* KMHeaders::pixRep = 0;
+TQPixmap* KMHeaders::pixQueued = 0;
+TQPixmap* KMHeaders::pixTodo = 0;
+TQPixmap* KMHeaders::pixSent = 0;
+TQPixmap* KMHeaders::pixFwd = 0;
+TQPixmap* KMHeaders::pixFlag = 0;
+TQPixmap* KMHeaders::pixWatched = 0;
+TQPixmap* KMHeaders::pixIgnored = 0;
+TQPixmap* KMHeaders::pixSpam = 0;
+TQPixmap* KMHeaders::pixHam = 0;
+TQPixmap* KMHeaders::pixFullySigned = 0;
+TQPixmap* KMHeaders::pixPartiallySigned = 0;
+TQPixmap* KMHeaders::pixUndefinedSigned = 0;
+TQPixmap* KMHeaders::pixFullyEncrypted = 0;
+TQPixmap* KMHeaders::pixPartiallyEncrypted = 0;
+TQPixmap* KMHeaders::pixUndefinedEncrypted = 0;
+TQPixmap* KMHeaders::pixEncryptionProblematic = 0;
+TQPixmap* KMHeaders::pixSignatureProblematic = 0;
+TQPixmap* KMHeaders::pixAttachment = 0;
+TQPixmap* KMHeaders::pixReadFwd = 0;
+TQPixmap* KMHeaders::pixReadReplied = 0;
+TQPixmap* KMHeaders::pixReadFwdReplied = 0;
+
+
+//-----------------------------------------------------------------------------
+KMHeaders::KMHeaders(KMMainWidget *aOwner, TQWidget *parent,
const char *name) :
KListView(parent, name)
{
@@ -103,7 +103,7 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent,
noRepaint = false;
getMsgIndex = -1;
mTopItem = 0;
- setSelectionMode( QListView::Extended );
+ setSelectionMode( TQListView::Extended );
setAllColumnsShowFocus( true );
mNested = false;
nestingPolicy = OpenUnread;
@@ -138,7 +138,7 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent,
mPopup->insertItem(i18n("Size"), KPaintInfo::COL_SIZE);
mPopup->insertItem(i18n("Receiver"), KPaintInfo::COL_RECEIVER);
- connect(mPopup, SIGNAL(activated(int)), this, SLOT(slotToggleColumn(int)));
+ connect(mPopup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotToggleColumn(int)));
setShowSortIndicator(true);
setFocusPolicy( WheelFocus );
@@ -146,32 +146,32 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent,
if (!pixmapsLoaded)
{
pixmapsLoaded = true;
- pixNew = new QPixmap( UserIcon( "kmmsgnew" ) );
- pixUns = new QPixmap( UserIcon( "kmmsgunseen" ) );
- pixDel = new QPixmap( UserIcon( "kmmsgdel" ) );
- pixRead = new QPixmap( UserIcon( "kmmsgread" ) );
- pixRep = new QPixmap( UserIcon( "kmmsgreplied" ) );
- pixQueued = new QPixmap( UserIcon( "kmmsgqueued" ) );
- pixTodo = new QPixmap( UserIcon( "kmmsgtodo" ) );
- pixSent = new QPixmap( UserIcon( "kmmsgsent" ) );
- pixFwd = new QPixmap( UserIcon( "kmmsgforwarded" ) );
- pixFlag = new QPixmap( UserIcon( "kmmsgflag" ) );
- pixWatched = new QPixmap( UserIcon( "kmmsgwatched" ) );
- pixIgnored = new QPixmap( UserIcon( "kmmsgignored" ) );
- pixSpam = new QPixmap( UserIcon( "kmmsgspam" ) );
- pixHam = new QPixmap( UserIcon( "kmmsgham" ) );
- pixFullySigned = new QPixmap( UserIcon( "kmmsgfullysigned" ) );
- pixPartiallySigned = new QPixmap( UserIcon( "kmmsgpartiallysigned" ) );
- pixUndefinedSigned = new QPixmap( UserIcon( "kmmsgundefinedsigned" ) );
- pixFullyEncrypted = new QPixmap( UserIcon( "kmmsgfullyencrypted" ) );
- pixPartiallyEncrypted = new QPixmap( UserIcon( "kmmsgpartiallyencrypted" ) );
- pixUndefinedEncrypted = new QPixmap( UserIcon( "kmmsgundefinedencrypted" ) );
- pixEncryptionProblematic = new QPixmap( UserIcon( "kmmsgencryptionproblematic" ) );
- pixSignatureProblematic = new QPixmap( UserIcon( "kmmsgsignatureproblematic" ) );
- pixAttachment = new QPixmap( UserIcon( "kmmsgattachment" ) );
- pixReadFwd = new QPixmap( UserIcon( "kmmsgread_fwd" ) );
- pixReadReplied = new QPixmap( UserIcon( "kmmsgread_replied" ) );
- pixReadFwdReplied = new QPixmap( UserIcon( "kmmsgread_fwd_replied" ) );
+ pixNew = new TQPixmap( UserIcon( "kmmsgnew" ) );
+ pixUns = new TQPixmap( UserIcon( "kmmsgunseen" ) );
+ pixDel = new TQPixmap( UserIcon( "kmmsgdel" ) );
+ pixRead = new TQPixmap( UserIcon( "kmmsgread" ) );
+ pixRep = new TQPixmap( UserIcon( "kmmsgreplied" ) );
+ pixQueued = new TQPixmap( UserIcon( "kmmsgqueued" ) );
+ pixTodo = new TQPixmap( UserIcon( "kmmsgtodo" ) );
+ pixSent = new TQPixmap( UserIcon( "kmmsgsent" ) );
+ pixFwd = new TQPixmap( UserIcon( "kmmsgforwarded" ) );
+ pixFlag = new TQPixmap( UserIcon( "kmmsgflag" ) );
+ pixWatched = new TQPixmap( UserIcon( "kmmsgwatched" ) );
+ pixIgnored = new TQPixmap( UserIcon( "kmmsgignored" ) );
+ pixSpam = new TQPixmap( UserIcon( "kmmsgspam" ) );
+ pixHam = new TQPixmap( UserIcon( "kmmsgham" ) );
+ pixFullySigned = new TQPixmap( UserIcon( "kmmsgfullysigned" ) );
+ pixPartiallySigned = new TQPixmap( UserIcon( "kmmsgpartiallysigned" ) );
+ pixUndefinedSigned = new TQPixmap( UserIcon( "kmmsgundefinedsigned" ) );
+ pixFullyEncrypted = new TQPixmap( UserIcon( "kmmsgfullyencrypted" ) );
+ pixPartiallyEncrypted = new TQPixmap( UserIcon( "kmmsgpartiallyencrypted" ) );
+ pixUndefinedEncrypted = new TQPixmap( UserIcon( "kmmsgundefinedencrypted" ) );
+ pixEncryptionProblematic = new TQPixmap( UserIcon( "kmmsgencryptionproblematic" ) );
+ pixSignatureProblematic = new TQPixmap( UserIcon( "kmmsgsignatureproblematic" ) );
+ pixAttachment = new TQPixmap( UserIcon( "kmmsgattachment" ) );
+ pixReadFwd = new TQPixmap( UserIcon( "kmmsgread_fwd" ) );
+ pixReadReplied = new TQPixmap( UserIcon( "kmmsgread_replied" ) );
+ pixReadFwdReplied = new TQPixmap( UserIcon( "kmmsgread_fwd_replied" ) );
}
header()->setStretchEnabled( false );
@@ -192,25 +192,25 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent,
mPaintInfo.signedCol = addColumn( *pixFullySigned , "", 0 );
mPaintInfo.cryptoCol = addColumn( *pixFullyEncrypted, "", 0 );
- setResizeMode( QListView::NoColumn );
+ setResizeMode( TQListView::NoColumn );
// only the non-optional columns shall be resizeable
header()->setResizeEnabled( true, mPaintInfo.subCol );
header()->setResizeEnabled( true, mPaintInfo.senderCol );
header()->setResizeEnabled( true, mPaintInfo.dateCol );
- connect( this, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint &, int )),
- this, SLOT( rightButtonPressed( QListViewItem*, const QPoint &, int )));
- connect(this, SIGNAL(doubleClicked(QListViewItem*)),
- this,SLOT(selectMessage(QListViewItem*)));
- connect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint &, int )),
+ this, TQT_SLOT( rightButtonPressed( TQListViewItem*, const TQPoint &, int )));
+ connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem*)),
+ this,TQT_SLOT(selectMessage(TQListViewItem*)));
+ connect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
resetCurrentTime();
mSubjectLists.setAutoDelete( true );
mMoveMessages = false;
- connect( this, SIGNAL(selectionChanged()), SLOT(updateActions()) );
+ connect( this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(updateActions()) );
}
@@ -228,11 +228,11 @@ KMHeaders::~KMHeaders ()
}
//-----------------------------------------------------------------------------
-bool KMHeaders::eventFilter ( QObject *o, QEvent *e )
+bool KMHeaders::eventFilter ( TQObject *o, TQEvent *e )
{
- if ( e->type() == QEvent::MouseButtonPress &&
- static_cast<QMouseEvent*>(e)->button() == RightButton &&
- o->isA("QHeader") )
+ if ( e->type() == TQEvent::MouseButtonPress &&
+ static_cast<TQMouseEvent*>(e)->button() == RightButton &&
+ o->isA("TQHeader") )
{
// if we currently only show one of either sender/receiver column
// modify the popup text in the way, that it displays the text of the other of the two
@@ -244,7 +244,7 @@ bool KMHeaders::eventFilter ( QObject *o, QEvent *e )
else
mPopup->changeItem(KPaintInfo::COL_RECEIVER, i18n("Receiver"));
- mPopup->popup( static_cast<QMouseEvent*>(e)->globalPos() );
+ mPopup->popup( static_cast<TQMouseEvent*>(e)->globalPos() );
return true;
}
return KListView::eventFilter(o, e);
@@ -375,7 +375,7 @@ void KMHeaders::slotToggleColumn(int id, int mode)
// if we change the visibility of the receiver column,
// the sender column has to show either the sender or the receiver
if ( static_cast<KPaintInfo::ColumnIds>(id) == KPaintInfo::COL_RECEIVER ) {
- QString colText = i18n( "Sender" );
+ TQString colText = i18n( "Sender" );
if ( mFolder && (mFolder->whoField().lower() == "to") && !mPaintInfo.showReceiver)
colText = i18n( "Receiver" );
setColumnText( mPaintInfo.senderCol, colText );
@@ -387,7 +387,7 @@ void KMHeaders::slotToggleColumn(int id, int mode)
//-----------------------------------------------------------------------------
// Support for backing pixmap
-void KMHeaders::paintEmptyArea( QPainter * p, const QRect & rect )
+void KMHeaders::paintEmptyArea( TQPainter * p, const TQRect & rect )
{
if (mPaintInfo.pixmapOn)
p->drawTiledPixmap( rect.left(), rect.top(), rect.width(), rect.height(),
@@ -398,10 +398,10 @@ void KMHeaders::paintEmptyArea( QPainter * p, const QRect & rect )
p->fillRect( rect, colorGroup().base() );
}
-bool KMHeaders::event(QEvent *e)
+bool KMHeaders::event(TQEvent *e)
{
bool result = KListView::event(e);
- if (e->type() == QEvent::ApplicationPaletteChange)
+ if (e->type() == TQEvent::ApplicationPaletteChange)
{
readColorConfig();
}
@@ -415,20 +415,20 @@ void KMHeaders::readColorConfig (void)
KConfig* config = KMKernel::config();
// Custom/System colors
KConfigGroupSaver saver(config, "Reader");
- QColor c1=QColor(kapp->palette().active().text());
- QColor c2=QColor("red");
- QColor c3=QColor("blue");
- QColor c4=QColor(kapp->palette().active().base());
- QColor c5=QColor(0,0x7F,0);
- QColor c6=QColor(0,0x98,0);
- QColor c7=KGlobalSettings::alternateBackgroundColor();
+ TQColor c1=TQColor(kapp->palette().active().text());
+ TQColor c2=TQColor("red");
+ TQColor c3=TQColor("blue");
+ TQColor c4=TQColor(kapp->palette().active().base());
+ TQColor c5=TQColor(0,0x7F,0);
+ TQColor c6=TQColor(0,0x98,0);
+ TQColor c7=KGlobalSettings::alternateBackgroundColor();
if (!config->readBoolEntry("defaultColors",true)) {
mPaintInfo.colFore = config->readColorEntry("ForegroundColor",&c1);
mPaintInfo.colBack = config->readColorEntry("BackgroundColor",&c4);
- QPalette newPal = kapp->palette();
- newPal.setColor( QColorGroup::Base, mPaintInfo.colBack );
- newPal.setColor( QColorGroup::Text, mPaintInfo.colFore );
+ TQPalette newPal = kapp->palette();
+ newPal.setColor( TQColorGroup::Base, mPaintInfo.colBack );
+ newPal.setColor( TQColorGroup::Text, mPaintInfo.colFore );
setPalette( newPal );
mPaintInfo.colNew = config->readColorEntry("NewMessage",&c2);
mPaintInfo.colUnread = config->readColorEntry("UnreadMessage",&c3);
@@ -439,9 +439,9 @@ void KMHeaders::readColorConfig (void)
else {
mPaintInfo.colFore = c1;
mPaintInfo.colBack = c4;
- QPalette newPal = kapp->palette();
- newPal.setColor( QColorGroup::Base, c4 );
- newPal.setColor( QColorGroup::Text, c1 );
+ TQPalette newPal = kapp->palette();
+ newPal.setColor( TQColorGroup::Base, c4 );
+ newPal.setColor( TQColorGroup::Text, c1 );
setPalette( newPal );
mPaintInfo.colNew = c2;
mPaintInfo.colUnread = c3;
@@ -459,11 +459,11 @@ void KMHeaders::readConfig (void)
// Backing pixmap support
{ // area for config group "Pixmaps"
KConfigGroupSaver saver(config, "Pixmaps");
- QString pixmapFile = config->readEntry("Headers");
+ TQString pixmapFile = config->readEntry("Headers");
mPaintInfo.pixmapOn = false;
if (!pixmapFile.isEmpty()) {
mPaintInfo.pixmapOn = true;
- mPaintInfo.pixmap = QPixmap( pixmapFile );
+ mPaintInfo.pixmap = TQPixmap( pixmapFile );
}
}
@@ -515,7 +515,7 @@ void KMHeaders::readConfig (void)
KConfigGroupSaver saver(config, "Fonts");
if (!(config->readBoolEntry("defaultFonts",true)))
{
- QFont listFont( KGlobalSettings::generalFont() );
+ TQFont listFont( KGlobalSettings::generalFont() );
listFont = config->readFontEntry( "list-font", &listFont );
setFont( listFont );
mNewFont = config->readFontEntry( "list-new-font", &listFont );
@@ -546,7 +546,7 @@ void KMHeaders::reset()
int id = currentItemIndex();
noRepaint = true;
clear();
- QString colText = i18n( "Sender" );
+ TQString colText = i18n( "Sender" );
if ( mFolder && (mFolder->whoField().lower() == "to") && !mPaintInfo.showReceiver)
colText = i18n( "Receiver" );
setColumnText( mPaintInfo.senderCol, colText );
@@ -653,7 +653,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread )
START_TIMER(set_folder);
int id;
- QString str;
+ TQString str;
mSortInfo.fakeSort = 0;
if ( mFolder && static_cast<KMFolder*>(mFolder) == aFolder ) {
@@ -670,28 +670,28 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread )
// from this folder, since it's msg's are about to be deleted.
highlightMessage(0, false);
- disconnect(mFolder, SIGNAL(numUnreadMsgsChanged(KMFolder*)),
- this, SLOT(setFolderInfoStatus()));
+ disconnect(mFolder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)),
+ this, TQT_SLOT(setFolderInfoStatus()));
mFolder->markNewAsUnread();
writeFolderConfig();
- disconnect(mFolder, SIGNAL(msgHeaderChanged(KMFolder*,int)),
- this, SLOT(msgHeaderChanged(KMFolder*,int)));
- disconnect(mFolder, SIGNAL(msgAdded(int)),
- this, SLOT(msgAdded(int)));
- disconnect(mFolder, SIGNAL( msgRemoved( int, QString ) ),
- this, SLOT( msgRemoved( int, QString ) ) );
- disconnect(mFolder, SIGNAL(changed()),
- this, SLOT(msgChanged()));
- disconnect(mFolder, SIGNAL(cleared()),
- this, SLOT(folderCleared()));
- disconnect(mFolder, SIGNAL(expunged( KMFolder* )),
- this, SLOT(folderCleared()));
- disconnect(mFolder, SIGNAL(closed()),
- this, SLOT(folderClosed()));
- disconnect( mFolder, SIGNAL( statusMsg( const QString& ) ),
- BroadcastStatus::instance(), SLOT( setStatusMsg( const QString& ) ) );
- disconnect(mFolder, SIGNAL(viewConfigChanged()), this, SLOT(reset()));
+ disconnect(mFolder, TQT_SIGNAL(msgHeaderChanged(KMFolder*,int)),
+ this, TQT_SLOT(msgHeaderChanged(KMFolder*,int)));
+ disconnect(mFolder, TQT_SIGNAL(msgAdded(int)),
+ this, TQT_SLOT(msgAdded(int)));
+ disconnect(mFolder, TQT_SIGNAL( msgRemoved( int, TQString ) ),
+ this, TQT_SLOT( msgRemoved( int, TQString ) ) );
+ disconnect(mFolder, TQT_SIGNAL(changed()),
+ this, TQT_SLOT(msgChanged()));
+ disconnect(mFolder, TQT_SIGNAL(cleared()),
+ this, TQT_SLOT(folderCleared()));
+ disconnect(mFolder, TQT_SIGNAL(expunged( KMFolder* )),
+ this, TQT_SLOT(folderCleared()));
+ disconnect(mFolder, TQT_SIGNAL(closed()),
+ this, TQT_SLOT(folderClosed()));
+ disconnect( mFolder, TQT_SIGNAL( statusMsg( const TQString& ) ),
+ BroadcastStatus::instance(), TQT_SLOT( setStatusMsg( const TQString& ) ) );
+ disconnect(mFolder, TQT_SIGNAL(viewConfigChanged()), this, TQT_SLOT(reset()));
writeSortOrder();
mFolder->close("kmheaders");
// System folders remain open but we also should write the index from
@@ -708,25 +708,25 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread )
mOwner->messageActions()->replyListAction()->setEnabled( mFolder ?
mFolder->isMailingListEnabled() : false );
if ( mFolder ) {
- connect(mFolder, SIGNAL(msgHeaderChanged(KMFolder*,int)),
- this, SLOT(msgHeaderChanged(KMFolder*,int)));
- connect(mFolder, SIGNAL(msgAdded(int)),
- this, SLOT(msgAdded(int)));
- connect(mFolder, SIGNAL(msgRemoved(int,QString)),
- this, SLOT(msgRemoved(int,QString)));
- connect(mFolder, SIGNAL(changed()),
- this, SLOT(msgChanged()));
- connect(mFolder, SIGNAL(cleared()),
- this, SLOT(folderCleared()));
- connect(mFolder, SIGNAL(expunged( KMFolder* )),
- this, SLOT(folderCleared()));
- connect(mFolder, SIGNAL(closed()),
- this, SLOT(folderClosed()));
- connect(mFolder, SIGNAL(statusMsg(const QString&)),
- BroadcastStatus::instance(), SLOT( setStatusMsg( const QString& ) ) );
- connect(mFolder, SIGNAL(numUnreadMsgsChanged(KMFolder*)),
- this, SLOT(setFolderInfoStatus()));
- connect(mFolder, SIGNAL(viewConfigChanged()), this, SLOT(reset()));
+ connect(mFolder, TQT_SIGNAL(msgHeaderChanged(KMFolder*,int)),
+ this, TQT_SLOT(msgHeaderChanged(KMFolder*,int)));
+ connect(mFolder, TQT_SIGNAL(msgAdded(int)),
+ this, TQT_SLOT(msgAdded(int)));
+ connect(mFolder, TQT_SIGNAL(msgRemoved(int,TQString)),
+ this, TQT_SLOT(msgRemoved(int,TQString)));
+ connect(mFolder, TQT_SIGNAL(changed()),
+ this, TQT_SLOT(msgChanged()));
+ connect(mFolder, TQT_SIGNAL(cleared()),
+ this, TQT_SLOT(folderCleared()));
+ connect(mFolder, TQT_SIGNAL(expunged( KMFolder* )),
+ this, TQT_SLOT(folderCleared()));
+ connect(mFolder, TQT_SIGNAL(closed()),
+ this, TQT_SLOT(folderClosed()));
+ connect(mFolder, TQT_SIGNAL(statusMsg(const TQString&)),
+ BroadcastStatus::instance(), TQT_SLOT( setStatusMsg( const TQString& ) ) );
+ connect(mFolder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)),
+ this, TQT_SLOT(setFolderInfoStatus()));
+ connect(mFolder, TQT_SIGNAL(viewConfigChanged()), this, TQT_SLOT(reset()));
// Not very nice, but if we go from nested to non-nested
// in the folderConfig below then we need to do this otherwise
@@ -762,7 +762,7 @@ void KMHeaders::setFolder( KMFolder *aFolder, bool forceJumpToUnread )
makeHeaderVisible();
setFolderInfoStatus();
- QString colText = i18n( "Sender" );
+ TQString colText = i18n( "Sender" );
if (mFolder && (mFolder->whoField().lower() == "to") && !mPaintInfo.showReceiver)
colText = i18n("Receiver");
setColumnText( mPaintInfo.senderCol, colText);
@@ -795,8 +795,8 @@ void KMHeaders::msgChanged()
int i = topItemIndex();
int cur = currentItemIndex();
if (!isUpdatesEnabled()) return;
- QString msgIdMD5;
- QListViewItem *item = currentItem();
+ TQString msgIdMD5;
+ TQListViewItem *item = currentItem();
HeaderItem *hi = dynamic_cast<HeaderItem*>(item);
if (item && hi) {
// get the msgIdMD5 to compare it later
@@ -806,15 +806,15 @@ void KMHeaders::msgChanged()
}
// if (!isUpdatesEnabled()) return;
// prevent IMAP messages from scrolling to top
- disconnect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ disconnect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
// remember all selected messages
- QValueList<int> curItems = selectedItems();
+ TQValueList<int> curItems = selectedItems();
updateMessageList(); // do not change the selection
// restore the old state, but move up when there are unread message just out of view
HeaderItem *topOfList = mItems[i];
item = firstChild();
- QListViewItem *unreadItem = 0;
+ TQListViewItem *unreadItem = 0;
while(item && item != topOfList) {
KMMsgBase *msg = mFolder->getMsgBase( static_cast<HeaderItem*>(item)->msgId() );
if ( msg->isUnread() || msg->isNew() ) {
@@ -829,8 +829,8 @@ void KMHeaders::msgChanged()
setContentsPos( 0, itemPos( unreadItem ));
setCurrentMsg( cur );
setSelectedByIndex( curItems, true );
- connect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ connect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
// if the current message has changed then emit
// the selected signal to force an update
@@ -877,10 +877,10 @@ void KMHeaders::msgAdded(int id)
mSortCacheItems.resize(mFolder->count()*2);
mSubjectLists.resize(mFolder->count()*2);
}
- QString msgId = mFolder->getMsgBase(id)->msgIdMD5();
+ TQString msgId = mFolder->getMsgBase(id)->msgIdMD5();
if (msgId.isNull())
msgId = "";
- QString replyToId = mFolder->getMsgBase(id)->replyToIdMD5();
+ TQString replyToId = mFolder->getMsgBase(id)->replyToIdMD5();
SortCacheItem *parent = findParent( sci );
if (!parent && mSubjThreading) {
@@ -918,17 +918,17 @@ void KMHeaders::msgAdded(int id)
/* Add to the list of potential parents for subject threading. But only if
* we are top level. */
if (mSubjThreading && parent) {
- QString subjMD5 = mFolder->getMsgBase(id)->strippedSubjectMD5();
+ 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) )
- mSubjectLists.insert(subjMD5, new QPtrList<SortCacheItem>());
+ mSubjectLists.insert(subjMD5, new TQPtrList<SortCacheItem>());
// insertion sort by date. See buildThreadTrees for details.
int p=0;
- for (QPtrListIterator<SortCacheItem> it(*mSubjectLists[subjMD5]);
+ for (TQPtrListIterator<SortCacheItem> it(*mSubjectLists[subjMD5]);
it.current(); ++it) {
KMMsgBase *mb = mFolder->getMsgBase((*it)->id());
if ( mb->date() < mFolder->getMsgBase(id)->date())
@@ -945,11 +945,11 @@ void KMHeaders::msgAdded(int id)
/* In case the current item is taken during reparenting, prevent qlistview
* from selecting some unrelated item as a result of take() emitting
* currentChanged. */
- disconnect( this, SIGNAL(currentChanged(QListViewItem*)),
- this, SLOT(highlightMessage(QListViewItem*)));
+ disconnect( this, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this, TQT_SLOT(highlightMessage(TQListViewItem*)));
if ( !msgId.isEmpty() ) {
- QPtrListIterator<HeaderItem> it(mImperfectlyThreadedList);
+ TQPtrListIterator<HeaderItem> it(mImperfectlyThreadedList);
HeaderItem *cur;
while ( (cur = it.current()) ) {
++it;
@@ -963,7 +963,7 @@ void KMHeaders::msgAdded(int id)
kdDebug(5006) << "otherMsg is NULL !!! tryMe: " << tryMe << endl;
continue;
}
- QString otherId = otherMsg->replyToIdMD5();
+ TQString otherId = otherMsg->replyToIdMD5();
if (msgId != otherId) {
if (msgId != otherMsg->replyToAuxIdMD5())
continue;
@@ -976,8 +976,8 @@ void KMHeaders::msgAdded(int id)
perfectParent = false;
}
}
- QListViewItem *newParent = mItems[id];
- QListViewItem *msg = mItems[tryMe];
+ TQListViewItem *newParent = mItems[id];
+ TQListViewItem *msg = mItems[tryMe];
if (msg->parent())
msg->parent()->takeItem(msg);
@@ -993,8 +993,8 @@ void KMHeaders::msgAdded(int id)
mImperfectlyThreadedList.removeRef (mItems[tryMe]);
// The item was imperfectly thread before, now it's parent
// is there. Update the .sorted file accordingly.
- QString sortFile = KMAIL_SORT_FILE(mFolder);
- FILE *sortStream = fopen(QFile::encodeName(sortFile), "r+");
+ TQString sortFile = KMAIL_SORT_FILE(mFolder);
+ FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+");
if (sortStream) {
mItems[tryMe]->sortCacheItem()->updateSortFile( sortStream, mFolder );
fclose (sortStream);
@@ -1015,7 +1015,7 @@ void KMHeaders::msgAdded(int id)
sci->setItem(hi);
}
if (mSortInfo.fakeSort) {
- QObject::disconnect(header(), SIGNAL(clicked(int)), this, SLOT(dirtySortOrder(int)));
+ TQObject::disconnect(header(), TQT_SIGNAL(clicked(int)), this, TQT_SLOT(dirtySortOrder(int)));
KListView::setSorting(mSortCol, !mSortDescending );
mSortInfo.fakeSort = 0;
}
@@ -1031,8 +1031,8 @@ void KMHeaders::msgAdded(int id)
}
/* restore signal */
- connect( this, SIGNAL(currentChanged(QListViewItem*)),
- this, SLOT(highlightMessage(QListViewItem*)));
+ connect( this, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this, TQT_SLOT(highlightMessage(TQListViewItem*)));
emit msgAddedToListView( hi );
END_TIMER(msgAdded);
@@ -1041,7 +1041,7 @@ void KMHeaders::msgAdded(int id)
//-----------------------------------------------------------------------------
-void KMHeaders::msgRemoved(int id, QString msgId )
+void KMHeaders::msgRemoved(int id, TQString msgId )
{
if (!isUpdatesEnabled()) return;
@@ -1052,8 +1052,8 @@ void KMHeaders::msgRemoved(int id, QString msgId )
* item once this one is removed. Sine we have already selected
* something in prepare/finalizeMove that's counter productive
*/
- disconnect( this, SIGNAL(currentChanged(QListViewItem*)),
- this, SLOT(highlightMessage(QListViewItem*)));
+ disconnect( this, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this, TQT_SLOT(highlightMessage(TQListViewItem*)));
HeaderItem *removedItem = mItems[id];
if (!removedItem) return;
@@ -1078,14 +1078,14 @@ void KMHeaders::msgRemoved(int id, QString msgId )
removedItem->sortCacheItem()->subjectThreadingList()->removeRef( removedItem->sortCacheItem() );
// Reparent children of item.
- QListViewItem *myParent = removedItem;
- QListViewItem *myChild = myParent->firstChild();
- QListViewItem *threadRoot = myParent;
+ TQListViewItem *myParent = removedItem;
+ TQListViewItem *myChild = myParent->firstChild();
+ TQListViewItem *threadRoot = myParent;
while (threadRoot->parent())
threadRoot = threadRoot->parent();
- QString key = static_cast<HeaderItem*>(threadRoot)->key(mSortCol, !mSortDescending);
+ TQString key = static_cast<HeaderItem*>(threadRoot)->key(mSortCol, !mSortDescending);
- QPtrList<QListViewItem> childList;
+ TQPtrList<TQListViewItem> childList;
while (myChild) {
HeaderItem *item = static_cast<HeaderItem*>(myChild);
// Just keep the item at top level, if it will be deleted anyhow
@@ -1100,14 +1100,14 @@ void KMHeaders::msgRemoved(int id, QString msgId )
}
item->setTempKey( key + item->key( mSortCol, !mSortDescending ));
if (mSortInfo.fakeSort) {
- QObject::disconnect(header(), SIGNAL(clicked(int)), this, SLOT(dirtySortOrder(int)));
+ TQObject::disconnect(header(), TQT_SIGNAL(clicked(int)), this, TQT_SLOT(dirtySortOrder(int)));
KListView::setSorting(mSortCol, !mSortDescending );
mSortInfo.fakeSort = 0;
}
}
- for (QPtrListIterator<QListViewItem> it(childList); it.current() ; ++it ) {
- QListViewItem *lvi = *it;
+ for (TQPtrListIterator<TQListViewItem> it(childList); it.current() ; ++it ) {
+ TQListViewItem *lvi = *it;
HeaderItem *item = static_cast<HeaderItem*>(lvi);
SortCacheItem *sci = item->sortCacheItem();
SortCacheItem *parent = findParent( sci );
@@ -1164,8 +1164,8 @@ void KMHeaders::msgRemoved(int id, QString msgId )
}
}
/* restore signal */
- connect( this, SIGNAL(currentChanged(QListViewItem*)),
- this, SLOT(highlightMessage(QListViewItem*)));
+ connect( this, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this, TQT_SLOT(highlightMessage(TQListViewItem*)));
}
@@ -1194,23 +1194,23 @@ void KMHeaders::setMsgStatus (KMMsgStatus status, bool toggle)
}
-QPtrList<QListViewItem> KMHeaders::currentThread() const
+TQPtrList<TQListViewItem> KMHeaders::currentThread() const
{
- if (!mFolder) return QPtrList<QListViewItem>();
+ if (!mFolder) return TQPtrList<TQListViewItem>();
// starting with the current item...
- QListViewItem *curItem = currentItem();
- if (!curItem) return QPtrList<QListViewItem>();
+ TQListViewItem *curItem = currentItem();
+ if (!curItem) return TQPtrList<TQListViewItem>();
// ...find the top-level item:
- QListViewItem *topOfThread = curItem;
+ TQListViewItem *topOfThread = curItem;
while ( topOfThread->parent() )
topOfThread = topOfThread->parent();
// collect the items in this thread:
- QPtrList<QListViewItem> list;
- QListViewItem *topOfNextThread = topOfThread->nextSibling();
- for ( QListViewItemIterator it( topOfThread ) ;
+ TQPtrList<TQListViewItem> list;
+ TQListViewItem *topOfNextThread = topOfThread->nextSibling();
+ for ( TQListViewItemIterator it( topOfThread ) ;
it.current() && it.current() != topOfNextThread ; ++it )
list.append( it.current() );
return list;
@@ -1218,16 +1218,16 @@ QPtrList<QListViewItem> KMHeaders::currentThread() const
void KMHeaders::setThreadStatus(KMMsgStatus status, bool toggle)
{
- QPtrList<QListViewItem> curThread;
+ TQPtrList<TQListViewItem> curThread;
if (mFolder) {
- QPtrList<QListViewItem> topOfThreads;
+ TQPtrList<TQListViewItem> topOfThreads;
// for each selected item...
- for (QListViewItem *item = firstChild(); item; item = item->itemBelow())
+ for (TQListViewItem *item = firstChild(); item; item = item->itemBelow())
if (item->isSelected() ) {
// ...find the top-level item:
- QListViewItem *top = item;
+ TQListViewItem *top = item;
while ( top->parent() )
top = top->parent();
if (!topOfThreads.contains(top)) {
@@ -1236,19 +1236,19 @@ void KMHeaders::setThreadStatus(KMMsgStatus status, bool toggle)
}
// for each thread found...
- for ( QPtrListIterator<QListViewItem> it( topOfThreads ) ;
+ for ( TQPtrListIterator<TQListViewItem> it( topOfThreads ) ;
it.current() ; ++ it ) {
- QListViewItem *top = *it;
+ TQListViewItem *top = *it;
// collect the items in this thread:
- QListViewItem *topOfNextThread = top->nextSibling();
- for ( QListViewItemIterator it( top ) ;
+ TQListViewItem *topOfNextThread = top->nextSibling();
+ for ( TQListViewItemIterator it( top ) ;
it.current() && it.current() != topOfNextThread ; ++it )
curThread.append( it.current() );
}
}
- QPtrListIterator<QListViewItem> it( curThread );
+ TQPtrListIterator<TQListViewItem> it( curThread );
SerNumList serNums;
for ( it.toFirst() ; it.current() ; ++it ) {
@@ -1272,7 +1272,7 @@ int KMHeaders::slotFilterMsg(KMMessage *msg)
int filterResult = kmkernel->filterMgr()->process(msg,KMFilterMgr::Explicit);
if (filterResult == 2) {
// something went horribly wrong (out of space?)
- kmkernel->emergencyExit( i18n("Unable to process messages: " ) + QString::fromLocal8Bit(strerror(errno)));
+ kmkernel->emergencyExit( i18n("Unable to process messages: " ) + TQString::fromLocal8Bit(strerror(errno)));
return 2;
}
if (msg->parent()) { // unGet this msg
@@ -1291,7 +1291,7 @@ void KMHeaders::slotExpandOrCollapseThread( bool expand )
{
if ( !isThreaded() ) return;
// find top-level parent of currentItem().
- QListViewItem *item = currentItem();
+ TQListViewItem *item = currentItem();
if ( !item ) return;
clearSelection();
item->setSelected( true );
@@ -1308,17 +1308,17 @@ void KMHeaders::slotExpandOrCollapseAllThreads( bool expand )
{
if ( !isThreaded() ) return;
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
if( item ) {
clearSelection();
item->setSelected( true );
}
- for ( QListViewItem *item = firstChild() ;
+ for ( TQListViewItem *item = firstChild() ;
item ; item = item->nextSibling() )
static_cast<HeaderItem*>(item)->setOpenRecursive( expand );
if ( !expand ) { // collapse can hide the current item:
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
if( item ) {
while ( item->parent() )
item = item->parent();
@@ -1334,9 +1334,9 @@ void KMHeaders::setStyleDependantFrameWidth()
// set the width of the frame to a reasonable value for the current GUI style
int frameWidth;
if( style().isA("KeramikStyle") )
- frameWidth = style().pixelMetric( QStyle::PM_DefaultFrameWidth ) - 1;
+ frameWidth = style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) - 1;
else
- frameWidth = style().pixelMetric( QStyle::PM_DefaultFrameWidth );
+ frameWidth = style().pixelMetric( TQStyle::PM_DefaultFrameWidth );
if ( frameWidth < 0 )
frameWidth = 0;
if ( frameWidth != lineWidth() )
@@ -1344,7 +1344,7 @@ void KMHeaders::setStyleDependantFrameWidth()
}
//-----------------------------------------------------------------------------
-void KMHeaders::styleChange( QStyle& oldStyle )
+void KMHeaders::styleChange( TQStyle& oldStyle )
{
setStyleDependantFrameWidth();
KListView::styleChange( oldStyle );
@@ -1354,7 +1354,7 @@ void KMHeaders::styleChange( QStyle& oldStyle )
void KMHeaders::setFolderInfoStatus ()
{
if ( !mFolder ) return;
- QString str;
+ TQString str;
const int unread = mFolder->countUnread();
if ( static_cast<KMFolder*>(mFolder) == kmkernel->outboxFolder() )
str = unread ? i18n( "1 unsent", "%n unsent", unread ) : i18n( "0 unsent" );
@@ -1375,13 +1375,13 @@ void KMHeaders::applyFiltersOnMsg()
kmkernel->filterMgr()->atLeastOneOnlineImapFolderTarget()) {
// uses action scheduler
KMFilterMgr::FilterSet set = KMFilterMgr::Explicit;
- QValueList<KMFilter*> filters = kmkernel->filterMgr()->filters();
+ TQValueList<KMFilter*> filters = kmkernel->filterMgr()->filters();
ActionScheduler *scheduler = new ActionScheduler( set, filters, this );
scheduler->setAutoDestruct( true );
int contentX, contentY;
HeaderItem *nextItem = prepareMove( &contentX, &contentY );
- QPtrList<KMMsgBase> msgList = *selectedMsgs(true);
+ TQPtrList<KMMsgBase> msgList = *selectedMsgs(true);
finalizeMove( nextItem, contentX, contentY );
for (KMMsgBase *msg = msgList.first(); msg; msg = msgList.next())
@@ -1391,7 +1391,7 @@ void KMHeaders::applyFiltersOnMsg()
HeaderItem *nextItem = prepareMove( &contentX, &contentY );
//prevent issues with stale message pointers by using serial numbers instead
- QValueList<unsigned long> serNums = KMMsgDict::serNumList( *selectedMsgs() );
+ TQValueList<unsigned long> serNums = KMMsgDict::serNumList( *selectedMsgs() );
if ( serNums.isEmpty() )
return;
@@ -1407,15 +1407,15 @@ void KMHeaders::applyFiltersOnMsg()
i18n( "Filtering messages" ) );
progressItem->setTotalItems( msgCountToFilter );
- for ( QValueList<unsigned long>::ConstIterator it = serNums.constBegin();
+ for ( TQValueList<unsigned long>::ConstIterator it = serNums.constBegin();
it != serNums.constEnd(); ++it ) {
msgCount++;
if ( msgCountToFilter - msgCount < 10 || !( msgCount % 20 ) || msgCount <= 10 ) {
progressItem->updateProgress();
- QString statusMsg = i18n("Filtering message %1 of %2");
+ TQString statusMsg = i18n("Filtering message %1 of %2");
statusMsg = statusMsg.arg( msgCount ).arg( msgCountToFilter );
KPIM::BroadcastStatus::instance()->setStatusMsg( statusMsg );
- KApplication::kApplication()->eventLoop()->processEvents( QEventLoop::ExcludeUserInput, 50 );
+ KApplication::kApplication()->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput, 50 );
}
KMFolder *folder = 0;
@@ -1430,8 +1430,8 @@ void KMHeaders::applyFiltersOnMsg()
msg->setTransferInProgress(true);
if (!msg->isComplete()) {
FolderJob *job = mFolder->createJob(msg);
- connect(job, SIGNAL(messageRetrieved(KMMessage*)),
- this, SLOT(slotFilterMsg(KMMessage*)));
+ connect(job, TQT_SIGNAL(messageRetrieved(KMMessage*)),
+ this, TQT_SLOT(slotFilterMsg(KMMessage*)));
job->start();
} else {
if (slotFilterMsg(msg) == 2)
@@ -1481,8 +1481,8 @@ void KMHeaders::deleteMsg ()
finalizeMove( nextItem, contentX, contentY );
KMCommand *command = new KMDeleteMsgCommand( mFolder, msgList );
- connect( command, SIGNAL( completed( KMCommand * ) ),
- this, SLOT( slotMoveCompleted( KMCommand * ) ) );
+ connect( command, TQT_SIGNAL( completed( KMCommand * ) ),
+ this, TQT_SLOT( slotMoveCompleted( KMCommand * ) ) );
command->start();
BroadcastStatus::instance()->setStatusMsg("");
@@ -1503,10 +1503,10 @@ HeaderItem* KMHeaders::prepareMove( int *contentX, int *contentY )
HeaderItem *ret = 0;
emit maybeDeleting();
- disconnect( this, SIGNAL(currentChanged(QListViewItem*)),
- this, SLOT(highlightMessage(QListViewItem*)));
+ disconnect( this, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this, TQT_SLOT(highlightMessage(TQListViewItem*)));
- QListViewItem *curItem;
+ TQListViewItem *curItem;
HeaderItem *item;
curItem = currentItem();
while (curItem && curItem->isSelected() && curItem->itemBelow())
@@ -1540,8 +1540,8 @@ void KMHeaders::finalizeMove( HeaderItem *item, int contentX, int contentY )
setContentsPos( contentX, contentY );
makeHeaderVisible();
- connect( this, SIGNAL(currentChanged(QListViewItem*)),
- this, SLOT(highlightMessage(QListViewItem*)));
+ connect( this, TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this, TQT_SLOT(highlightMessage(TQListViewItem*)));
}
@@ -1570,8 +1570,8 @@ void KMHeaders::moveMsgToFolder ( KMFolder* destFolder, bool askForConfirmation
finalizeMove( nextItem, contentX, contentY );
KMCommand *command = new KMMoveCommand( destFolder, msgList );
- connect( command, SIGNAL( completed( KMCommand * ) ),
- this, SLOT( slotMoveCompleted( KMCommand * ) ) );
+ connect( command, TQT_SIGNAL( completed( KMCommand * ) ),
+ this, TQT_SLOT( slotMoveCompleted( KMCommand * ) ) );
command->start();
}
@@ -1591,7 +1591,7 @@ void KMHeaders::slotMoveCompleted( KMCommand *command )
* Note: This potentially resets too many items if there is more than one
* move going on. Oh well, I suppose no animals will be harmed.
* */
- for (QListViewItemIterator it(this); it.current(); it++) {
+ for (TQListViewItemIterator it(this); it.current(); it++) {
HeaderItem *item = static_cast<HeaderItem*>(it.current());
if ( item->aboutToBeDeleted() ) {
item->setAboutToBeDeleted ( false );
@@ -1667,7 +1667,7 @@ void KMHeaders::setCurrentMsg(int cur)
}
//-----------------------------------------------------------------------------
-void KMHeaders::setSelected( QListViewItem *item, bool selected )
+void KMHeaders::setSelected( TQListViewItem *item, bool selected )
{
if ( !item )
return;
@@ -1678,8 +1678,8 @@ void KMHeaders::setSelected( QListViewItem *item, bool selected )
// If the item is the parent of a closed thread recursively select
// children .
if ( isThreaded() && !item->isOpen() && item->firstChild() ) {
- QListViewItem *nextRoot = item->itemBelow();
- QListViewItemIterator it( item->firstChild() );
+ TQListViewItem *nextRoot = item->itemBelow();
+ TQListViewItemIterator it( item->firstChild() );
for( ; (*it) != nextRoot; ++it ) {
if ( (*it)->isVisible() )
(*it)->setSelected( selected );
@@ -1687,9 +1687,9 @@ void KMHeaders::setSelected( QListViewItem *item, bool selected )
}
}
-void KMHeaders::setSelectedByIndex( QValueList<int> items, bool selected )
+void KMHeaders::setSelectedByIndex( TQValueList<int> items, bool selected )
{
- for ( QValueList<int>::Iterator it = items.begin(); it != items.end(); ++it )
+ for ( TQValueList<int>::Iterator it = items.begin(); it != items.end(); ++it )
{
if ( ((*it) >= 0) && ((*it) < (int)mItems.size()) )
{
@@ -1701,7 +1701,7 @@ void KMHeaders::setSelectedByIndex( QValueList<int> items, bool selected )
void KMHeaders::clearSelectableAndAboutToBeDeleted( Q_UINT32 serNum )
{
// fugly, but I see no way around it
- for (QListViewItemIterator it(this); it.current(); it++) {
+ for (TQListViewItemIterator it(this); it.current(); it++) {
HeaderItem *item = static_cast<HeaderItem*>(it.current());
if ( item->aboutToBeDeleted() ) {
KMMsgBase *msgBase = mFolder->getMsgBase( item->msgId() );
@@ -1718,7 +1718,7 @@ void KMHeaders::clearSelectableAndAboutToBeDeleted( Q_UINT32 serNum )
KMMessageList* KMHeaders::selectedMsgs(bool toBeDeleted)
{
mSelMsgBaseList.clear();
- for (QListViewItemIterator it(this); it.current(); it++) {
+ for (TQListViewItemIterator it(this); it.current(); it++) {
if ( it.current()->isSelected() && it.current()->isVisible() ) {
HeaderItem *item = static_cast<HeaderItem*>(it.current());
if ( !item->aboutToBeDeleted() ) { // we are already working on this one
@@ -1736,10 +1736,10 @@ KMMessageList* KMHeaders::selectedMsgs(bool toBeDeleted)
}
//-----------------------------------------------------------------------------
-QValueList<int> KMHeaders::selectedItems()
+TQValueList<int> KMHeaders::selectedItems()
{
- QValueList<int> items;
- for ( QListViewItemIterator it(this); it.current(); it++ )
+ TQValueList<int> items;
+ for ( TQListViewItemIterator it(this); it.current(); it++ )
{
if ( it.current()->isSelected() && it.current()->isVisible() )
{
@@ -1754,7 +1754,7 @@ QValueList<int> KMHeaders::selectedItems()
int KMHeaders::firstSelectedMsg() const
{
int selectedMsg = -1;
- QListViewItem *item;
+ TQListViewItem *item;
for (item = firstChild(); item; item = item->itemBelow())
if (item->isSelected()) {
selectedMsg = (static_cast<HeaderItem*>(item))->msgId();
@@ -1766,7 +1766,7 @@ int KMHeaders::firstSelectedMsg() const
//-----------------------------------------------------------------------------
void KMHeaders::nextMessage()
{
- QListViewItem *lvi = currentItem();
+ TQListViewItem *lvi = currentItem();
if (lvi && lvi->itemBelow()) {
clearSelection();
setSelected( lvi, false );
@@ -1781,10 +1781,10 @@ void KMHeaders::selectNextMessage()
KMMessage *cm = currentMsg();
if ( cm && cm->isBeingParsed() )
return;
- QListViewItem *lvi = currentItem();
+ TQListViewItem *lvi = currentItem();
if( lvi ) {
- QListViewItem *below = lvi->itemBelow();
- QListViewItem *temp = lvi;
+ TQListViewItem *below = lvi->itemBelow();
+ TQListViewItem *temp = lvi;
if (lvi && below ) {
while (temp) {
temp->firstChild();
@@ -1803,7 +1803,7 @@ void KMHeaders::selectNextMessage()
//-----------------------------------------------------------------------------
void KMHeaders::prevMessage()
{
- QListViewItem *lvi = currentItem();
+ TQListViewItem *lvi = currentItem();
if (lvi && lvi->itemAbove()) {
clearSelection();
setSelected( lvi, false );
@@ -1818,10 +1818,10 @@ void KMHeaders::selectPrevMessage()
KMMessage *cm = currentMsg();
if ( cm && cm->isBeingParsed() )
return;
- QListViewItem *lvi = currentItem();
+ TQListViewItem *lvi = currentItem();
if( lvi ) {
- QListViewItem *above = lvi->itemAbove();
- QListViewItem *temp = lvi;
+ TQListViewItem *above = lvi->itemAbove();
+ TQListViewItem *temp = lvi;
if (lvi && above) {
while (temp) {
@@ -1844,16 +1844,16 @@ void KMHeaders::incCurrentMessage()
KMMessage *cm = currentMsg();
if ( cm && cm->isBeingParsed() )
return;
- QListViewItem *lvi = currentItem();
+ TQListViewItem *lvi = currentItem();
if ( lvi && lvi->itemBelow() ) {
- disconnect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ disconnect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
setCurrentItem( lvi->itemBelow() );
ensureCurrentItemVisible();
setFocus();
- connect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ connect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
}
}
@@ -1862,15 +1862,15 @@ void KMHeaders::decCurrentMessage()
KMMessage *cm = currentMsg();
if ( cm && cm->isBeingParsed() )
return;
- QListViewItem *lvi = currentItem();
+ TQListViewItem *lvi = currentItem();
if ( lvi && lvi->itemAbove() ) {
- disconnect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ disconnect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
setCurrentItem( lvi->itemAbove() );
ensureCurrentItemVisible();
setFocus();
- connect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ connect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
}
}
@@ -1958,7 +1958,7 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept
// Find the ancestor of the unread item closest to the
// root and recursively sort all of that ancestors children.
if (item) {
- QListViewItem *next = item;
+ TQListViewItem *next = item;
while (next->parent())
next = next->parent();
next = static_cast<HeaderItem*>(next)->firstChildNonConst();
@@ -2062,7 +2062,7 @@ void KMHeaders::makeHeaderVisible()
}
//-----------------------------------------------------------------------------
-void KMHeaders::highlightMessage(QListViewItem* lvi, bool markitread)
+void KMHeaders::highlightMessage(TQListViewItem* lvi, bool markitread)
{
// shouldnt happen but will crash if it does
if (lvi && !lvi->isSelectable()) return;
@@ -2104,11 +2104,11 @@ void KMHeaders::highlightMessage(QListViewItem* lvi, bool markitread)
void KMHeaders::highlightCurrentThread()
{
- QPtrList<QListViewItem> curThread = currentThread();
- QPtrListIterator<QListViewItem> it( curThread );
+ TQPtrList<TQListViewItem> curThread = currentThread();
+ TQPtrListIterator<TQListViewItem> it( curThread );
for ( it.toFirst() ; it.current() ; ++it ) {
- QListViewItem *lvi = *it;
+ TQListViewItem *lvi = *it;
lvi->setSelected( true );
lvi->repaint();
}
@@ -2118,12 +2118,12 @@ void KMHeaders::resetCurrentTime()
{
mDate.reset();
// only reset exactly during minute switch
- QTimer::singleShot( ( 60-QTime::currentTime().second() ) * 1000,
- this, SLOT( resetCurrentTime() ) );
+ TQTimer::singleShot( ( 60-TQTime::currentTime().second() ) * 1000,
+ this, TQT_SLOT( resetCurrentTime() ) );
}
//-----------------------------------------------------------------------------
-void KMHeaders::selectMessage(QListViewItem* lvi)
+void KMHeaders::selectMessage(TQListViewItem* lvi)
{
HeaderItem *item = static_cast<HeaderItem*>(lvi);
if (!item)
@@ -2175,11 +2175,11 @@ void KMHeaders::updateMessageList( bool set_selection, bool forceJumpToUnread )
//
// Exception: When shift selecting either with mouse or key press the reader
// window is updated regardless of whether of not the selection has changed.
-void KMHeaders::keyPressEvent( QKeyEvent * e )
+void KMHeaders::keyPressEvent( TQKeyEvent * e )
{
bool cntrl = (e->state() & ControlButton );
bool shft = (e->state() & ShiftButton );
- QListViewItem *cur = currentItem();
+ TQListViewItem *cur = currentItem();
if (!e || !firstChild())
return;
@@ -2200,8 +2200,8 @@ void KMHeaders::keyPressEvent( QKeyEvent * e )
if (cntrl) {
if (!shft)
- disconnect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ disconnect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
switch (e->key()) {
case Key_Down:
case Key_Up:
@@ -2213,14 +2213,14 @@ void KMHeaders::keyPressEvent( QKeyEvent * e )
KListView::keyPressEvent( e );
}
if (!shft)
- connect(this,SIGNAL(currentChanged(QListViewItem*)),
- this,SLOT(highlightMessage(QListViewItem*)));
+ connect(this,TQT_SIGNAL(currentChanged(TQListViewItem*)),
+ this,TQT_SLOT(highlightMessage(TQListViewItem*)));
}
}
//-----------------------------------------------------------------------------
// Handle RMB press, show pop up menu
-void KMHeaders::rightButtonPressed( QListViewItem *lvi, const QPoint &, int )
+void KMHeaders::rightButtonPressed( TQListViewItem *lvi, const TQPoint &, int )
{
if (!lvi)
return;
@@ -2233,10 +2233,10 @@ void KMHeaders::rightButtonPressed( QListViewItem *lvi, const QPoint &, int )
}
//-----------------------------------------------------------------------------
-void KMHeaders::contentsMousePressEvent(QMouseEvent* e)
+void KMHeaders::contentsMousePressEvent(TQMouseEvent* e)
{
mPressPos = e->pos();
- QListViewItem *lvi = itemAt( contentsToViewport( e->pos() ));
+ TQListViewItem *lvi = itemAt( contentsToViewport( e->pos() ));
bool wasSelected = false;
bool rootDecoClicked = false;
if (lvi) {
@@ -2252,8 +2252,8 @@ void KMHeaders::contentsMousePressEvent(QMouseEvent* e)
// the thread. In that case, deselect all children, so opening the thread
// doesn't cause a flicker.
if ( !lvi->isOpen() && lvi->firstChild() ) {
- QListViewItem *nextRoot = lvi->itemBelow();
- QListViewItemIterator it( lvi->firstChild() );
+ TQListViewItem *nextRoot = lvi->itemBelow();
+ TQListViewItemIterator it( lvi->firstChild() );
for( ; (*it) != nextRoot; ++it )
(*it)->setSelected( false );
}
@@ -2266,7 +2266,7 @@ void KMHeaders::contentsMousePressEvent(QMouseEvent* e)
fixed, we have to deselect hidden items here manually, so the quick
search doesn't mess things up. */
if ( e->state() & ShiftButton ) {
- QListViewItemIterator it( this, QListViewItemIterator::Invisible );
+ TQListViewItemIterator it( this, TQListViewItemIterator::Invisible );
while ( it.current() ) {
it.current()->setSelected( false );
++it;
@@ -2323,7 +2323,7 @@ void KMHeaders::contentsMousePressEvent(QMouseEvent* e)
}
//-----------------------------------------------------------------------------
-void KMHeaders::contentsMouseReleaseEvent(QMouseEvent* e)
+void KMHeaders::contentsMouseReleaseEvent(TQMouseEvent* e)
{
if (e->button() != RightButton)
KListView::contentsMouseReleaseEvent(e);
@@ -2332,16 +2332,16 @@ void KMHeaders::contentsMouseReleaseEvent(QMouseEvent* e)
}
//-----------------------------------------------------------------------------
-void KMHeaders::contentsMouseMoveEvent( QMouseEvent* e )
+void KMHeaders::contentsMouseMoveEvent( TQMouseEvent* e )
{
if (mMousePressed &&
(e->pos() - mPressPos).manhattanLength() > KGlobalSettings::dndEventDelay()) {
mMousePressed = false;
- QListViewItem *item = itemAt( contentsToViewport(mPressPos) );
+ TQListViewItem *item = itemAt( contentsToViewport(mPressPos) );
if ( item ) {
MailList mailList;
unsigned int count = 0;
- for( QListViewItemIterator it(this); it.current(); it++ )
+ for( TQListViewItemIterator it(this); it.current(); it++ )
if( it.current()->isSelected() ) {
HeaderItem *item = static_cast<HeaderItem*>(it.current());
KMMsgBase *msg = mFolder->getMsgBase(item->msgId());
@@ -2356,15 +2356,15 @@ void KMHeaders::contentsMouseMoveEvent( QMouseEvent* e )
MailListDrag *d = new MailListDrag( mailList, viewport(), new KMTextSource );
// Set pixmap
- QPixmap pixmap;
+ TQPixmap pixmap;
if( count == 1 )
- pixmap = QPixmap( DesktopIcon("message", KIcon::SizeSmall) );
+ pixmap = TQPixmap( DesktopIcon("message", KIcon::SizeSmall) );
else
- pixmap = QPixmap( DesktopIcon("kmultiple", KIcon::SizeSmall) );
+ pixmap = TQPixmap( DesktopIcon("kmultiple", KIcon::SizeSmall) );
// Calculate hotspot (as in Konqueror)
if( !pixmap.isNull() ) {
- QPoint hotspot( pixmap.width() / 2, pixmap.height() / 2 );
+ TQPoint hotspot( pixmap.width() / 2, pixmap.height() / 2 );
d->setPixmap( pixmap, hotspot );
}
if ( mFolder->isReadOnly() )
@@ -2375,7 +2375,7 @@ void KMHeaders::contentsMouseMoveEvent( QMouseEvent* e )
}
}
-void KMHeaders::highlightMessage(QListViewItem* i)
+void KMHeaders::highlightMessage(TQListViewItem* i)
{
highlightMessage( i, false );
}
@@ -2387,21 +2387,21 @@ void KMHeaders::slotRMB()
mOwner->updateMessageActions();
// check if the user clicked into a status column and only show the respective menues
- QListViewItem *item = itemAt( viewport()->mapFromGlobal( QCursor::pos() ) );
+ TQListViewItem *item = itemAt( viewport()->mapFromGlobal( TQCursor::pos() ) );
if ( item ) {
- int section = header()->sectionAt( viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) ).x() );
+ int section = header()->sectionAt( viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) ).x() );
if ( section == mPaintInfo.flagCol || section == mPaintInfo.importantCol
|| section == mPaintInfo.todoCol || section == mPaintInfo.statusCol ) {
- mOwner->statusMenu()->popup( QCursor::pos() );
+ mOwner->statusMenu()->popup( TQCursor::pos() );
return;
}
if ( section == mPaintInfo.watchedIgnoredCol ) {
- mOwner->threadStatusMenu()->popup( QCursor::pos() );
+ mOwner->threadStatusMenu()->popup( TQCursor::pos() );
return;
}
}
- QPopupMenu *menu = new QPopupMenu(this);
+ TQPopupMenu *menu = new TQPopupMenu(this);
mMenuToFolder.clear();
@@ -2425,7 +2425,7 @@ void KMHeaders::slotRMB()
}
menu->insertSeparator();
- QPopupMenu *msgCopyMenu = new QPopupMenu(menu);
+ TQPopupMenu *msgCopyMenu = new TQPopupMenu(menu);
mOwner->folderTree()->folderToPopupMenu( KMFolderTree::CopyMessage, this,
&mMenuToFolder, msgCopyMenu );
menu->insertItem(i18n("&Copy To"), msgCopyMenu);
@@ -2434,7 +2434,7 @@ void KMHeaders::slotRMB()
int id = menu->insertItem( i18n("&Move To") );
menu->setItemEnabled( id, false );
} else {
- QPopupMenu *msgMoveMenu = new QPopupMenu(menu);
+ TQPopupMenu *msgMoveMenu = new TQPopupMenu(menu);
mOwner->folderTree()->folderToPopupMenu( KMFolderTree::MoveMessage, this,
&mMenuToFolder, msgMoveMenu );
menu->insertItem(i18n("&Move To"), msgMoveMenu);
@@ -2470,7 +2470,7 @@ void KMHeaders::slotRMB()
KAcceleratorManager::manage(menu);
kmkernel->setContextMenuShown( true );
- menu->exec(QCursor::pos(), 0);
+ menu->exec(TQCursor::pos(), 0);
kmkernel->setContextMenuShown( false );
delete menu;
}
@@ -2521,7 +2521,7 @@ void KMHeaders::setCurrentItemByIndex(int msgIdx)
//-----------------------------------------------------------------------------
int KMHeaders::topItemIndex()
{
- HeaderItem *item = static_cast<HeaderItem*>( itemAt( QPoint( 1, 1 ) ) );
+ HeaderItem *item = static_cast<HeaderItem*>( itemAt( TQPoint( 1, 1 ) ) );
if ( item )
return item->msgId();
else
@@ -2533,7 +2533,7 @@ void KMHeaders::setTopItemByIndex( int aMsgIdx)
{
if ( aMsgIdx < 0 || static_cast<unsigned int>( aMsgIdx ) >= mItems.size() )
return;
- const QListViewItem * const item = mItems[aMsgIdx];
+ const TQListViewItem * const item = mItems[aMsgIdx];
if ( item )
setContentsPos( 0, itemPos( item ) );
}
@@ -2545,8 +2545,8 @@ void KMHeaders::setNestedOverride( bool override )
mNestedOverride = override;
setRootIsDecorated( nestingPolicy != AlwaysOpen
&& isThreaded() );
- QString sortFile = mFolder->indexLocation() + ".sorted";
- unlink(QFile::encodeName(sortFile));
+ TQString sortFile = mFolder->indexLocation() + ".sorted";
+ unlink(TQFile::encodeName(sortFile));
reset();
}
@@ -2555,20 +2555,20 @@ void KMHeaders::setSubjectThreading( bool aSubjThreading )
{
mSortInfo.dirty = true;
mSubjThreading = aSubjThreading;
- QString sortFile = mFolder->indexLocation() + ".sorted";
- unlink(QFile::encodeName(sortFile));
+ TQString sortFile = mFolder->indexLocation() + ".sorted";
+ unlink(TQFile::encodeName(sortFile));
reset();
}
//-----------------------------------------------------------------------------
-void KMHeaders::setOpen( QListViewItem *item, bool open )
+void KMHeaders::setOpen( TQListViewItem *item, bool open )
{
if ((nestingPolicy != AlwaysOpen)|| open)
((HeaderItem*)item)->setOpenRecursive( open );
}
//-----------------------------------------------------------------------------
-const KMMsgBase* KMHeaders::getMsgBaseForItem( const QListViewItem *item ) const
+const KMMsgBase* KMHeaders::getMsgBaseForItem( const TQListViewItem *item ) const
{
const HeaderItem *hi = static_cast<const HeaderItem *> ( item );
return mFolder->getMsgBase( hi->msgId() );
@@ -2580,9 +2580,9 @@ void KMHeaders::setSorting( int column, bool ascending )
if (column != -1) {
// carsten: really needed?
// if (column != mSortCol)
-// setColumnText( mSortCol, QIconSet( QPixmap()), columnText( mSortCol ));
+// setColumnText( mSortCol, TQIconSet( TQPixmap()), columnText( mSortCol ));
if(mSortInfo.dirty || column != mSortInfo.column || ascending != mSortInfo.ascending) { //dirtied
- QObject::disconnect(header(), SIGNAL(clicked(int)), this, SLOT(dirtySortOrder(int)));
+ TQObject::disconnect(header(), TQT_SIGNAL(clicked(int)), this, TQT_SLOT(dirtySortOrder(int)));
mSortInfo.dirty = true;
}
@@ -2596,7 +2596,7 @@ void KMHeaders::setSorting( int column, bool ascending )
if (!ascending && (column == mPaintInfo.subCol))
mPaintInfo.status = !mPaintInfo.status;
- QString colText = i18n( "Date" );
+ TQString colText = i18n( "Date" );
if (mPaintInfo.orderOfArrival)
colText = i18n( "Order of Arrival" );
setColumnText( mPaintInfo.dateCol, colText);
@@ -2618,7 +2618,7 @@ 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, QString key,
+ int parent_id, TQString key,
bool update_discover=true)
{
unsigned long msgSerNum;
@@ -2631,7 +2631,7 @@ static void internalWriteItem(FILE *sortStream, KMFolder *folder, int msgid,
fwrite(&msgSerNum, sizeof(msgSerNum), 1, sortStream);
fwrite(&parentSerNum, sizeof(parentSerNum), 1, sortStream);
- Q_INT32 len = key.length() * sizeof(QChar);
+ Q_INT32 len = key.length() * sizeof(TQChar);
fwrite(&len, sizeof(len), 1, sortStream);
if (len)
fwrite(key.unicode(), QMIN(len, KMAIL_MAX_KEY_LEN), 1, sortStream);
@@ -2665,23 +2665,23 @@ void KMHeaders::folderClosed()
bool KMHeaders::writeSortOrder()
{
- QString sortFile = KMAIL_SORT_FILE(mFolder);
+ TQString sortFile = KMAIL_SORT_FILE(mFolder);
if (!mSortInfo.dirty) {
struct stat stat_tmp;
- if(stat(QFile::encodeName(sortFile), &stat_tmp) == -1) {
+ if(stat(TQFile::encodeName(sortFile), &stat_tmp) == -1) {
mSortInfo.dirty = true;
}
}
if (mSortInfo.dirty) {
if (!mFolder->count()) {
// Folder is empty now, remove the sort file.
- unlink(QFile::encodeName(sortFile));
+ unlink(TQFile::encodeName(sortFile));
return true;
}
- QString tempName = sortFile + ".temp";
- unlink(QFile::encodeName(tempName));
- FILE *sortStream = fopen(QFile::encodeName(tempName), "w");
+ TQString tempName = sortFile + ".temp";
+ unlink(TQFile::encodeName(tempName));
+ FILE *sortStream = fopen(TQFile::encodeName(tempName), "w");
if (!sortStream)
return false;
@@ -2705,10 +2705,10 @@ bool KMHeaders::writeSortOrder()
fwrite(&discovered_count, sizeof(discovered_count), 1, sortStream);
fwrite(&sorted_count, sizeof(sorted_count), 1, sortStream);
- QPtrStack<HeaderItem> items;
+ TQPtrStack<HeaderItem> items;
{
- QPtrStack<QListViewItem> s;
- for (QListViewItem * i = firstChild(); i; ) {
+ TQPtrStack<TQListViewItem> s;
+ for (TQListViewItem * i = firstChild(); i; ) {
items.push((HeaderItem *)i);
if ( i->firstChild() ) {
s.push( i );
@@ -2730,8 +2730,8 @@ bool KMHeaders::writeSortOrder()
assert(kmb); // I have seen 0L come out of this, called from
// KMHeaders::setFolder(0xgoodpointer, false);
// I see this crash too. after rebuilding a broken index on a dimap folder. always
- QString replymd5 = kmb->replyToIdMD5();
- QString replyToAuxId = kmb->replyToAuxIdMD5();
+ TQString replymd5 = kmb->replyToIdMD5();
+ TQString replyToAuxId = kmb->replyToAuxIdMD5();
SortCacheItem *p = NULL;
if(!replymd5.isEmpty())
p = mSortCacheItems[replymd5];
@@ -2768,13 +2768,13 @@ bool KMHeaders::writeSortOrder()
fwrite(&sorted_count, sizeof(sorted_count), 1, sortStream);
if (sortStream && ferror(sortStream)) {
fclose(sortStream);
- unlink(QFile::encodeName(sortFile));
+ unlink(TQFile::encodeName(sortFile));
kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl;
kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl;
kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on device?)").arg( sortFile ));
}
fclose(sortStream);
- ::rename(QFile::encodeName(tempName), QFile::encodeName(sortFile));
+ ::rename(TQFile::encodeName(tempName), TQFile::encodeName(sortFile));
}
return true;
@@ -2782,8 +2782,8 @@ bool KMHeaders::writeSortOrder()
void KMHeaders::appendItemToSortFile(HeaderItem *khi)
{
- QString sortFile = KMAIL_SORT_FILE(mFolder);
- if(FILE *sortStream = fopen(QFile::encodeName(sortFile), "r+")) {
+ TQString sortFile = KMAIL_SORT_FILE(mFolder);
+ if(FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+")) {
int parent_id = -1; //no parent, top level
if (isThreaded()) {
@@ -2808,7 +2808,7 @@ void KMHeaders::appendItemToSortFile(HeaderItem *khi)
if (sortStream && ferror(sortStream)) {
fclose(sortStream);
- unlink(QFile::encodeName(sortFile));
+ unlink(TQFile::encodeName(sortFile));
kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl;
kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl;
kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on device?)").arg( sortFile ));
@@ -2822,7 +2822,7 @@ void KMHeaders::appendItemToSortFile(HeaderItem *khi)
void KMHeaders::dirtySortOrder(int column)
{
mSortInfo.dirty = true;
- QObject::disconnect(header(), SIGNAL(clicked(int)), this, SLOT(dirtySortOrder(int)));
+ TQObject::disconnect(header(), TQT_SIGNAL(clicked(int)), this, TQT_SLOT(dirtySortOrder(int)));
setSorting(column, mSortInfo.column == column ? !mSortInfo.ascending : true);
}
@@ -2862,11 +2862,11 @@ static int compare_SortCacheItem(const void *s1, const void *s2)
// Debugging helpers
void KMHeaders::printSubjectThreadingTree()
{
- QDictIterator< QPtrList< SortCacheItem > > it ( mSubjectLists );
+ TQDictIterator< TQPtrList< SortCacheItem > > it ( mSubjectLists );
kdDebug(5006) << "SubjectThreading tree: " << endl;
for( ; it.current(); ++it ) {
- QPtrList<SortCacheItem> list = *( it.current() );
- QPtrListIterator<SortCacheItem> it2( list ) ;
+ TQPtrList<SortCacheItem> list = *( it.current() );
+ TQPtrListIterator<SortCacheItem> it2( list ) ;
kdDebug(5006) << "Subject MD5: " << it.currentKey() << " list: " << endl;
for( ; it2.current(); ++it2 ) {
SortCacheItem *sci = it2.current();
@@ -2879,7 +2879,7 @@ void KMHeaders::printSubjectThreadingTree()
void KMHeaders::printThreadingTree()
{
kdDebug(5006) << "Threading tree: " << endl;
- QDictIterator<SortCacheItem> it( mSortCacheItems );
+ TQDictIterator<SortCacheItem> it( mSortCacheItems );
kdDebug(5006) << endl;
for( ; it.current(); ++it ) {
SortCacheItem *sci = it.current();
@@ -2896,7 +2896,7 @@ void KMHeaders::printThreadingTree()
// -------------------------------------
-void KMHeaders::buildThreadingTree( QMemArray<SortCacheItem *> sortCache )
+void KMHeaders::buildThreadingTree( TQMemArray<SortCacheItem *> sortCache )
{
mSortCacheItems.clear();
mSortCacheItems.resize( mFolder->count() * 2 );
@@ -2904,14 +2904,14 @@ void KMHeaders::buildThreadingTree( QMemArray<SortCacheItem *> sortCache )
// build a dict of all message id's
for(int x = 0; x < mFolder->count(); x++) {
KMMsgBase *mi = mFolder->getMsgBase(x);
- QString md5 = mi->msgIdMD5();
+ TQString md5 = mi->msgIdMD5();
if(!md5.isEmpty())
mSortCacheItems.replace(md5, sortCache[x]);
}
}
-void KMHeaders::buildSubjectThreadingTree( QMemArray<SortCacheItem *> sortCache )
+void KMHeaders::buildSubjectThreadingTree( TQMemArray<SortCacheItem *> sortCache )
{
mSubjectLists.clear(); // autoDelete is true
mSubjectLists.resize( mFolder->count() * 2 );
@@ -2921,7 +2921,7 @@ void KMHeaders::buildSubjectThreadingTree( QMemArray<SortCacheItem *> sortCache
if ( sortCache[x]->parent()
&& sortCache[x]->parent()->id() != -666 ) continue;
KMMsgBase *mi = mFolder->getMsgBase(x);
- QString subjMD5 = mi->strippedSubjectMD5();
+ TQString subjMD5 = mi->strippedSubjectMD5();
if (subjMD5.isEmpty()) {
mFolder->getMsgBase(x)->initStrippedSubjectMD5();
subjMD5 = mFolder->getMsgBase(x)->strippedSubjectMD5();
@@ -2931,13 +2931,13 @@ void KMHeaders::buildSubjectThreadingTree( QMemArray<SortCacheItem *> sortCache
/* For each subject, keep a list of items with that subject
* (stripped of prefixes) sorted by date. */
if (!mSubjectLists.find(subjMD5))
- mSubjectLists.insert(subjMD5, new QPtrList<SortCacheItem>());
+ mSubjectLists.insert(subjMD5, new TQPtrList<SortCacheItem>());
/* Insertion sort by date. These lists are expected to be very small.
* Also, since the messages are roughly ordered by date in the store,
* they should mostly be prepended at the very start, so insertion is
* cheap. */
int p=0;
- for (QPtrListIterator<SortCacheItem> it(*mSubjectLists[subjMD5]);
+ for (TQPtrListIterator<SortCacheItem> it(*mSubjectLists[subjMD5]);
it.current(); ++it) {
KMMsgBase *mb = mFolder->getMsgBase((*it)->id());
if ( mb->date() < mi->date())
@@ -2955,7 +2955,7 @@ SortCacheItem* KMHeaders::findParent(SortCacheItem *item)
SortCacheItem *parent = NULL;
if (!item) return parent;
KMMsgBase *msg = mFolder->getMsgBase(item->id());
- QString replyToIdMD5 = msg->replyToIdMD5();
+ TQString replyToIdMD5 = msg->replyToIdMD5();
item->setImperfectlyThreaded(true);
/* First, try if the message our Reply-To header points to
* is available to thread below. */
@@ -2971,7 +2971,7 @@ SortCacheItem* KMHeaders::findParent(SortCacheItem *item)
// example, try the list of references, because the second
// to last will likely be in this folder. replyToAuxIdMD5
// contains the second to last one.
- QString ref = msg->replyToAuxIdMD5();
+ TQString ref = msg->replyToAuxIdMD5();
if (!ref.isEmpty())
parent = mSortCacheItems[ref];
}
@@ -2991,12 +2991,12 @@ SortCacheItem* KMHeaders::findParentBySubject(SortCacheItem *item)
if (!msg->subjectIsPrefixed())
return parent;
- QString replyToIdMD5 = msg->replyToIdMD5();
- QString subjMD5 = msg->strippedSubjectMD5();
+ TQString replyToIdMD5 = msg->replyToIdMD5();
+ TQString subjMD5 = msg->strippedSubjectMD5();
if (!subjMD5.isEmpty() && mSubjectLists[subjMD5]) {
/* Iterate over the list of potential parents with the same
* subject, and take the closest one by date. */
- for (QPtrListIterator<SortCacheItem> it2(*mSubjectLists[subjMD5]);
+ for (TQPtrListIterator<SortCacheItem> it2(*mSubjectLists[subjMD5]);
it2.current(); ++it2) {
KMMsgBase *mb = mFolder->getMsgBase((*it2)->id());
if ( !mb ) return parent;
@@ -3027,11 +3027,11 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
bool jumpToUnread = (GlobalSettings::self()->actionEnterFolder() ==
GlobalSettings::EnumActionEnterFolder::SelectFirstUnreadNew) ||
forceJumpToUnread;
- QMemArray<SortCacheItem *> sortCache(mFolder->count());
+ TQMemArray<SortCacheItem *> sortCache(mFolder->count());
bool error = false;
//threaded cases
- QPtrList<SortCacheItem> unparented;
+ TQPtrList<SortCacheItem> unparented;
mImperfectlyThreadedList.clear();
//cleanup
@@ -3040,8 +3040,8 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
mRoot->clearChildren();
- QString sortFile = KMAIL_SORT_FILE(mFolder);
- FILE *sortStream = fopen(QFile::encodeName(sortFile), "r+");
+ TQString sortFile = KMAIL_SORT_FILE(mFolder);
+ FILE *sortStream = fopen(TQFile::encodeName(sortFile), "r+");
mSortInfo.fakeSort = 0;
if(sortStream) {
@@ -3064,7 +3064,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
//Hackyness to work around qlistview problems
KListView::setSorting(-1);
header()->setSortIndicator(column, ascending);
- QObject::connect(header(), SIGNAL(clicked(int)), this, SLOT(dirtySortOrder(int)));
+ TQObject::connect(header(), TQT_SIGNAL(clicked(int)), this, TQT_SLOT(dirtySortOrder(int)));
//setup mSortInfo here now, as above may change it
mSortInfo.dirty = false;
mSortInfo.column = (short)column;
@@ -3073,10 +3073,10 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
SortCacheItem *item;
unsigned long serNum, parentSerNum;
int id, len, parent, x;
- QChar *tmp_qchar = 0;
+ TQChar *tmp_qchar = 0;
int tmp_qchar_len = 0;
const int mFolderCount = mFolder->count();
- QString key;
+ TQString key;
CREATE_TIMER(parse);
START_TIMER(parse);
@@ -3096,14 +3096,14 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
}
if(len) {
if(len > tmp_qchar_len) {
- tmp_qchar = (QChar *)realloc(tmp_qchar, len);
+ tmp_qchar = (TQChar *)realloc(tmp_qchar, len);
tmp_qchar_len = len;
}
if(!fread(tmp_qchar, len, 1, sortStream))
break;
- key = QString(tmp_qchar, len / 2);
+ key = TQString(tmp_qchar, len / 2);
} else {
- key = QString(""); //yuck
+ key = TQString(""); //yuck
}
KMMsgDict::instance()->getLocation(serNum, &folder, &id);
@@ -3215,13 +3215,13 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
// 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 );
- QPtrList<SortCacheItem> toBeSubjThreaded;
+ TQPtrList<SortCacheItem> toBeSubjThreaded;
if (threaded && !unparented.isEmpty()) {
CREATE_TIMER(reparent);
START_TIMER(reparent);
- for(QPtrListIterator<SortCacheItem> it(unparented); it.current(); ++it) {
+ for(TQPtrListIterator<SortCacheItem> it(unparented); it.current(); ++it) {
SortCacheItem *item = (*it);
SortCacheItem *parent = findParent( item );
// If we have a parent, make sure it's not ourselves
@@ -3241,7 +3241,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
if (mSubjThreading) {
buildSubjectThreadingTree( sortCache );
- for(QPtrListIterator<SortCacheItem> it(toBeSubjThreaded); it.current(); ++it) {
+ for(TQPtrListIterator<SortCacheItem> it(toBeSubjThreaded); it.current(); ++it) {
SortCacheItem *item = (*it);
SortCacheItem *parent = findParentBySubject( item );
@@ -3263,12 +3263,12 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
START_TIMER(header_creation);
HeaderItem *khi;
SortCacheItem *i, *new_kci;
- QPtrQueue<SortCacheItem> s;
+ TQPtrQueue<SortCacheItem> s;
s.enqueue(mRoot);
compare_toplevel = true;
do {
i = s.dequeue();
- const QPtrList<SortCacheItem> *sorted = i->sortedChildren();
+ const TQPtrList<SortCacheItem> *sorted = i->sortedChildren();
int unsorted_count, unsorted_off=0;
SortCacheItem **unsorted = i->unsortedChildren(unsorted_count);
if(unsorted)
@@ -3279,7 +3279,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
* 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(QPtrListIterator<SortCacheItem> it(*sorted);
+ for(TQPtrListIterator<SortCacheItem> it(*sorted);
(unsorted && unsorted_off < unsorted_count) || it.current(); ) {
/* As long as we have something in the sorted list and there is
nothing unsorted left, use the item from the sorted list. Also
@@ -3426,7 +3426,7 @@ bool KMHeaders::readSortOrder( bool set_selection, bool forceJumpToUnread )
if (error || (sortStream && ferror(sortStream))) {
if ( sortStream )
fclose(sortStream);
- unlink(QFile::encodeName(sortFile));
+ unlink(TQFile::encodeName(sortFile));
kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl;
kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl;
@@ -3515,7 +3515,7 @@ void KMHeaders::updateActions()
paste->setEnabled( true );
}
-void KMHeaders::setCopiedMessages(const QValueList< Q_UINT32 > & msgs, bool move)
+void KMHeaders::setCopiedMessages(const TQValueList< Q_UINT32 > & msgs, bool move)
{
mCopiedMessages = msgs;
mMoveMessages = move;
@@ -3527,10 +3527,10 @@ bool KMHeaders::isMessageCut(Q_UINT32 serNum) const
return mMoveMessages && mCopiedMessages.contains( serNum );
}
-QValueList< Q_UINT32 > KMHeaders::selectedSernums()
+TQValueList< Q_UINT32 > KMHeaders::selectedSernums()
{
- QValueList<Q_UINT32> list;
- for ( QListViewItemIterator it(this); it.current(); it++ ) {
+ TQValueList<Q_UINT32> list;
+ for ( TQListViewItemIterator it(this); it.current(); it++ ) {
if ( it.current()->isSelected() && it.current()->isVisible() ) {
HeaderItem* item = static_cast<HeaderItem*>( it.current() );
KMMsgBase *msgBase = mFolder->getMsgBase( item->msgId() );
@@ -3540,20 +3540,20 @@ QValueList< Q_UINT32 > KMHeaders::selectedSernums()
return list;
}
-QValueList< Q_UINT32 > KMHeaders::selectedVisibleSernums()
+TQValueList< Q_UINT32 > KMHeaders::selectedVisibleSernums()
{
- QValueList<Q_UINT32> list;
- QListViewItemIterator it(this, QListViewItemIterator::Selected|QListViewItemIterator::Visible);
+ TQValueList<Q_UINT32> list;
+ 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
- QListViewItem * lastAncestorWithSiblings = it.current()->parent();
+ TQListViewItem * lastAncestorWithSiblings = it.current()->parent();
// travel towards the root until we find an ancestor with siblings
while ( ( lastAncestorWithSiblings->depth() > 0 ) && !lastAncestorWithSiblings->nextSibling() )
lastAncestorWithSiblings = lastAncestorWithSiblings->parent();
// move the iterator to that ancestor's next sibling
- it = QListViewItemIterator( lastAncestorWithSiblings->nextSibling() );
+ it = TQListViewItemIterator( lastAncestorWithSiblings->nextSibling() );
continue;
}
HeaderItem *item = static_cast<HeaderItem*>(it.current());