diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-15 09:34:36 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-15 09:34:36 +0000 |
commit | 586a5f786f9af3ddccdb6eba16fd529a5e88ed4c (patch) | |
tree | a889bda9cdb4e705ef7bf50ea2a0a8e53b33a3bc /kiosktool/kcms | |
parent | 281b2113b209bd51bd923ad8f289f4041ff03a0f (diff) | |
download | kiosktool-586a5f786f9af3ddccdb6eba16fd529a5e88ed4c.tar.gz kiosktool-586a5f786f9af3ddccdb6eba16fd529a5e88ed4c.zip |
Raw TQt conversion of kiosktool
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kiosktool@1258970 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kiosktool/kcms')
-rw-r--r-- | kiosktool/kcms/autostart/kcmautostart.cpp | 78 | ||||
-rw-r--r-- | kiosktool/kcms/autostart/kcmautostart.h | 24 |
2 files changed, 52 insertions, 50 deletions
diff --git a/kiosktool/kcms/autostart/kcmautostart.cpp b/kiosktool/kcms/autostart/kcmautostart.cpp index 7a553bb..9866a94 100644 --- a/kiosktool/kcms/autostart/kcmautostart.cpp +++ b/kiosktool/kcms/autostart/kcmautostart.cpp @@ -18,13 +18,13 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qlayout.h> -#include <qwhatsthis.h> -#include <qvgroupbox.h> -#include <qpushbutton.h> -#include <qheader.h> -#include <qtimer.h> -#include <qfileinfo.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqvgroupbox.h> +#include <tqpushbutton.h> +#include <tqheader.h> +#include <tqtimer.h> +#include <tqfileinfo.h> #include <kaboutdata.h> #include <kapplication.h> @@ -44,10 +44,10 @@ Boston, MA 02111-1307, USA. #include "kcmautostart.h" #include "kcmautostart.moc" -typedef KGenericFactory<AutoStartConfig, QWidget> AutoStartFactory; +typedef KGenericFactory<AutoStartConfig, TQWidget> AutoStartFactory; K_EXPORT_COMPONENT_FACTORY( kcm_autostart, AutoStartFactory( "kcmautostart" ) ) -AutoStartConfig::AutoStartConfig(QWidget* parent, const char* name, const QStringList &) : +AutoStartConfig::AutoStartConfig(TQWidget* parent, const char* name, const TQStringList &) : KCModule( AutoStartFactory::instance(), parent, name ) { KGlobal::dirs()->addResourceType("autostart", "share/autostart"); @@ -60,10 +60,10 @@ AutoStartConfig::AutoStartConfig(QWidget* parent, const char* name, const QStrin setAboutData( about ); #endif - QVBoxLayout *lay = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *lay = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - QGroupBox *gb = new QVGroupBox( i18n( "Startup Services" ), this ); - QWhatsThis::add(gb, i18n("This shows all KDE services that can be loaded " + TQGroupBox *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 ); @@ -78,9 +78,9 @@ AutoStartConfig::AutoStartConfig(QWidget* parent, const char* name, const QStrin 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); @@ -88,16 +88,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").tqarg(module)); } -bool AutoStartConfig::autoloadEnabled(KConfig *config, const QString &filename) +bool AutoStartConfig::autoloadEnabled(KConfig *config, const TQString &filename) { setModuleGroup(config, filename); return config->readBoolEntry("autoload", true); } -void AutoStartConfig::setAutoloadEnabled(KConfig *config, const QString &filename, bool b) +void AutoStartConfig::setAutoloadEnabled(KConfig *config, const TQString &filename, bool b) { setModuleGroup(config, filename); return config->writeEntry("autoload", b); @@ -106,18 +106,18 @@ void AutoStartConfig::setAutoloadEnabled(KConfig *config, const QString &filenam void AutoStartConfig::load() { _lvStartup->clear(); - QStringList files = KGlobal::dirs()->findAllResources( "autostart", QString::fromLatin1( "*.desktop" ), false, true ); + TQStringList files = KGlobal::dirs()->findAllResources( "autostart", TQString::tqfromLatin1( "*.desktop" ), false, true ); - for ( QStringList::ConstIterator it = files.begin(); it != files.end(); it++ ) + for ( TQStringList::ConstIterator it = files.begin(); it != files.end(); it++ ) { - if ( KDesktopFile::isDesktopFile( QFileInfo( *it ).fileName() ) ) + if ( KDesktopFile::isDesktopFile( TQFileInfo( *it ).fileName() ) ) { - KDesktopFile file( QFileInfo( *it ).fileName(), true, "autostart" ); - QString name = file.readName(); + KDesktopFile file( TQFileInfo( *it ).fileName(), true, "autostart" ); + TQString name = file.readName(); if ( !name.isEmpty() ) { - CheckListItem *clitem = new CheckListItem( _lvStartup, QString::null ); - connect( clitem, SIGNAL( changed( QCheckListItem * ) ), SLOT( slotItemChecked( QCheckListItem * ) ) ); + CheckListItem *clitem = new CheckListItem( _lvStartup, TQString() ); + connect( clitem, TQT_SIGNAL( changed( TQCheckListItem * ) ), TQT_SLOT( slotItemChecked( TQCheckListItem * ) ) ); clitem->setText( 1, name ); clitem->setText( 2, file.readComment() ); clitem->setText( 3, *it ); @@ -129,19 +129,19 @@ void AutoStartConfig::load() { void AutoStartConfig::save() { - QListViewItemIterator it( _lvStartup ); + TQListViewItemIterator it( _lvStartup ); while ( it.current() ) { if ( KDesktopFile::isDesktopFile( it.current()->text( 3 ) ) ) { // Determine whether we need to change the file on a readonly desktop file // by giving a full path first - QString path = it.current()->text( 3 ); + TQString path = it.current()->text( 3 ); KDesktopFile file( path, true, "services" ); - bool shouldBeHidden = !( static_cast<QCheckListItem *>( it.current() )->isOn() ); + bool shouldBeHidden = !( static_cast<TQCheckListItem *>( it.current() )->isOn() ); if ( file.readBoolEntry( "Hidden", false ) != shouldBeHidden ) { - KDesktopFile outFile( QFileInfo( path ).fileName(), false, "autostart" ); + KDesktopFile outFile( TQFileInfo( path ).fileName(), false, "autostart" ); kdDebug() << "************** Writing out " << path << endl; outFile.writeEntry( "Hidden", shouldBeHidden ); outFile.sync(); @@ -150,15 +150,15 @@ void AutoStartConfig::save() ++it; } - //QTimer::singleShot(0, this, SLOT(slotServiceRunningToggled())); + //TQTimer::singleShot(0, this, TQT_SLOT(slotServiceRunningToggled())); } void AutoStartConfig::defaults() { - QListViewItemIterator it( _lvStartup); + TQListViewItemIterator it( _lvStartup); while ( it.current() != 0 ) { if (it.current()->rtti()==1) { - QCheckListItem *item = static_cast<QCheckListItem *>(it.current()); + TQCheckListItem *item = static_cast<TQCheckListItem *>(it.current()); item->setOn(false); } ++it; @@ -167,19 +167,19 @@ void AutoStartConfig::defaults() void AutoStartConfig::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 AutoStartConfig::slotItemChecked(QCheckListItem*) +void AutoStartConfig::slotItemChecked(TQCheckListItem*) { emit changed(true); } -QString AutoStartConfig::quickHelp() const +TQString AutoStartConfig::quickHelp() const { return i18n("<h1>Service Manager</h1><p>This module allows you to have an overview of all plugins of the " "KDE Daemon, also referred to as KDE Services. Generally, there are two types of service:</p>" @@ -190,13 +190,13 @@ QString AutoStartConfig::quickHelp() const " do not know what you are doing.</b></p>"); } -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); } diff --git a/kiosktool/kcms/autostart/kcmautostart.h b/kiosktool/kcms/autostart/kcmautostart.h index dfb5eba..6fe07c8 100644 --- a/kiosktool/kcms/autostart/kcmautostart.h +++ b/kiosktool/kcms/autostart/kcmautostart.h @@ -19,45 +19,47 @@ #ifndef KCMAUTOSTART_H #define KCMAUTOSTART_H -#include <qlistview.h> +#include <tqlistview.h> #include <kcmodule.h> class KListView; -class QStringList; -class QPushButton; +class TQStringList; +class TQPushButton; class AutoStartConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - AutoStartConfig(QWidget* parent, const char* name= 0L, const QStringList& foo = QStringList()); + AutoStartConfig(TQWidget* parent, const char* name= 0L, const TQStringList& foo = TQStringList()); ~AutoStartConfig() {}; void load(); void save(); void defaults(); - QString quickHelp() const; + TQString quickHelp() const; protected slots: void slotReload(); - void slotItemChecked(QCheckListItem *item); + void slotItemChecked(TQCheckListItem *item); - bool autoloadEnabled(KConfig *config, const QString &filename); - void setAutoloadEnabled(KConfig *config, const QString &filename, bool b); + bool autoloadEnabled(KConfig *config, const TQString &filename); + void setAutoloadEnabled(KConfig *config, const TQString &filename, bool b); private: KListView *_lvStartup; }; -class CheckListItem : public QObject, public QCheckListItem +class CheckListItem : public TQObject, public TQCheckListItem { Q_OBJECT + TQ_OBJECT public: - CheckListItem(QListView* parent, const QString &text); + CheckListItem(TQListView* parent, const TQString &text); ~CheckListItem() { } signals: - void changed(QCheckListItem*); + void changed(TQCheckListItem*); protected: virtual void stateChange(bool); }; |