summaryrefslogtreecommitdiffstats
path: root/kontact/plugins/newsticker/kcmkontactknt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kontact/plugins/newsticker/kcmkontactknt.cpp')
-rw-r--r--kontact/plugins/newsticker/kcmkontactknt.cpp144
1 files changed, 72 insertions, 72 deletions
diff --git a/kontact/plugins/newsticker/kcmkontactknt.cpp b/kontact/plugins/newsticker/kcmkontactknt.cpp
index 18f439c8e..13734a8ab 100644
--- a/kontact/plugins/newsticker/kcmkontactknt.cpp
+++ b/kontact/plugins/newsticker/kcmkontactknt.cpp
@@ -21,12 +21,12 @@
without including the source code for Qt in the source distribution.
*/
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qvaluevector.h>
-#include <qspinbox.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqvaluevector.h>
+#include <tqspinbox.h>
#include <dcopref.h>
#include <dcopclient.h>
@@ -49,41 +49,41 @@
extern "C"
{
- KDE_EXPORT KCModule *create_kontactknt( QWidget *parent, const char * )
+ KDE_EXPORT KCModule *create_kontactknt( TQWidget *parent, const char * )
{
return new KCMKontactKNT( parent, "kcmkontactknt" );
}
}
-NewsEditDialog::NewsEditDialog( const QString& title, const QString& url, QWidget *parent )
+NewsEditDialog::NewsEditDialog( const TQString& title, const TQString& url, TQWidget *parent )
: KDialogBase( Plain, i18n( "New News Feed" ), Ok | Cancel,
Ok, parent, 0, true, true )
{
- QWidget *page = plainPage();
- QGridLayout *layout = new QGridLayout( page, 2, 3, marginHint(),
+ TQWidget *page = plainPage();
+ TQGridLayout *layout = new TQGridLayout( page, 2, 3, marginHint(),
spacingHint() );
- QLabel *label = new QLabel( i18n( "Name:" ), page );
+ TQLabel *label = new TQLabel( i18n( "Name:" ), page );
layout->addWidget( label, 0, 0 );
- mTitle = new QLineEdit( page );
+ mTitle = new TQLineEdit( page );
label->setBuddy( mTitle );
layout->addMultiCellWidget( mTitle, 0, 0, 1, 2 );
- label = new QLabel( i18n( "URL:" ), page );
+ label = new TQLabel( i18n( "URL:" ), page );
layout->addWidget( label, 1, 0 );
- mURL = new QLineEdit( page );
+ mURL = new TQLineEdit( page );
label->setBuddy( mURL );
layout->addMultiCellWidget( mURL, 1, 1, 1, 2 );
mTitle->setText( title );
mURL->setText( url );
mTitle->setFocus();
- connect( mTitle, SIGNAL( textChanged( const QString& ) ),
- this, SLOT( modified() ) );
- connect( mURL, SIGNAL( textChanged( const QString& ) ),
- this, SLOT( modified() ) );
+ connect( mTitle, TQT_SIGNAL( textChanged( const TQString& ) ),
+ this, TQT_SLOT( modified() ) );
+ connect( mURL, TQT_SIGNAL( textChanged( const TQString& ) ),
+ this, TQT_SLOT( modified() ) );
modified();
}
@@ -93,12 +93,12 @@ void NewsEditDialog::modified()
enableButton( KDialogBase::Ok, !title().isEmpty() && !url().isEmpty() );
}
-QString NewsEditDialog::title() const
+TQString NewsEditDialog::title() const
{
return mTitle->text();
}
-QString NewsEditDialog::url() const
+TQString NewsEditDialog::url() const
{
return mURL->text();
}
@@ -106,45 +106,45 @@ QString NewsEditDialog::url() const
class NewsItem : public QListViewItem
{
public:
- NewsItem( QListView *parent, const QString& title, const QString& url, bool custom )
- : QListViewItem( parent ), mTitle( title ), mUrl( url ), mCustom( custom )
+ NewsItem( TQListView *parent, const TQString& title, const TQString& url, bool custom )
+ : TQListViewItem( parent ), mTitle( title ), mUrl( url ), mCustom( custom )
{
setText( 0, mTitle );
}
- NewsItem( QListViewItem *parent, const QString& title, const QString& url, bool custom )
- : QListViewItem( parent ), mTitle( title ), mUrl( url ), mCustom( custom )
+ NewsItem( TQListViewItem *parent, const TQString& title, const TQString& url, bool custom )
+ : TQListViewItem( parent ), mTitle( title ), mUrl( url ), mCustom( custom )
{
setText( 0, mTitle );
}
- QString title() const { return mTitle; }
- QString url() const { return mUrl; }
+ TQString title() const { return mTitle; }
+ TQString url() const { return mUrl; }
bool custom() const { return mCustom; }
private:
- QString mTitle;
- QString mUrl;
+ TQString mTitle;
+ TQString mUrl;
bool mCustom;
};
-KCMKontactKNT::KCMKontactKNT( QWidget *parent, const char *name )
+KCMKontactKNT::KCMKontactKNT( TQWidget *parent, const char *name )
: KCModule( parent, name )
{
initGUI();
- connect( mAllNews, SIGNAL( currentChanged( QListViewItem* ) ),
- this, SLOT( allCurrentChanged( QListViewItem* ) ) );
- connect( mSelectedNews, SIGNAL( selectionChanged( QListViewItem* ) ),
- this, SLOT( selectedChanged( QListViewItem* ) ) );
+ connect( mAllNews, TQT_SIGNAL( currentChanged( TQListViewItem* ) ),
+ this, TQT_SLOT( allCurrentChanged( TQListViewItem* ) ) );
+ connect( mSelectedNews, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ),
+ this, TQT_SLOT( selectedChanged( TQListViewItem* ) ) );
- connect( mUpdateInterval, SIGNAL( valueChanged( int ) ), SLOT( modified() ) );
- connect( mArticleCount, SIGNAL( valueChanged( int ) ), SLOT( modified() ) );
+ connect( mUpdateInterval, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( modified() ) );
+ connect( mArticleCount, TQT_SIGNAL( valueChanged( int ) ), TQT_SLOT( modified() ) );
- connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addNews() ) );
- connect( mRemoveButton, SIGNAL( clicked() ), this, SLOT( removeNews() ) );
- connect( mNewButton, SIGNAL( clicked() ), this, SLOT( newFeed() ) );
- connect( mDeleteButton, SIGNAL( clicked() ), this, SLOT( deleteFeed() ) );
+ connect( mAddButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addNews() ) );
+ connect( mRemoveButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeNews() ) );
+ connect( mNewButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( newFeed() ) );
+ connect( mDeleteButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deleteFeed() ) );
KAcceleratorManager::manage( this );
@@ -153,15 +153,15 @@ KCMKontactKNT::KCMKontactKNT( QWidget *parent, const char *name )
void KCMKontactKNT::loadNews()
{
- QValueVector<QListViewItem*> parents;
- QValueVector<QListViewItem*>::Iterator it;
+ TQValueVector<TQListViewItem*> parents;
+ TQValueVector<TQListViewItem*>::Iterator it;
- parents.append( new QListViewItem( mAllNews, i18n( "Arts" ) ) );
- parents.append( new QListViewItem( mAllNews, i18n( "Business" ) ) );
- parents.append( new QListViewItem( mAllNews, i18n( "Computers" ) ) );
- parents.append( new QListViewItem( mAllNews, i18n( "Misc" ) ) );
- parents.append( new QListViewItem( mAllNews, i18n( "Recreation" ) ) );
- parents.append( new QListViewItem( mAllNews, i18n( "Society" ) ) );
+ parents.append( new TQListViewItem( mAllNews, i18n( "Arts" ) ) );
+ parents.append( new TQListViewItem( mAllNews, i18n( "Business" ) ) );
+ parents.append( new TQListViewItem( mAllNews, i18n( "Computers" ) ) );
+ parents.append( new TQListViewItem( mAllNews, i18n( "Misc" ) ) );
+ parents.append( new TQListViewItem( mAllNews, i18n( "Recreation" ) ) );
+ parents.append( new TQListViewItem( mAllNews, i18n( "Society" ) ) );
for ( it = parents.begin(); it != parents.end(); ++it )
(*it)->setSelectable( false );
@@ -176,18 +176,18 @@ void KCMKontactKNT::loadNews()
void KCMKontactKNT::loadCustomNews()
{
KConfig config( "kcmkontactkntrc" );
- QMap<QString, QString> customFeeds = config.entryMap( "CustomFeeds" );
+ TQMap<TQString, TQString> customFeeds = config.entryMap( "CustomFeeds" );
config.setGroup( "CustomFeeds" );
- mCustomItem = new QListViewItem( mAllNews, i18n( "Custom" ) );
+ mCustomItem = new TQListViewItem( mAllNews, i18n( "Custom" ) );
mCustomItem->setSelectable( false );
if ( customFeeds.count() == 0 )
mCustomItem->setVisible( false );
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString>::Iterator it;
for ( it = customFeeds.begin(); it != customFeeds.end(); ++it ) {
- QStringList value = config.readListEntry( it.key() );
+ TQStringList value = config.readListEntry( it.key() );
mCustomFeeds.append( new NewsItem( mCustomItem, value[ 0 ], value[ 1 ], true ) );
mFeedMap.insert( value[ 1 ], value[ 0 ] );
mCustomItem->setVisible( true );
@@ -201,11 +201,11 @@ void KCMKontactKNT::storeCustomNews()
config.setGroup( "CustomFeeds" );
int counter = 0;
- QValueList<NewsItem*>::Iterator it;
+ TQValueList<NewsItem*>::Iterator it;
for ( it = mCustomFeeds.begin(); it != mCustomFeeds.end(); ++it ) {
- QStringList value;
+ TQStringList value;
value << (*it)->title() << (*it)->url();
- config.writeEntry( QString::number( counter ), value );
+ config.writeEntry( TQString::number( counter ), value );
++counter;
}
@@ -223,7 +223,7 @@ void KCMKontactKNT::addNews()
return;
DCOPRef service( "rssservice", "RSSService" );
- service.send( "add(QString)", item->url() );
+ service.send( "add(TQString)", item->url() );
scanNews();
@@ -240,7 +240,7 @@ void KCMKontactKNT::removeNews()
return;
DCOPRef service( "rssservice", "RSSService" );
- service.send( "remove(QString)", item->url() );
+ service.send( "remove(TQString)", item->url() );
scanNews();
@@ -292,24 +292,24 @@ void KCMKontactKNT::scanNews()
mSelectedNews->clear();
DCOPRef service( "rssservice", "RSSService" );
- QStringList urls = service.call( "list()" );
+ TQStringList urls = service.call( "list()" );
for ( uint i = 0; i < urls.count(); ++i )
{
- QString url = urls[ i ];
- QString feedName = mFeedMap[ url ];
+ TQString url = urls[ i ];
+ TQString feedName = mFeedMap[ url ];
if ( feedName.isEmpty() )
feedName = url;
new NewsItem( mSelectedNews, feedName, url, false );
}
}
-void KCMKontactKNT::selectedChanged( QListViewItem *item )
+void KCMKontactKNT::selectedChanged( TQListViewItem *item )
{
mRemoveButton->setEnabled( item && item->isSelected() );
}
-void KCMKontactKNT::allCurrentChanged( QListViewItem *item )
+void KCMKontactKNT::allCurrentChanged( TQListViewItem *item )
{
NewsItem *newsItem = dynamic_cast<NewsItem*>( item );
@@ -331,7 +331,7 @@ void KCMKontactKNT::modified()
void KCMKontactKNT::initGUI()
{
- QGridLayout *layout = new QGridLayout( this, 2, 3, KDialog::marginHint(),
+ TQGridLayout *layout = new TQGridLayout( this, 2, 3, KDialog::marginHint(),
KDialog::spacingHint() );
mAllNews = new KListView( this );
@@ -340,7 +340,7 @@ void KCMKontactKNT::initGUI()
mAllNews->setFullWidth( true );
layout->addWidget( mAllNews, 0, 0 );
- QVBoxLayout *vbox = new QVBoxLayout( layout, KDialog::spacingHint() );
+ TQVBoxLayout *vbox = new TQVBoxLayout( layout, KDialog::spacingHint() );
vbox->addStretch();
mAddButton = new KPushButton( i18n( "Add" ), this );
@@ -356,24 +356,24 @@ void KCMKontactKNT::initGUI()
mSelectedNews->setFullWidth( true );
layout->addWidget( mSelectedNews, 0, 2 );
- QGroupBox *box = new QGroupBox( 0, Qt::Vertical,
+ TQGroupBox *box = new TQGroupBox( 0, Qt::Vertical,
i18n( "News Feed Settings" ), this );
- QGridLayout *boxLayout = new QGridLayout( box->layout(), 2, 3,
+ TQGridLayout *boxLayout = new TQGridLayout( box->layout(), 2, 3,
KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n( "Refresh time:" ), box );
+ TQLabel *label = new TQLabel( i18n( "Refresh time:" ), box );
boxLayout->addWidget( label, 0, 0 );
- mUpdateInterval = new QSpinBox( 1, 3600, 1, box );
+ mUpdateInterval = new TQSpinBox( 1, 3600, 1, box );
mUpdateInterval->setSuffix( " sec." );
label->setBuddy( mUpdateInterval );
boxLayout->addWidget( mUpdateInterval, 0, 1 );
- label = new QLabel( i18n( "Number of items shown:" ), box );
+ label = new TQLabel( i18n( "Number of items shown:" ), box );
boxLayout->addWidget( label, 1, 0 );
- mArticleCount = new QSpinBox( box );
+ mArticleCount = new TQSpinBox( box );
label->setBuddy( mArticleCount );
boxLayout->addWidget( mArticleCount, 1, 1 );
@@ -389,12 +389,12 @@ void KCMKontactKNT::initGUI()
bool KCMKontactKNT::dcopActive() const
{
- QString error;
- QCString appID;
+ TQString error;
+ TQCString appID;
bool isGood = true;
DCOPClient *client = kapp->dcopClient();
if ( !client->isApplicationRegistered( "rssservice" ) ) {
- if ( KApplication::startServiceByDesktopName( "rssservice", QStringList(), &error, &appID ) )
+ if ( KApplication::startServiceByDesktopName( "rssservice", TQStringList(), &error, &appID ) )
isGood = false;
}