summaryrefslogtreecommitdiffstats
path: root/libkdepim/ksubscription.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdepim/ksubscription.cpp')
-rw-r--r--libkdepim/ksubscription.cpp192
1 files changed, 96 insertions, 96 deletions
diff --git a/libkdepim/ksubscription.cpp b/libkdepim/ksubscription.cpp
index c0745189e..f61b633ca 100644
--- a/libkdepim/ksubscription.cpp
+++ b/libkdepim/ksubscription.cpp
@@ -13,12 +13,12 @@
#include "ksubscription.h"
#include "kaccount.h"
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qheader.h>
-#include <qtoolbutton.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqheader.h>
+#include <tqtoolbutton.h>
#include <kseparator.h>
#include <kapplication.h>
@@ -30,9 +30,9 @@
//=============================================================================
-KGroupInfo::KGroupInfo(const QString &name, const QString &description,
+KGroupInfo::KGroupInfo(const TQString &name, const TQString &description,
bool newGroup, bool subscribed,
- Status status, QString path)
+ Status status, TQString path)
: name(name), description(description),
newGroup(newGroup), subscribed(subscribed),
status(status), path(path)
@@ -53,9 +53,9 @@ bool KGroupInfo::operator< (const KGroupInfo &gi2)
//=============================================================================
-GroupItem::GroupItem( QListView *v, const KGroupInfo &gi, KSubscription* browser,
+GroupItem::GroupItem( TQListView *v, const KGroupInfo &gi, KSubscription* browser,
bool isCheckItem )
- : QCheckListItem( v, gi.name, isCheckItem ? CheckBox : CheckBoxController ),
+ : TQCheckListItem( v, gi.name, isCheckItem ? CheckBox : CheckBoxController ),
mInfo( gi ), mBrowser( browser ), mIsCheckItem( isCheckItem ),
mIgnoreStateChange( false )
{
@@ -64,9 +64,9 @@ GroupItem::GroupItem( QListView *v, const KGroupInfo &gi, KSubscription* browser
}
//-----------------------------------------------------------------------------
-GroupItem::GroupItem( QListViewItem *i, const KGroupInfo &gi, KSubscription* browser,
+GroupItem::GroupItem( TQListViewItem *i, const KGroupInfo &gi, KSubscription* browser,
bool isCheckItem )
- : QCheckListItem( i, gi.name, isCheckItem ? CheckBox : CheckBoxController ),
+ : TQCheckListItem( i, gi.name, isCheckItem ? CheckBox : CheckBoxController ),
mInfo( gi ), mBrowser( browser ), mIsCheckItem( isCheckItem ),
mIgnoreStateChange( false )
{
@@ -99,7 +99,7 @@ void GroupItem::setOn( bool on )
mInfo.subscribed = on;
}
if (isCheckItem())
- QCheckListItem::setOn(on);
+ TQCheckListItem::setOn(on);
}
//------------------------------------------------------------------------------
@@ -115,7 +115,7 @@ void GroupItem::setVisible( bool b )
{
if (b)
{
- QListViewItem::setVisible(b);
+ TQListViewItem::setVisible(b);
setEnabled(true);
}
else
@@ -123,14 +123,14 @@ void GroupItem::setVisible( bool b )
if (isCheckItem())
{
bool setInvisible = true;
- for (QListViewItem * lvchild = firstChild(); lvchild != 0;
+ for (TQListViewItem * lvchild = firstChild(); lvchild != 0;
lvchild = lvchild->nextSibling())
{
if (lvchild->isVisible()) // item has a visible child
setInvisible = false;
}
if (setInvisible)
- QListViewItem::setVisible(b);
+ TQListViewItem::setVisible(b);
else
{
// leave it visible so that children remain visible
@@ -141,9 +141,9 @@ void GroupItem::setVisible( bool b )
else
{
// non-checkable item
- QPtrList<QListViewItem> moveItems;
+ TQPtrList<TQListViewItem> moveItems;
- for (QListViewItem * lvchild = firstChild(); lvchild != 0;
+ for (TQListViewItem * lvchild = firstChild(); lvchild != 0;
lvchild = lvchild->nextSibling())
{
if (static_cast<GroupItem*>(lvchild)->isCheckItem())
@@ -152,62 +152,62 @@ void GroupItem::setVisible( bool b )
moveItems.append(lvchild);
}
}
- QPtrListIterator<QListViewItem> it( moveItems );
+ TQPtrListIterator<TQListViewItem> it( moveItems );
for ( ; it.current(); ++it)
{
// move the checkitem to top
- QListViewItem* parent = it.current()->parent();
+ TQListViewItem* parent = it.current()->parent();
if (parent) parent->takeItem(it.current());
listView()->insertItem(it.current());
}
- QListViewItem::setVisible(false);
+ TQListViewItem::setVisible(false);
}
}
}
//-----------------------------------------------------------------------------
-void GroupItem::paintCell( QPainter * p, const QColorGroup & cg,
+void GroupItem::paintCell( TQPainter * p, const TQColorGroup & cg,
int column, int width, int align )
{
if (mIsCheckItem)
- return QCheckListItem::paintCell( p, cg, column, width, align );
+ return TQCheckListItem::paintCell( p, cg, column, width, align );
else
- return QListViewItem::paintCell( p, cg, column, width, align );
+ return TQListViewItem::paintCell( p, cg, column, width, align );
}
//-----------------------------------------------------------------------------
-void GroupItem::paintFocus( QPainter * p, const QColorGroup & cg,
- const QRect & r )
+void GroupItem::paintFocus( TQPainter * p, const TQColorGroup & cg,
+ const TQRect & r )
{
if (mIsCheckItem)
- QCheckListItem::paintFocus(p, cg, r);
+ TQCheckListItem::paintFocus(p, cg, r);
else
- QListViewItem::paintFocus(p, cg, r);
+ TQListViewItem::paintFocus(p, cg, r);
}
//-----------------------------------------------------------------------------
-int GroupItem::width( const QFontMetrics& fm, const QListView* lv, int column) const
+int GroupItem::width( const TQFontMetrics& fm, const TQListView* lv, int column) const
{
if (mIsCheckItem)
- return QCheckListItem::width(fm, lv, column);
+ return TQCheckListItem::width(fm, lv, column);
else
- return QListViewItem::width(fm, lv, column);
+ return TQListViewItem::width(fm, lv, column);
}
//-----------------------------------------------------------------------------
void GroupItem::setup()
{
if (mIsCheckItem)
- QCheckListItem::setup();
+ TQCheckListItem::setup();
else
- QListViewItem::setup();
+ TQListViewItem::setup();
}
//=============================================================================
-KSubscription::KSubscription( QWidget *parent, const QString &caption,
- KAccount * acct, int buttons, const QString &user1, bool descriptionColumn )
+KSubscription::KSubscription( TQWidget *parent, const TQString &caption,
+ KAccount * acct, int buttons, const TQString &user1, bool descriptionColumn )
: KDialogBase( parent, 0, true, caption, buttons | Help | Ok | Cancel, Ok,
true, i18n("Reload &List"), user1 ),
mAcct( acct )
@@ -216,35 +216,35 @@ KSubscription::KSubscription( QWidget *parent, const QString &caption,
setWFlags( getWFlags() | WDestructiveClose );
// create Widgets
- page = new QWidget(this);
+ page = new TQWidget(this);
setMainWidget(page);
- QLabel *comment = new QLabel("<p>"+
+ TQLabel *comment = new TQLabel("<p>"+
i18n("Manage which mail folders you want to see in your folder view") + "</p>", page);
- QToolButton *clearButton = new QToolButton( page );
+ TQToolButton *clearButton = new TQToolButton( page );
clearButton->setIconSet( KGlobal::iconLoader()->loadIconSet(
KApplication::reverseLayout() ? "clear_left":"locationbar_erase", KIcon::Small, 0 ) );
filterEdit = new KLineEdit(page);
- QLabel *l = new QLabel(filterEdit,i18n("S&earch:"), page);
- connect( clearButton, SIGNAL( clicked() ), filterEdit, SLOT( clear() ) );
+ TQLabel *l = new TQLabel(filterEdit,i18n("S&earch:"), page);
+ connect( clearButton, TQT_SIGNAL( clicked() ), filterEdit, TQT_SLOT( clear() ) );
// checkboxes
- noTreeCB = new QCheckBox(i18n("Disable &tree view"), page);
+ noTreeCB = new TQCheckBox(i18n("Disable &tree view"), page);
noTreeCB->setChecked(false);
- subCB = new QCheckBox(i18n("&Subscribed only"), page);
+ subCB = new TQCheckBox(i18n("&Subscribed only"), page);
subCB->setChecked(false);
- newCB = new QCheckBox(i18n("&New only"), page);
+ newCB = new TQCheckBox(i18n("&New only"), page);
newCB->setChecked(false);
KSeparator *sep = new KSeparator(KSeparator::HLine, page);
// init the labels
- QFont fnt = font();
+ TQFont fnt = font();
fnt.setBold(true);
- leftLabel = new QLabel(i18n("Loading..."), page);
- rightLabel = new QLabel(i18n("Current changes:"), page);
+ leftLabel = new TQLabel(i18n("Loading..."), page);
+ rightLabel = new TQLabel(i18n("Current changes:"), page);
leftLabel->setFont(fnt);
rightLabel->setFont(fnt);
@@ -252,9 +252,9 @@ KSubscription::KSubscription( QWidget *parent, const QString &caption,
pmRight = BarIconSet("forward");
pmLeft = BarIconSet("back");
- arrowBtn1 = new QPushButton(page);
+ arrowBtn1 = new TQPushButton(page);
arrowBtn1->setEnabled(false);
- arrowBtn2 = new QPushButton(page);
+ arrowBtn2 = new TQPushButton(page);
arrowBtn2->setEnabled(false);
arrowBtn1->setIconSet(pmRight);
arrowBtn2->setIconSet(pmRight);
@@ -262,7 +262,7 @@ KSubscription::KSubscription( QWidget *parent, const QString &caption,
arrowBtn2->setFixedSize(35,30);
// the main listview
- groupView = new QListView(page);
+ groupView = new TQListView(page);
groupView->setRootIsDecorated(true);
groupView->addColumn(i18n("Name"));
groupView->setAllColumnsShowFocus(true);
@@ -272,10 +272,10 @@ KSubscription::KSubscription( QWidget *parent, const QString &caption,
groupView->header()->setStretchEnabled(true, 0);
// layout
- QGridLayout *topL = new QGridLayout(page,4,1,0, KDialog::spacingHint());
- QHBoxLayout *filterL = new QHBoxLayout(KDialog::spacingHint());
- QVBoxLayout *arrL = new QVBoxLayout(KDialog::spacingHint());
- listL = new QGridLayout(2, 3, KDialog::spacingHint());
+ TQGridLayout *topL = new TQGridLayout(page,4,1,0, KDialog::spacingHint());
+ TQHBoxLayout *filterL = new TQHBoxLayout(KDialog::spacingHint());
+ TQVBoxLayout *arrL = new TQVBoxLayout(KDialog::spacingHint());
+ listL = new TQGridLayout(2, 3, KDialog::spacingHint());
topL->addWidget(comment, 0,0);
topL->addLayout(filterL, 1,0);
@@ -301,14 +301,14 @@ KSubscription::KSubscription( QWidget *parent, const QString &caption,
arrL->addWidget(arrowBtn2, AlignCenter);
// listviews
- subView = new QListView(page);
+ subView = new TQListView(page);
subView->addColumn(i18n("Subscribe To"));
subView->header()->setStretchEnabled(true, 0);
- unsubView = new QListView(page);
+ unsubView = new TQListView(page);
unsubView->addColumn(i18n("Unsubscribe From"));
unsubView->header()->setStretchEnabled(true, 0);
- QVBoxLayout *protL = new QVBoxLayout(3);
+ TQVBoxLayout *protL = new TQVBoxLayout(3);
listL->addLayout(protL, 1,2);
protL->addWidget(subView);
protL->addWidget(unsubView);
@@ -323,29 +323,29 @@ KSubscription::KSubscription( QWidget *parent, const QString &caption,
filterEdit->setFocus();
// items clicked
- connect(groupView, SIGNAL(clicked(QListViewItem *)),
- this, SLOT(slotChangeButtonState(QListViewItem*)));
- connect(subView, SIGNAL(clicked(QListViewItem *)),
- this, SLOT(slotChangeButtonState(QListViewItem*)));
- connect(unsubView, SIGNAL(clicked(QListViewItem *)),
- this, SLOT(slotChangeButtonState(QListViewItem*)));
+ connect(groupView, TQT_SIGNAL(clicked(TQListViewItem *)),
+ this, TQT_SLOT(slotChangeButtonState(TQListViewItem*)));
+ connect(subView, TQT_SIGNAL(clicked(TQListViewItem *)),
+ this, TQT_SLOT(slotChangeButtonState(TQListViewItem*)));
+ connect(unsubView, TQT_SIGNAL(clicked(TQListViewItem *)),
+ this, TQT_SLOT(slotChangeButtonState(TQListViewItem*)));
// connect buttons
- connect(arrowBtn1, SIGNAL(clicked()), SLOT(slotButton1()));
- connect(arrowBtn2, SIGNAL(clicked()), SLOT(slotButton2()));
- connect(this, SIGNAL(user1Clicked()), SLOT(slotLoadFolders()));
+ connect(arrowBtn1, TQT_SIGNAL(clicked()), TQT_SLOT(slotButton1()));
+ connect(arrowBtn2, TQT_SIGNAL(clicked()), TQT_SLOT(slotButton2()));
+ connect(this, TQT_SIGNAL(user1Clicked()), TQT_SLOT(slotLoadFolders()));
// connect checkboxes
- connect(subCB, SIGNAL(clicked()), SLOT(slotCBToggled()));
- connect(newCB, SIGNAL(clicked()), SLOT(slotCBToggled()));
- connect(noTreeCB, SIGNAL(clicked()), SLOT(slotCBToggled()));
+ connect(subCB, TQT_SIGNAL(clicked()), TQT_SLOT(slotCBToggled()));
+ connect(newCB, TQT_SIGNAL(clicked()), TQT_SLOT(slotCBToggled()));
+ connect(noTreeCB, TQT_SIGNAL(clicked()), TQT_SLOT(slotCBToggled()));
// connect textfield
- connect(filterEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotFilterTextChanged(const QString&)));
+ connect(filterEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotFilterTextChanged(const TQString&)));
// update status
- connect(this, SIGNAL(listChanged()), SLOT(slotUpdateStatusLabel()));
+ connect(this, TQT_SIGNAL(listChanged()), TQT_SLOT(slotUpdateStatusLabel()));
}
//-----------------------------------------------------------------------------
@@ -356,7 +356,7 @@ KSubscription::~KSubscription()
//-----------------------------------------------------------------------------
void KSubscription::setStartItem( const KGroupInfo &info )
{
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
for ( ; it.current(); ++it)
{
@@ -369,10 +369,10 @@ void KSubscription::setStartItem( const KGroupInfo &info )
}
//-----------------------------------------------------------------------------
-void KSubscription::removeListItem( QListView *view, const KGroupInfo &gi )
+void KSubscription::removeListItem( TQListView *view, const KGroupInfo &gi )
{
if(!view) return;
- QListViewItemIterator it(view);
+ TQListViewItemIterator it(view);
for ( ; it.current(); ++it)
{
@@ -387,10 +387,10 @@ void KSubscription::removeListItem( QListView *view, const KGroupInfo &gi )
}
//-----------------------------------------------------------------------------
-QListViewItem* KSubscription::getListItem( QListView *view, const KGroupInfo &gi )
+TQListViewItem* KSubscription::getListItem( TQListView *view, const KGroupInfo &gi )
{
if(!view) return 0;
- QListViewItemIterator it(view);
+ TQListViewItemIterator it(view);
for ( ; it.current(); ++it)
{
@@ -401,10 +401,10 @@ QListViewItem* KSubscription::getListItem( QListView *view, const KGroupInfo &gi
}
//-----------------------------------------------------------------------------
-bool KSubscription::itemInListView( QListView *view, const KGroupInfo &gi )
+bool KSubscription::itemInListView( TQListView *view, const KGroupInfo &gi )
{
if(!view) return false;
- QListViewItemIterator it(view);
+ TQListViewItemIterator it(view);
for ( ; it.current(); ++it)
if (static_cast<GroupItem*>(it.current())->info() == gi)
@@ -445,7 +445,7 @@ void KSubscription::changeItemState( GroupItem* item, bool on )
{
if (!itemInListView(unsubView, item->info()))
{
- QListViewItem *p = item->parent();
+ TQListViewItem *p = item->parent();
while (p)
{
// make sure all parents are subscribed
@@ -477,7 +477,7 @@ void KSubscription::changeItemState( GroupItem* item, bool on )
}
//------------------------------------------------------------------------------
-void KSubscription::filterChanged( QListViewItem* item, const QString & text )
+void KSubscription::filterChanged( TQListViewItem* item, const TQString & text )
{
if ( !item && groupView )
item = groupView->firstChild();
@@ -538,7 +538,7 @@ void KSubscription::filterChanged( QListViewItem* item, const QString & text )
//------------------------------------------------------------------------------
uint KSubscription::activeItemCount()
{
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
uint count = 0;
for ( ; it.current(); ++it)
@@ -554,11 +554,11 @@ uint KSubscription::activeItemCount()
//------------------------------------------------------------------------------
void KSubscription::restoreOriginalParent()
{
- QPtrList<QListViewItem> move;
- QListViewItemIterator it(groupView);
+ TQPtrList<TQListViewItem> move;
+ TQListViewItemIterator it(groupView);
for ( ; it.current(); ++it)
{
- QListViewItem* origParent = static_cast<GroupItem*>(it.current())->
+ TQListViewItem* origParent = static_cast<GroupItem*>(it.current())->
originalParent();
if (origParent && origParent != it.current()->parent())
{
@@ -566,11 +566,11 @@ void KSubscription::restoreOriginalParent()
move.append(it.current());
}
}
- QPtrListIterator<QListViewItem> it2( move );
+ TQPtrListIterator<TQListViewItem> it2( move );
for ( ; it2.current(); ++it2)
{
// restore the original parent
- QListViewItem* origParent = static_cast<GroupItem*>(it2.current())->
+ TQListViewItem* origParent = static_cast<GroupItem*>(it2.current())->
originalParent();
groupView->takeItem(it2.current());
origParent->insertItem(it2.current());
@@ -580,7 +580,7 @@ void KSubscription::restoreOriginalParent()
//-----------------------------------------------------------------------------
void KSubscription::saveOpenStates()
{
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
for ( ; it.current(); ++it)
{
@@ -592,7 +592,7 @@ void KSubscription::saveOpenStates()
//-----------------------------------------------------------------------------
void KSubscription::restoreOpenStates()
{
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
for ( ; it.current(); ++it)
{
@@ -613,7 +613,7 @@ void KSubscription::slotLoadingComplete()
subCB->setEnabled(true);
// remember the correct parent
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
for ( ; it.current(); ++it)
{
static_cast<GroupItem*>(it.current())->
@@ -624,7 +624,7 @@ void KSubscription::slotLoadingComplete()
}
//------------------------------------------------------------------------------
-void KSubscription::slotChangeButtonState( QListViewItem *item )
+void KSubscription::slotChangeButtonState( TQListViewItem *item )
{
if (!item ||
(item->listView() == groupView &&
@@ -636,7 +636,7 @@ void KSubscription::slotChangeButtonState( QListViewItem *item )
return;
}
// set the direction of the buttons and enable/disable them
- QListView* currentView = item->listView();
+ TQListView* currentView = item->listView();
if (currentView == groupView)
{
setDirectionButton1(Right);
@@ -686,7 +686,7 @@ void KSubscription::slotButton1()
{
GroupItem* item = static_cast<GroupItem*>(subView->currentItem());
// get the corresponding item from the groupView
- QListViewItem* listitem = getListItem(groupView, item->info());
+ TQListViewItem* listitem = getListItem(groupView, item->info());
if (listitem)
{
// deactivate
@@ -715,7 +715,7 @@ void KSubscription::slotButton2()
{
GroupItem* item = static_cast<GroupItem*>(unsubView->currentItem());
// get the corresponding item from the groupView
- QListViewItem* listitem = getListItem(groupView, item->info());
+ TQListViewItem* listitem = getListItem(groupView, item->info());
if (listitem)
{
// activate
@@ -739,7 +739,7 @@ void KSubscription::slotCBToggled()
}
//------------------------------------------------------------------------------
-void KSubscription::slotFilterTextChanged( const QString & text )
+void KSubscription::slotFilterTextChanged( const TQString & text )
{
// remember is the items are open
if (mLastText.isEmpty())
@@ -749,7 +749,7 @@ void KSubscription::slotFilterTextChanged( const QString & text )
{
// reset
restoreOriginalParent();
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
for ( ; it.current(); ++it)
{
it.current()->setVisible(true);
@@ -769,7 +769,7 @@ void KSubscription::slotFilterTextChanged( const QString & text )
//------------------------------------------------------------------------------
void KSubscription::slotUpdateStatusLabel()
{
- QString text;
+ TQString text;
if (mLoading)
text = i18n("Loading... (1 matching)", "Loading... (%n matching)",
activeItemCount());