diff options
Diffstat (limited to 'kcontrol/kded/kcmkded.cpp')
-rw-r--r-- | kcontrol/kded/kcmkded.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/kcontrol/kded/kcmkded.cpp b/kcontrol/kded/kcmkded.cpp index e30d73b6f..f24af2c1e 100644 --- a/kcontrol/kded/kcmkded.cpp +++ b/kcontrol/kded/kcmkded.cpp @@ -17,12 +17,12 @@ Boston, MA 02110-1301, USA. */ -#include <qheader.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qtimer.h> -#include <qvgroupbox.h> -#include <qwhatsthis.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqtimer.h> +#include <tqvgroupbox.h> +#include <tqwhatsthis.h> #include <dcopclient.h> #include <dcopref.h> @@ -42,11 +42,11 @@ #include "kcmkded.h" #include "kcmkded.moc" -typedef KGenericFactory<KDEDConfig, QWidget> KDEDFactory; +typedef KGenericFactory<KDEDConfig, TQWidget> KDEDFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kded, KDEDFactory( "kcmkded" ) ) -KDEDConfig::KDEDConfig(QWidget* parent, const char* name, const QStringList &) : +KDEDConfig::KDEDConfig(TQWidget* parent, const char* name, const TQStringList &) : KCModule( KDEDFactory::instance(), parent, name ) { KAboutData *about = @@ -67,10 +67,10 @@ KDEDConfig::KDEDConfig(QWidget* parent, const char* name, const QStringList &) : RUNNING = i18n("Running")+" "; NOT_RUNNING = i18n("Not running")+" "; - QVBoxLayout *lay = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *lay = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QGroupBox *gb = new QVGroupBox(i18n("Load-on-Demand Services"), this ); - QWhatsThis::add(gb, i18n("This is a list of available KDE services which will " + TQGroupBox *gb = new TQVGroupBox(i18n("Load-on-Demand Services"), this ); + TQWhatsThis::add(gb, i18n("This is a list of available KDE services which will " "be started on demand. They are only listed for convenience, as you " "cannot manipulate these services.")); lay->addWidget( gb ); @@ -82,8 +82,8 @@ KDEDConfig::KDEDConfig(QWidget* parent, const char* name, const QStringList &) : _lvLoD->setAllColumnsShowFocus(true); _lvLoD->header()->setStretchEnabled(true, 1); - gb = new QVGroupBox(i18n("Startup Services"), this ); - QWhatsThis::add(gb, i18n("This shows all KDE services that can be loaded " + gb = new TQVGroupBox(i18n("Startup Services"), this ); + TQWhatsThis::add(gb, i18n("This shows all KDE services that can be loaded " "on KDE startup. Checked services will be invoked on next startup. " "Be careful with deactivation of unknown services.")); lay->addWidget( gb ); @@ -103,16 +103,16 @@ KDEDConfig::KDEDConfig(QWidget* parent, const char* name, const QStringList &) : _pbStart->setEnabled( false ); _pbStop->setEnabled( false ); - connect(_pbStart, SIGNAL(clicked()), SLOT(slotStartService())); - connect(_pbStop, SIGNAL(clicked()), SLOT(slotStopService())); - connect(_lvStartup, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotEvalItem(QListViewItem*)) ); + connect(_pbStart, TQT_SIGNAL(clicked()), TQT_SLOT(slotStartService())); + connect(_pbStop, TQT_SIGNAL(clicked()), TQT_SLOT(slotStopService())); + connect(_lvStartup, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotEvalItem(TQListViewItem*)) ); load(); } -void setModuleGroup(KConfig *config, const QString &filename) +void setModuleGroup(KConfig *config, const TQString &filename) { - QString module = filename; + TQString module = filename; int i = module.findRev('/'); if (i != -1) module = module.mid(i+1); @@ -120,16 +120,16 @@ void setModuleGroup(KConfig *config, const QString &filename) if (i != -1) module = module.left(i); - config->setGroup(QString("Module-%1").arg(module)); + config->setGroup(TQString("Module-%1").arg(module)); } -bool KDEDConfig::autoloadEnabled(KConfig *config, const QString &filename) +bool KDEDConfig::autoloadEnabled(KConfig *config, const TQString &filename) { setModuleGroup(config, filename); return config->readBoolEntry("autoload", true); } -void KDEDConfig::setAutoloadEnabled(KConfig *config, const QString &filename, bool b) +void KDEDConfig::setAutoloadEnabled(KConfig *config, const TQString &filename, bool b) { setModuleGroup(config, filename); return config->writeEntry("autoload", b); @@ -147,21 +147,21 @@ void KDEDConfig::load( bool useDefaults ) { _lvStartup->clear(); _lvLoD->clear(); - QStringList files; + TQStringList files; KGlobal::dirs()->findAllResources( "services", - QString::fromLatin1( "kded/*.desktop" ), + TQString::fromLatin1( "kded/*.desktop" ), true, true, files ); - QListViewItem* item = 0L; + TQListViewItem* item = 0L; CheckListItem* clitem; - for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { + for ( TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { if ( KDesktopFile::isDesktopFile( *it ) ) { KDesktopFile file( *it, true, "services" ); if ( file.readBoolEntry("X-KDE-Kded-autoload") ) { - clitem = new CheckListItem(_lvStartup, QString::null); - connect(clitem, SIGNAL(changed(QCheckListItem*)), SLOT(slotItemChecked(QCheckListItem*))); + clitem = new CheckListItem(_lvStartup, TQString::null); + connect(clitem, TQT_SIGNAL(changed(TQCheckListItem*)), TQT_SLOT(slotItemChecked(TQCheckListItem*))); clitem->setOn(autoloadEnabled(&kdedrc, *it)); item = clitem; item->setText(1, file.readName()); @@ -170,7 +170,7 @@ void KDEDConfig::load( bool useDefaults ) { item->setText(4, file.readEntry("X-KDE-Library")); } else if ( file.readBoolEntry("X-KDE-Kded-load-on-demand") ) { - item = new QListViewItem(_lvLoD, file.readName()); + item = new TQListViewItem(_lvLoD, file.readName()); item->setText(1, file.readComment()); item->setText(2, NOT_RUNNING); item->setText(4, file.readEntry("X-KDE-Library")); @@ -183,16 +183,16 @@ void KDEDConfig::load( bool useDefaults ) { } void KDEDConfig::save() { - QCheckListItem* item = 0L; + TQCheckListItem* item = 0L; - QStringList files; + TQStringList files; KGlobal::dirs()->findAllResources( "services", - QString::fromLatin1( "kded/*.desktop" ), + TQString::fromLatin1( "kded/*.desktop" ), true, true, files ); KConfig kdedrc("kdedrc", false, false); - for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { + for ( TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { if ( KDesktopFile::isDesktopFile( *it ) ) { @@ -201,7 +201,7 @@ void KDEDConfig::save() { if (file.readBoolEntry("X-KDE-Kded-autoload")){ - item = static_cast<QCheckListItem *>(_lvStartup->findItem(file.readEntry("X-KDE-Library"),4)); + item = static_cast<TQCheckListItem *>(_lvStartup->findItem(file.readEntry("X-KDE-Library"),4)); if (item) { // we found a match, now compare and see what changed setAutoloadEnabled(&kdedrc, *it, item->isOn()); @@ -212,7 +212,7 @@ void KDEDConfig::save() { kdedrc.sync(); DCOPRef( "kded", "kded" ).call( "reconfigure" ); - QTimer::singleShot(0, this, SLOT(slotServiceRunningToggled())); + TQTimer::singleShot(0, this, TQT_SLOT(slotServiceRunningToggled())); } @@ -225,11 +225,11 @@ void KDEDConfig::defaults() void KDEDConfig::getServiceStatus() { QCStringList modules; - QCString replyType; - QByteArray replyData; + TQCString replyType; + TQByteArray replyData; - if (!kapp->dcopClient()->call( "kded", "kded", "loadedModules()", QByteArray(), + if (!kapp->dcopClient()->call( "kded", "kded", "loadedModules()", TQByteArray(), replyType, replyData ) ) { _lvLoD->setEnabled( false ); @@ -240,18 +240,18 @@ void KDEDConfig::getServiceStatus() else { if ( replyType == "QCStringList" ) { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); reply >> modules; } } - for( QListViewItemIterator it( _lvLoD); it.current() != 0; ++it ) + for( TQListViewItemIterator it( _lvLoD); it.current() != 0; ++it ) it.current()->setText(2, NOT_RUNNING); - for( QListViewItemIterator it( _lvStartup); it.current() != 0; ++it ) + for( TQListViewItemIterator it( _lvStartup); it.current() != 0; ++it ) it.current()->setText(3, NOT_RUNNING); for ( QCStringList::Iterator it = modules.begin(); it != modules.end(); ++it ) { - QListViewItem *item = _lvLoD->findItem(*it, 4); + TQListViewItem *item = _lvLoD->findItem(*it, 4); if ( item ) { item->setText(2, RUNNING); @@ -267,14 +267,14 @@ void KDEDConfig::getServiceStatus() void KDEDConfig::slotReload() { - QString current = _lvStartup->currentItem()->text(4); + TQString current = _lvStartup->currentItem()->text(4); load(); - QListViewItem *item = _lvStartup->findItem(current, 4); + TQListViewItem *item = _lvStartup->findItem(current, 4); if (item) _lvStartup->setCurrentItem(item); } -void KDEDConfig::slotEvalItem(QListViewItem * item) +void KDEDConfig::slotEvalItem(TQListViewItem * item) { if (!item) return; @@ -304,14 +304,14 @@ void KDEDConfig::slotServiceRunningToggled() void KDEDConfig::slotStartService() { - QCString service = _lvStartup->currentItem()->text(4).latin1(); + TQCString service = _lvStartup->currentItem()->text(4).latin1(); - QByteArray data, replyData; - QCString replyType; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg( data, IO_WriteOnly ); arg << service; - if (kapp->dcopClient()->call( "kded", "kded", "loadModule(QCString)", data, replyType, replyData ) ) { - QDataStream reply(replyData, IO_ReadOnly); + if (kapp->dcopClient()->call( "kded", "kded", "loadModule(TQCString)", data, replyType, replyData ) ) { + TQDataStream reply(replyData, IO_ReadOnly); if ( replyType == "bool" ) { bool result; @@ -331,13 +331,13 @@ void KDEDConfig::slotStartService() void KDEDConfig::slotStopService() { - QCString service = _lvStartup->currentItem()->text(4).latin1(); + TQCString service = _lvStartup->currentItem()->text(4).latin1(); kdDebug() << "Stopping: " << service << endl; - QByteArray data; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream arg( data, IO_WriteOnly ); arg << service; - if (kapp->dcopClient()->send( "kded", "kded", "unloadModule(QCString)", data ) ) { + if (kapp->dcopClient()->send( "kded", "kded", "unloadModule(TQCString)", data ) ) { slotServiceRunningToggled(); } else { @@ -346,18 +346,18 @@ void KDEDConfig::slotStopService() } -void KDEDConfig::slotItemChecked(QCheckListItem*) +void KDEDConfig::slotItemChecked(TQCheckListItem*) { emit changed(true); } -CheckListItem::CheckListItem(QListView *parent, const QString &text) - : QObject(parent), - QCheckListItem(parent, text, CheckBox) +CheckListItem::CheckListItem(TQListView *parent, const TQString &text) + : TQObject(parent), + TQCheckListItem(parent, text, CheckBox) { } void CheckListItem::stateChange(bool on) { - QCheckListItem::stateChange(on); + TQCheckListItem::stateChange(on); emit changed(this); } |