From 5f5ee2367157176ed223b86343eb0a9e4022e020 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:52:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1157653 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdelirc/irkick/irkick.cpp | 106 +++++++++++++-------------- kdelirc/irkick/irkick.h | 30 ++++---- kdelirc/irkick/kdedmodule_stub.h | 6 +- kdelirc/irkick/klircclient.cpp | 54 +++++++------- kdelirc/irkick/klircclient.h | 26 +++---- kdelirc/kcmlirc/addaction.cpp | 106 +++++++++++++-------------- kdelirc/kcmlirc/addaction.h | 24 +++--- kdelirc/kcmlirc/editaction.cpp | 72 +++++++++--------- kdelirc/kcmlirc/editaction.h | 12 +-- kdelirc/kcmlirc/editmode.cpp | 4 +- kdelirc/kcmlirc/editmode.h | 4 +- kdelirc/kcmlirc/kcmlirc.cpp | 150 +++++++++++++++++++------------------- kdelirc/kcmlirc/kcmlirc.h | 26 +++---- kdelirc/kcmlirc/kcmlircbase.ui.h | 2 +- kdelirc/kcmlirc/modeslist.cpp | 6 +- kdelirc/kcmlirc/modeslist.h | 4 +- kdelirc/kcmlirc/newmode.ui.h | 2 +- kdelirc/kdelirc/arguments.cpp | 8 +- kdelirc/kdelirc/arguments.h | 8 +- kdelirc/kdelirc/iraction.cpp | 42 +++++------ kdelirc/kdelirc/iraction.h | 42 +++++------ kdelirc/kdelirc/iractions.cpp | 12 +-- kdelirc/kdelirc/iractions.h | 22 +++--- kdelirc/kdelirc/mode.cpp | 10 +-- kdelirc/kdelirc/mode.h | 20 ++--- kdelirc/kdelirc/modes.cpp | 22 +++--- kdelirc/kdelirc/modes.h | 24 +++--- kdelirc/kdelirc/profileserver.cpp | 34 ++++----- kdelirc/kdelirc/profileserver.h | 100 ++++++++++++------------- kdelirc/kdelirc/prototype.cpp | 18 ++--- kdelirc/kdelirc/prototype.h | 34 ++++----- kdelirc/kdelirc/remoteserver.cpp | 22 +++--- kdelirc/kdelirc/remoteserver.h | 62 ++++++++-------- 33 files changed, 557 insertions(+), 557 deletions(-) (limited to 'kdelirc') diff --git a/kdelirc/irkick/irkick.cpp b/kdelirc/irkick/irkick.cpp index 31ec93c..fdcfa3a 100644 --- a/kdelirc/irkick/irkick.cpp +++ b/kdelirc/irkick/irkick.cpp @@ -7,12 +7,12 @@ // This program is free software. -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -42,12 +42,12 @@ #include "profileserver.h" #include "irkick.h" -void IRKTrayIcon::mousePressEvent(QMouseEvent *e) +void IRKTrayIcon::mousePressEvent(TQMouseEvent *e) { - KSystemTray::mousePressEvent(new QMouseEvent(QEvent::MouseButtonPress, e->pos(), e->globalPos(), e->button() == LeftButton ? RightButton : e->button(), e->state())); + KSystemTray::mousePressEvent(new TQMouseEvent(TQEvent::MouseButtonPress, e->pos(), e->globalPos(), e->button() == LeftButton ? RightButton : e->button(), e->state())); } -IRKick::IRKick(const QCString &obj) : QObject(), DCOPObject(obj), npApp(QString::null) +IRKick::IRKick(const TQCString &obj) : TQObject(), DCOPObject(obj), npApp(TQString::null) { kapp->dcopClient()->setDefaultObject(obj); theClient = new KLircClient(); @@ -55,28 +55,28 @@ IRKick::IRKick(const QCString &obj) : QObject(), DCOPObject(obj), npApp(QString: theTrayIcon = new IRKTrayIcon(); if(theClient->isConnected()) { theTrayIcon->setPixmap(SmallIcon("irkick")); - QToolTip::add(theTrayIcon, i18n("KDE Lirc Server: Ready.")); + TQToolTip::add(theTrayIcon, i18n("KDE Lirc Server: Ready.")); } else { theTrayIcon->setPixmap(SmallIcon("irkickoff")); - QToolTip::add(theTrayIcon, i18n("KDE Lirc Server: No infra-red remote controls found.")); - QTimer::singleShot(10000, this, SLOT(checkLirc())); + TQToolTip::add(theTrayIcon, i18n("KDE Lirc Server: No infra-red remote controls found.")); + TQTimer::singleShot(10000, this, TQT_SLOT(checkLirc())); } - theFlashOff = new QTimer(theTrayIcon); - connect(theFlashOff, SIGNAL(timeout()), SLOT(flashOff())); + theFlashOff = new TQTimer(theTrayIcon); + connect(theFlashOff, TQT_SIGNAL(timeout()), TQT_SLOT(flashOff())); theResetCount = 0; slotReloadConfiguration(); - connect(theClient, SIGNAL(connectionClosed()), this, SLOT(slotClosed())); - connect(theClient, SIGNAL(remotesRead()), this, SLOT(resetModes())); - connect(theClient, SIGNAL(commandReceived(const QString &, const QString &, int)), this, SLOT(gotMessage(const QString &, const QString &, int))); + connect(theClient, TQT_SIGNAL(connectionClosed()), this, TQT_SLOT(slotClosed())); + connect(theClient, TQT_SIGNAL(remotesRead()), this, TQT_SLOT(resetModes())); + connect(theClient, TQT_SIGNAL(commandReceived(const TQString &, const TQString &, int)), this, TQT_SLOT(gotMessage(const TQString &, const TQString &, int))); theTrayIcon->contextMenu()->changeTitle(0, "IRKick"); - theTrayIcon->contextMenu()->insertItem(SmallIcon( "configure" ), i18n("&Configure..."), this, SLOT(slotConfigure())); + theTrayIcon->contextMenu()->insertItem(SmallIcon( "configure" ), i18n("&Configure..."), this, TQT_SLOT(slotConfigure())); theTrayIcon->contextMenu()->insertSeparator(); theTrayIcon->contextMenu()->insertItem(SmallIcon( "help" ), KStdGuiItem::help().text(), (new KHelpMenu(theTrayIcon, KGlobal::instance()->aboutData()))->menu()); - theTrayIcon->actionCollection()->action("file_quit")->disconnect(SIGNAL(activated())); - connect(theTrayIcon->actionCollection()->action("file_quit"), SIGNAL(activated()), SLOT(doQuit())); + theTrayIcon->actionCollection()->action("file_quit")->disconnect(TQT_SIGNAL(activated())); + connect(theTrayIcon->actionCollection()->action("file_quit"), TQT_SIGNAL(activated()), TQT_SLOT(doQuit())); theTrayIcon->show(); } @@ -84,7 +84,7 @@ IRKick::IRKick(const QCString &obj) : QObject(), DCOPObject(obj), npApp(QString: IRKick::~IRKick() { delete theTrayIcon; - for(QMap::iterator i = currentModeIcons.begin(); i != currentModeIcons.end(); ++i) + for(TQMap::iterator i = currentModeIcons.begin(); i != currentModeIcons.end(); ++i) if(*i) delete *i; } @@ -92,7 +92,7 @@ void IRKick::slotClosed() { theTrayIcon->setPixmap(SmallIcon("irkickoff")); KPassivePopup::message("IRKick", i18n("The infrared system has severed its connection. Remote controls are no longer available."), SmallIcon("irkick"), theTrayIcon); - QTimer::singleShot(1000, this, SLOT(checkLirc())); + TQTimer::singleShot(1000, this, TQT_SLOT(checkLirc())); } void IRKick::checkLirc() @@ -103,7 +103,7 @@ void IRKick::checkLirc() theTrayIcon->setPixmap(SmallIcon("irkick")); } else - QTimer::singleShot(10000, this, SLOT(checkLirc())); + TQTimer::singleShot(10000, this, TQT_SLOT(checkLirc())); } void IRKick::flashOff() @@ -130,8 +130,8 @@ void IRKick::resetModes() if(!theResetCount) allModes.generateNulls(theClient->remotes()); - QStringList remotes = theClient->remotes(); - for(QStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) + TQStringList remotes = theClient->remotes(); + for(TQStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) { currentModes[*i] = allModes.getDefault(*i).name(); if(theResetCount && currentModeIcons[*i]) delete currentModeIcons[*i]; currentModeIcons[*i] = 0; @@ -157,7 +157,7 @@ void IRKick::slotConfigure() void IRKick::updateModeIcons() { - for(QMap::iterator i = currentModes.begin(); i != currentModes.end(); ++i) + for(TQMap::iterator i = currentModes.begin(); i != currentModes.end(); ++i) { Mode mode = allModes.getMode(i.key(), i.data()); if(mode.iconFile().isNull() || mode.iconFile().isEmpty()) { if(currentModeIcons[i.key()]) @@ -173,12 +173,12 @@ void IRKick::updateModeIcons() currentModeIcons[i.key()]->actionCollection()->action("file_quit")->setEnabled(false); } currentModeIcons[i.key()]->setPixmap(KIconLoader().loadIcon(mode.iconFile(), KIcon::Panel)); - QToolTip::add(currentModeIcons[i.key()], mode.remoteName() + ": " + mode.name() + ""); + TQToolTip::add(currentModeIcons[i.key()], mode.remoteName() + ": " + mode.name() + ""); } } } -bool IRKick::getPrograms(const IRAction &action, QStringList &programs) +bool IRKick::getPrograms(const IRAction &action, TQStringList &programs) { DCOPClient *theDC = KApplication::dcopClient(); programs.clear(); @@ -189,23 +189,23 @@ bool IRKick::getPrograms(const IRAction &action, QStringList &programs) } else { - QRegExp r = QRegExp("^" + action.program() + "-(\\d+)$"); + TQRegExp r = TQRegExp("^" + action.program() + "-(\\d+)$"); // find all instances... QCStringList buf = theDC->registeredApplications(); for(QCStringList::iterator i = buf.begin(); i != buf.end(); ++i) { - QString program = QString::fromUtf8(*i); + TQString program = TQString::fromUtf8(*i); if(program.contains(r)) programs += program; } if(programs.size() > 1 && action.ifMulti() == IM_DONTSEND) return false; else if(programs.size() > 1 && action.ifMulti() == IM_SENDTOTOP) - { QValueList s = KWinModule().stackingOrder(); + { TQValueList s = KWinModule().stackingOrder(); // go through all the (ordered) window pids - for(QValueList::iterator i = s.fromLast(); i != s.end(); i--) + for(TQValueList::iterator i = s.fromLast(); i != s.end(); i--) { int p = KWin::info(*i).pid; - QString id = action.program() + "-" + QString().setNum(p); + TQString id = action.program() + "-" + TQString().setNum(p); if(programs.contains(id)) { programs.clear(); programs += id; @@ -215,11 +215,11 @@ bool IRKick::getPrograms(const IRAction &action, QStringList &programs) while(programs.size() > 1) programs.remove(programs.begin()); } else if(programs.size() > 1 && action.ifMulti() == IM_SENDTOBOTTOM) - { QValueList s = KWinModule().stackingOrder(); + { TQValueList s = KWinModule().stackingOrder(); // go through all the (ordered) window pids - for(QValueList::iterator i = s.begin(); i != s.end(); ++i) + for(TQValueList::iterator i = s.begin(); i != s.end(); ++i) { int p = KWin::info(*i).pid; - QString id = action.program() + "-" + QString().setNum(p); + TQString id = action.program() + "-" + TQString().setNum(p); if(programs.contains(id)) { programs.clear(); programs += id; @@ -235,13 +235,13 @@ bool IRKick::getPrograms(const IRAction &action, QStringList &programs) void IRKick::executeAction(const IRAction &action) { DCOPClient *theDC = KApplication::dcopClient(); - QStringList programs; + TQStringList programs; if(!getPrograms(action, programs)) return; // if programs.size()==0 here, then the app is definately not running. if(action.autoStart() && !programs.size()) - { QString sname = ProfileServer::profileServer()->getServiceName(action.program()); + { TQString sname = ProfileServer::profileServer()->getServiceName(action.program()); if(!sname.isNull()) { KPassivePopup::message("IRKick", i18n("Starting %1...").arg(action.application()), SmallIcon("irkick"), theTrayIcon); @@ -252,20 +252,20 @@ void IRKick::executeAction(const IRAction &action) if(!getPrograms(action, programs)) return; - for(QStringList::iterator i = programs.begin(); i != programs.end(); ++i) - { const QString &program = *i; + for(TQStringList::iterator i = programs.begin(); i != programs.end(); ++i) + { const TQString &program = *i; if(theDC->isApplicationRegistered(program.utf8())) - { QByteArray data; QDataStream arg(data, IO_WriteOnly); + { TQByteArray data; TQDataStream arg(data, IO_WriteOnly); kdDebug() << "Sending data (" << program << ", " << action.object() << ", " << action.method().prototypeNR() << endl; for(Arguments::const_iterator j = action.arguments().begin(); j != action.arguments().end(); ++j) { kdDebug() << "Got argument..." << endl; switch((*j).type()) - { case QVariant::Int: arg << (*j).toInt(); break; - case QVariant::CString: arg << (*j).toCString(); break; - case QVariant::StringList: arg << (*j).toStringList(); break; - case QVariant::UInt: arg << (*j).toUInt(); break; - case QVariant::Bool: arg << (*j).toBool(); break; - case QVariant::Double: arg << (*j).toDouble(); break; + { case TQVariant::Int: arg << (*j).toInt(); break; + case TQVariant::CString: arg << (*j).toCString(); break; + case TQVariant::StringList: arg << (*j).toStringList(); break; + case TQVariant::UInt: arg << (*j).toUInt(); break; + case TQVariant::Bool: arg << (*j).toBool(); break; + case TQVariant::Double: arg << (*j).toDouble(); break; default: arg << (*j).toString(); break; } } @@ -274,17 +274,17 @@ void IRKick::executeAction(const IRAction &action) } } -void IRKick::gotMessage(const QString &theRemote, const QString &theButton, int theRepeatCounter) +void IRKick::gotMessage(const TQString &theRemote, const TQString &theButton, int theRepeatCounter) { kdDebug() << "Got message: " << theRemote << ": " << theButton << " (" << theRepeatCounter << ")" << endl; theTrayIcon->setPixmap(SmallIcon("irkickflash")); theFlashOff->start(200, true); if(!npApp.isNull()) { - QString theApp = npApp; - npApp = QString::null; + TQString theApp = npApp; + npApp = TQString::null; // send notifier by DCOP to npApp/npModule/npMethod(theRemote, theButton); - QByteArray data; QDataStream arg(data, IO_WriteOnly); + TQByteArray data; TQDataStream arg(data, IO_WriteOnly); arg << theRemote << theButton; KApplication::dcopClient()->send(theApp.utf8(), npModule.utf8(), npMethod.utf8(), data); } @@ -321,7 +321,7 @@ void IRKick::gotMessage(const QString &theRemote, const QString &theButton, int } } -void IRKick::stealNextPress(QString app, QString module, QString method) +void IRKick::stealNextPress(TQString app, TQString module, TQString method) { npApp = app; npModule = module; @@ -330,7 +330,7 @@ void IRKick::stealNextPress(QString app, QString module, QString method) void IRKick::dontStealNextPress() { - npApp = QString::null; + npApp = TQString::null; } #include "irkick.moc" diff --git a/kdelirc/irkick/irkick.h b/kdelirc/irkick/irkick.h index 875d039..bdcb57e 100644 --- a/kdelirc/irkick/irkick.h +++ b/kdelirc/irkick/irkick.h @@ -14,7 +14,7 @@ #ifndef __IRKICK_H #define __IRKICK_H -#include +#include #include #include @@ -30,30 +30,30 @@ class QMouseEvent; class IRKTrayIcon: public KSystemTray { - void mousePressEvent(QMouseEvent *e); + void mousePressEvent(TQMouseEvent *e); public: KPopupMenu* contextMenu() const { return KSystemTray::contextMenu(); } KActionCollection* actionCollection() { return KSystemTray::actionCollection(); } - IRKTrayIcon(QWidget *parent = 0, const char *name = 0): KSystemTray(parent, name) {} + IRKTrayIcon(TQWidget *parent = 0, const char *name = 0): KSystemTray(parent, name) {} }; -class IRKick: public QObject, public DCOPObject +class IRKick: public TQObject, public DCOPObject { Q_OBJECT K_DCOP - QString npApp, npModule, npMethod; - QMap currentModes; - QMap currentModeIcons; + TQString npApp, npModule, npMethod; + TQMap currentModes; + TQMap currentModeIcons; IRActions allActions; int theResetCount; Modes allModes; IRKTrayIcon *theTrayIcon; KAboutData *aboutData; - QTimer *theFlashOff; + TQTimer *theFlashOff; void updateModeIcons(); @@ -82,23 +82,23 @@ k_dcop: * * @returns said list. */ - virtual const QStringList remotes() { return theClient->remotes(); } + virtual const TQStringList remotes() { return theClient->remotes(); } /** * Retrieve list of buttons of a praticular remote control. * * @returns said list. */ - virtual const QStringList buttons(QString theRemote) { return theClient->buttons(theRemote); } + virtual const TQStringList buttons(TQString theRemote) { return theClient->buttons(theRemote); } /** * Sends next keypress to given application by DCOP. * * @param The receiving application. * @param The receiving application module. - * @param The method name. Must have two QString parameters. + * @param The method name. Must have two TQString parameters. */ - virtual void stealNextPress(QString app, QString module, QString method); + virtual void stealNextPress(TQString app, TQString module, TQString method); /** * Cancels the proceedings of the previous stealNextPress call, if any. @@ -111,7 +111,7 @@ k_dcop: virtual void reloadConfiguration() { slotReloadConfiguration(); } private slots: - void gotMessage(const QString &theRemote, const QString &theButton, int theRepeatCounter); + void gotMessage(const TQString &theRemote, const TQString &theButton, int theRepeatCounter); void resetModes(); void doQuit(); void flashOff(); @@ -122,10 +122,10 @@ private slots: void slotClosed(); private: void executeAction(const IRAction &action); - bool getPrograms(const IRAction &action, QStringList &populous); + bool getPrograms(const IRAction &action, TQStringList &populous); public: - IRKick(const QCString &obj); + IRKick(const TQCString &obj); virtual ~IRKick(); }; diff --git a/kdelirc/irkick/kdedmodule_stub.h b/kdelirc/irkick/kdedmodule_stub.h index 5f248f8..86f4640 100644 --- a/kdelirc/irkick/kdedmodule_stub.h +++ b/kdelirc/irkick/kdedmodule_stub.h @@ -14,7 +14,7 @@ #define __KDEDMODULE_STUB__ #include -#include +#include #include #include #include @@ -23,8 +23,8 @@ class KDEDModule_stub : virtual public DCOPStub { public: - KDEDModule_stub( const QCString& app, const QCString& id ); - KDEDModule_stub( DCOPClient* client, const QCString& app, const QCString& id ); + KDEDModule_stub( const TQCString& app, const TQCString& id ); + KDEDModule_stub( DCOPClient* client, const TQCString& app, const TQCString& id ); explicit KDEDModule_stub( const DCOPRef& ref ); protected: KDEDModule_stub() : DCOPStub( never_use ) {}; diff --git a/kdelirc/irkick/klircclient.cpp b/kdelirc/irkick/klircclient.cpp index 2876079..897d8fc 100644 --- a/kdelirc/irkick/klircclient.cpp +++ b/kdelirc/irkick/klircclient.cpp @@ -19,12 +19,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,7 +43,7 @@ #include "klircclient.h" -KLircClient::KLircClient(QWidget *parent, const char *name) : QObject(parent, name), theSocket(0), listIsUpToDate(false) +KLircClient::KLircClient(TQWidget *parent, const char *name) : TQObject(parent, name), theSocket(0), listIsUpToDate(false) { connectToLirc(); } @@ -68,8 +68,8 @@ bool KLircClient::connectToLirc() theSocket = new QSocket; theSocket->setSocket(sock); - connect(theSocket, SIGNAL(readyRead()), SLOT(slotRead())); - connect(theSocket, SIGNAL(connectionClosed()), SLOT(slotClosed())); + connect(theSocket, TQT_SIGNAL(readyRead()), TQT_SLOT(slotRead())); + connect(theSocket, TQT_SIGNAL(connectionClosed()), TQT_SLOT(slotClosed())); updateRemotes(); return true; } @@ -87,16 +87,16 @@ void KLircClient::slotClosed() emit connectionClosed(); } -const QStringList KLircClient::remotes() const +const TQStringList KLircClient::remotes() const { - QStringList remotes; - for(QMap::ConstIterator i = theRemotes.begin(); i != theRemotes.end(); ++i) + TQStringList remotes; + for(TQMap::ConstIterator i = theRemotes.begin(); i != theRemotes.end(); ++i) remotes.append(i.key()); remotes.sort(); return remotes; } -const QStringList KLircClient::buttons(const QString &theRemote) const +const TQStringList KLircClient::buttons(const TQString &theRemote) const { return theRemotes[theRemote]; } @@ -105,7 +105,7 @@ void KLircClient::slotRead() { while (theSocket->bytesAvailable()) { - QString line = readLine(); + TQString line = readLine(); if (line == "BEGIN") { // BEGIN @@ -133,7 +133,7 @@ void KLircClient::slotRead() while (!line.isEmpty() && line != "END"); return; } - QStringList remotes; + TQStringList remotes; int count = readLine().toInt(); for (int i = 0; i < count; ++i) remotes.append(readLine()); @@ -141,7 +141,7 @@ void KLircClient::slotRead() while (!line.isEmpty() && line != "END"); if (line.isEmpty()) return; // abort on corrupt data - for (QStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it) + for (TQStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it) sendCommand("LIST " + *it); return; } @@ -154,13 +154,13 @@ void KLircClient::slotRead() while (!line.isEmpty() && line != "END"); return; } - QString remote = line.mid(5); - QStringList buttons; + TQString remote = line.mid(5); + TQStringList buttons; int count = readLine().toInt(); for (int i = 0; i < count; ++i) { // - QString btn = readLine().mid(17); + TQString btn = readLine().mid(17); if(btn.isNull()) break; if(btn.startsWith("'") && btn.endsWith("'")) btn = btn.mid(1, btn.length() - 2); @@ -186,7 +186,7 @@ void KLircClient::slotRead() pos = line.find(' '); if (pos < 0) return; - QString btn = line.left(pos); + TQString btn = line.left(pos); if(btn.startsWith("'") && btn.endsWith("'")) btn = btn.mid(1, btn.length() - 2); line.remove(0, pos + 1); @@ -206,7 +206,7 @@ void KLircClient::updateRemotes() bool KLircClient::isConnected() const { if(!theSocket) return false; - return theSocket->state() == QSocket::Connected; + return theSocket->state() == TQSocket::Connected; } bool KLircClient::haveFullList() const @@ -214,7 +214,7 @@ bool KLircClient::haveFullList() const return listIsUpToDate; } -const QString KLircClient::readLine() +const TQString KLircClient::readLine() { if (!theSocket->canReadLine()) { bool timeout; @@ -223,18 +223,18 @@ const QString KLircClient::readLine() theSocket->waitForMore(500, &timeout); if (timeout) { // something's wrong. there ain't no line comin! - return QString::null; + return TQString::null; } } - QString line = theSocket->readLine(); + TQString line = theSocket->readLine(); line.truncate(line.length() - 1); return line; } -void KLircClient::sendCommand(const QString &command) +void KLircClient::sendCommand(const TQString &command) { - QString cmd = command + "\n"; - theSocket->writeBlock(QFile::encodeName( cmd ), cmd.length()); + TQString cmd = command + "\n"; + theSocket->writeBlock(TQFile::encodeName( cmd ), cmd.length()); } diff --git a/kdelirc/irkick/klircclient.h b/kdelirc/irkick/klircclient.h index ea5fa75..30f5fe5 100644 --- a/kdelirc/irkick/klircclient.h +++ b/kdelirc/irkick/klircclient.h @@ -13,10 +13,10 @@ #ifndef KLIRCCLIENT_H #define KLIRCCLIENT_H -#include -#include -#include -#include +#include +#include +#include +#include class QSocket; class QSocketNotifier; @@ -32,14 +32,14 @@ class KLircClient: public QObject private: struct lirc_config *theConfig; - QSocket *theSocket; - QSocketNotifier *theNotifier; - QMap theRemotes; + TQSocket *theSocket; + TQSocketNotifier *theNotifier; + TQMap theRemotes; bool listIsUpToDate; void updateRemotes(); - void sendCommand(const QString &command); - const QString readLine(); + void sendCommand(const TQString &command); + const TQString readLine(); private slots: void slotRead(); @@ -62,7 +62,7 @@ signals: * The repeat counter starts with 0 and increases * every time this signal is emitted. */ - void commandReceived(const QString &remote, const QString &button, int repeatCounter); + void commandReceived(const TQString &remote, const TQString &button, int repeatCounter); /** * Emitted when the Lirc connection is closed. @@ -91,14 +91,14 @@ public: * * @returns said list. */ - const QStringList remotes() const; + const TQStringList remotes() const; /** * Retrieve list of buttons of a praticular remote control. * * @returns said list. */ - const QStringList buttons(const QString &theRemote) const; + const TQStringList buttons(const TQString &theRemote) const; /** * Connects to lirc. @@ -107,7 +107,7 @@ public: */ bool connectToLirc(); - KLircClient(QWidget *parent = 0, const char *name = 0); + KLircClient(TQWidget *parent = 0, const char *name = 0); ~KLircClient(); }; diff --git a/kdelirc/kcmlirc/addaction.cpp b/kdelirc/kcmlirc/addaction.cpp index 1a3ecef..f2d6ad3 100644 --- a/kdelirc/kcmlirc/addaction.cpp +++ b/kdelirc/kcmlirc/addaction.cpp @@ -8,12 +8,12 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -32,10 +32,10 @@ #include "profileserver.h" #include "remoteserver.h" -AddAction::AddAction(QWidget *parent, const char *name, const Mode &mode): AddActionBase(parent, name), theMode(mode) +AddAction::AddAction(TQWidget *parent, const char *name, const Mode &mode): AddActionBase(parent, name), theMode(mode) { - connect(this, SIGNAL( selected(const QString &) ), SLOT( updateForPageChange() )); - connect(this, SIGNAL( selected(const QString &) ), SLOT( slotCorrectPage() )); + connect(this, TQT_SIGNAL( selected(const TQString &) ), TQT_SLOT( updateForPageChange() )); + connect(this, TQT_SIGNAL( selected(const TQString &) ), TQT_SLOT( slotCorrectPage() )); curPage = 0; updateProfiles(); updateButtons(); @@ -64,23 +64,23 @@ void AddAction::slotCorrectPage() curPage = indexOf(currentPage()); if(curPage == 2 && theUseProfile->isChecked()) - showPage(((QWizard *)this)->page(lastPage > 1 ? 1 : 3)); + showPage(((TQWizard *)this)->page(lastPage > 1 ? 1 : 3)); if((curPage == 2 || curPage == 5) && theChangeMode->isChecked()) - showPage(((QWizard *)this)->page(lastPage > 1 ? 1 : 6)); + showPage(((TQWizard *)this)->page(lastPage > 1 ? 1 : 6)); if(curPage == 3 && theUseDCOP->isChecked()) - showPage(((QWizard *)this)->page(lastPage == 4 ? 2 : 4)); + showPage(((TQWizard *)this)->page(lastPage == 4 ? 2 : 4)); if(curPage == 4 && ( (theUseDCOP->isChecked() && theFunctions->currentItem() && !Prototype(theFunctions->currentItem()->text(2)).count()) || (theUseProfile->isChecked() && (theProfileFunctions->currentItem() && !theProfileFunctions->currentItem()->text(1).toInt() || theJustStart->isChecked())) )) - showPage(((QWizard *)this)->page(lastPage == 5 ? (theUseDCOP->isChecked() ? 2 : 3) : 5)); + showPage(((TQWizard *)this)->page(lastPage == 5 ? (theUseDCOP->isChecked() ? 2 : 3) : 5)); } void AddAction::requestNextPress() { - IRKick_stub("irkick", "IRKick").stealNextPress(DCOPClient::mainClient()->appId(), "KCMLirc", "gotButton(QString, QString)"); + IRKick_stub("irkick", "IRKick").stealNextPress(DCOPClient::mainClient()->appId(), "KCMLirc", "gotButton(TQString, TQString)"); } void AddAction::cancelRequest() @@ -88,7 +88,7 @@ void AddAction::cancelRequest() IRKick_stub("irkick", "IRKick").dontStealNextPress(); } -void AddAction::updateButton(const QString &remote, const QString &button) +void AddAction::updateButton(const TQString &remote, const TQString &button) { if(theMode.remote() == remote) { // note this isn't the "correct" way of doing it; really i should iterate throughg the items and try to find the item which when put through buttonMap[item] returns the current button name. but i cant be arsed. @@ -109,9 +109,9 @@ void AddAction::updateButtons() theButtons->clear(); buttonMap.clear(); IRKick_stub IRKick("irkick", "IRKick"); - QStringList buttons = IRKick.buttons(theMode.remote()); - for(QStringList::iterator j = buttons.begin(); j != buttons.end(); ++j) - buttonMap[new QListViewItem(theButtons, RemoteServer::remoteServer()->getButtonName(theMode.remote(), *j))] = *j; + TQStringList buttons = IRKick.buttons(theMode.remote()); + for(TQStringList::iterator j = buttons.begin(); j != buttons.end(); ++j) + buttonMap[new TQListViewItem(theButtons, RemoteServer::remoteServer()->getButtonName(theMode.remote(), *j))] = *j; } void AddAction::updateForPageChange() @@ -140,17 +140,17 @@ void AddAction::updateButtonStates() } } -const QStringList AddAction::getFunctions(const QString app, const QString obj) +const TQStringList AddAction::getFunctions(const TQString app, const TQString obj) { - QStringList ret; + TQStringList ret; DCOPClient *theClient = KApplication::kApplication()->dcopClient(); QCStringList theApps = theClient->remoteFunctions(app.utf8(), obj.utf8()); for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i) if( *i != "QCStringList interfaces()" && *i != "QCStringList functions()" && *i != "QCStringList objects()" && - *i != "QCStringList find(QCString)" ) - ret += QString::fromUtf8(*i); + *i != "QCStringList find(TQCString)" ) + ret += TQString::fromUtf8(*i); return ret; } @@ -160,10 +160,10 @@ void AddAction::updateProfiles() theProfiles->clear(); profileMap.clear(); - QDict dict = theServer->profiles(); - QDictIterator i(dict); + TQDict dict = theServer->profiles(); + TQDictIterator i(dict); for(; i.current(); ++i) - profileMap[new QListViewItem(theProfiles, i.current()->name())] = i.currentKey(); + profileMap[new TQListViewItem(theProfiles, i.current()->name())] = i.currentKey(); } void AddAction::updateOptions() @@ -180,10 +180,10 @@ void AddAction::updateOptions() else if(theUseDCOP->isChecked()) { if(!theObjects->selectedItem()) return; - QListViewItem* i = theObjects->selectedItem()->parent(); + TQListViewItem* i = theObjects->selectedItem()->parent(); if(!i) return; isUnique = uniqueProgramMap[i]; - QRegExp r("(.*)-[0-9]+"); + TQRegExp r("(.*)-[0-9]+"); program = r.exactMatch(nameProgramMap[i]) ? r.cap(1) : nameProgramMap[i]; im = IM_DONTSEND; } @@ -213,9 +213,9 @@ void AddAction::updateProfileFunctions() if(!theProfiles->currentItem()) return; const Profile *p = theServer->profiles()[profileMap[theProfiles->currentItem()]]; - QDict dict = p->actions(); - for(QDictIterator i(dict); i.current(); ++i) - profileFunctionMap[new QListViewItem(theProfileFunctions, i.current()->name(), QString().setNum(i.current()->arguments().count()), i.current()->comment())] = i.currentKey(); + TQDict dict = p->actions(); + for(TQDictIterator i(dict); i.current(); ++i) + profileFunctionMap[new TQListViewItem(theProfileFunctions, i.current()->name(), TQString().setNum(i.current()->arguments().count()), i.current()->comment())] = i.currentKey(); updateParameters(); updateOptions(); } @@ -228,9 +228,9 @@ void AddAction::updateParameters() { Prototype p(theFunctions->currentItem()->text(2)); for(unsigned k = 0; k < p.count(); k++) - { new KListViewItem(theParameters, p.name(k).isEmpty() ? i18n( "" ) : p.name(k), "", p.type(k), QString().setNum(k + 1)); - theArguments.append(QVariant("")); - theArguments.back().cast(QVariant::nameToType(p.type(k).utf8())); + { new KListViewItem(theParameters, p.name(k).isEmpty() ? i18n( "" ) : p.name(k), "", p.type(k), TQString().setNum(k + 1)); + theArguments.append(TQVariant("")); + theArguments.back().cast(TQVariant::nameToType(p.type(k).utf8())); } } else if(theUseProfile->isChecked() && theProfiles->currentItem()) @@ -243,10 +243,10 @@ void AddAction::updateParameters() const ProfileAction *pa = p->actions()[profileFunctionMap[theProfileFunctions->currentItem()]]; int index = 1; - for(QValueList::const_iterator i = pa->arguments().begin(); i != pa->arguments().end(); ++i, index++) - { theArguments.append(QVariant((*i).getDefault())); - theArguments.back().cast(QVariant::nameToType((*i).type().utf8())); - new QListViewItem(theParameters, (*i).comment(), theArguments.back().toString(), (*i).type(), QString().setNum(index)); + for(TQValueList::const_iterator i = pa->arguments().begin(); i != pa->arguments().end(); ++i, index++) + { theArguments.append(TQVariant((*i).getDefault())); + theArguments.back().cast(TQVariant::nameToType((*i).type().utf8())); + new TQListViewItem(theParameters, (*i).comment(), theArguments.back().toString(), (*i).type(), TQString().setNum(index)); } // quicky update options too... @@ -260,7 +260,7 @@ void AddAction::updateParameters() void AddAction::updateParameter() { if(theParameters->currentItem()) - { QString type = theParameters->currentItem()->text(2); + { TQString type = theParameters->currentItem()->text(2); int index = theParameters->currentItem()->text(3).toInt() - 1; if(type.find("int") != -1 || type.find("short") != -1 || type.find("long") != -1) { theValue->raiseWidget(2); @@ -274,9 +274,9 @@ void AddAction::updateParameter() { theValue->raiseWidget(1); theValueCheckBox->setChecked(theArguments[index].toBool()); } - else if(type.find("QStringList") != -1) + else if(type.find("TQStringList") != -1) { theValue->raiseWidget(4); - QStringList backup = theArguments[index].toStringList(); + TQStringList backup = theArguments[index].toStringList(); // backup needed because calling clear will kill what ever has been saved. theValueEditListBox->clear(); theValueEditListBox->insertStringList(backup); @@ -306,31 +306,31 @@ void AddAction::slotParameterChanged() { if(!theParameters->currentItem()) return; int index = theParameters->currentItem()->text(3).toInt() - 1; - QString type = theParameters->currentItem()->text(2); + TQString type = theParameters->currentItem()->text(2); if(type.find("int") != -1 || type.find("short") != -1 || type.find("long") != -1) theArguments[index].asInt() = theValueIntNumInput->value(); else if(type.find("double") != -1 || type.find("float") != -1) theArguments[index].asDouble() = theValueDoubleNumInput->value(); else if(type.find("bool") != -1) theArguments[index].asBool() = theValueCheckBox->isChecked(); - else if(type.find("QStringList") != -1) + else if(type.find("TQStringList") != -1) theArguments[index].asStringList() = theValueEditListBox->items(); else theArguments[index].asString() = theValueLineEdit->text(); - theArguments[theParameters->currentItem()->text(3).toInt() - 1].cast(QVariant::nameToType(theParameters->currentItem()->text(2).utf8())); + theArguments[theParameters->currentItem()->text(3).toInt() - 1].cast(TQVariant::nameToType(theParameters->currentItem()->text(2).utf8())); updateArgument(theParameters->currentItem()); } // takes theArguments[theIndex] and puts it into theItem -void AddAction::updateArgument(QListViewItem *theItem) +void AddAction::updateArgument(TQListViewItem *theItem) { theItem->setText(1, theArguments[theItem->text(3).toInt() - 1].toString()); } void AddAction::updateObjects() { - QStringList names; + TQStringList names; theObjects->clear(); uniqueProgramMap.clear(); nameProgramMap.clear(); @@ -339,15 +339,15 @@ void AddAction::updateObjects() QCStringList theApps = theClient->registeredApplications(); for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i) { - if(!QString(*i).find("anonymous")) continue; - if(!QString(*i).find(i18n( "anonymous" ))) continue; - QRegExp r("(.*)-[0-9]+"); - QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i; + if(!TQString(*i).find("anonymous")) continue; + if(!TQString(*i).find(i18n( "anonymous" ))) continue; + TQRegExp r("(.*)-[0-9]+"); + TQString name = r.exactMatch(TQString(*i)) ? r.cap(1) : *i; if(names.contains(name)) continue; names += name; KListViewItem *a = new KListViewItem(theObjects, name); - uniqueProgramMap[a] = name == QString(*i); + uniqueProgramMap[a] = name == TQString(*i); nameProgramMap[a] = *i; QCStringList theObjects = theClient->remoteObjects(*i); @@ -362,9 +362,9 @@ void AddAction::updateFunctions() { theFunctions->clear(); if(theObjects->currentItem() && theObjects->currentItem()->parent()) - { QStringList functions = getFunctions(nameProgramMap[theObjects->currentItem()->parent()], theObjects->currentItem()->text(0)); - for(QStringList::iterator i = functions.begin(); i != functions.end(); ++i) - { Prototype p((QString)(*i)); + { TQStringList functions = getFunctions(nameProgramMap[theObjects->currentItem()->parent()], theObjects->currentItem()->text(0)); + for(TQStringList::iterator i = functions.begin(); i != functions.end(); ++i) + { Prototype p((TQString)(*i)); new KListViewItem(theFunctions, p.name(), p.argumentList(), *i); } } diff --git a/kdelirc/kcmlirc/addaction.h b/kdelirc/kcmlirc/addaction.h index 4d13659..df3d9c7 100644 --- a/kdelirc/kcmlirc/addaction.h +++ b/kdelirc/kcmlirc/addaction.h @@ -10,8 +10,8 @@ #ifndef ADDACTION_H #define ADDACTION_H -#include -#include +#include +#include #include @@ -39,7 +39,7 @@ public slots: // connected to KCMLirc class to receive DCOP calls to tell it what button has been pressed virtual void updateForPageChange(); - virtual void updateButton(const QString &remote, const QString &button); + virtual void updateButton(const TQString &remote, const TQString &button); virtual void updateButtons(); virtual void updateFunctions(); virtual void updateObjects(); @@ -52,21 +52,21 @@ public slots: public: Arguments theArguments; - QString program; + TQString program; bool isUnique; - static const QStringList getFunctions(const QString app, const QString obj); - void updateArgument(QListViewItem *theItem); + static const TQStringList getFunctions(const TQString app, const TQString obj); + void updateArgument(TQListViewItem *theItem); void requestNextPress(); void cancelRequest(); - QMap profileMap; - QMap profileFunctionMap; - QMap buttonMap; - QMap uniqueProgramMap; - QMap nameProgramMap; + TQMap profileMap; + TQMap profileFunctionMap; + TQMap buttonMap; + TQMap uniqueProgramMap; + TQMap nameProgramMap; - AddAction(QWidget *parent, const char *name, const Mode &mode); + AddAction(TQWidget *parent, const char *name, const Mode &mode); ~AddAction(); }; diff --git a/kdelirc/kcmlirc/editaction.cpp b/kdelirc/kcmlirc/editaction.cpp index 5a2a28b..594e4a2 100644 --- a/kdelirc/kcmlirc/editaction.cpp +++ b/kdelirc/kcmlirc/editaction.cpp @@ -10,13 +10,13 @@ // Copyright: See COPYING file that comes with this distribution // // -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -35,7 +35,7 @@ #include "editaction.h" #include "addaction.h" -EditAction::EditAction(IRAIt action, QWidget *parent, const char *name) : EditActionBase(parent, name) +EditAction::EditAction(IRAIt action, TQWidget *parent, const char *name) : EditActionBase(parent, name) { theAction = action; @@ -151,16 +151,16 @@ void EditAction::updateArguments() theArguments->clear(); const ProfileAction *a = ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()]); if(!a) { arguments.clear(); return; } - const QValueList &p = a->arguments(); + const TQValueList &p = a->arguments(); if(p.count() != arguments.count()) { arguments.clear(); for(unsigned i = 0; i < p.count(); i++) - arguments.append(QVariant("")); + arguments.append(TQVariant("")); } theArguments->setEnabled(p.count()); for(unsigned i = 0; i < p.count(); i++) { theArguments->insertItem(p[i].comment() + " (" + p[i].type() + ")"); - arguments[i].cast(QVariant::nameToType(p[i].type().utf8())); + arguments[i].cast(TQVariant::nameToType(p[i].type().utf8())); } if(p.count()) updateArgument(0); else updateArgument(-1); } @@ -171,12 +171,12 @@ void EditAction::updateArguments() if(p.count() != arguments.count()) { arguments.clear(); for(unsigned i = 0; i < p.count(); i++) - arguments.append(QVariant("")); + arguments.append(TQVariant("")); } theArguments->setEnabled(p.count()); for(unsigned i = 0; i < p.count(); i++) - { theArguments->insertItem(QString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? p.type(i) : p.name(i) + " (" + p.type(i) + ")")); - arguments[i].cast(QVariant::nameToType(p.type(i).utf8())); + { theArguments->insertItem(TQString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? p.type(i) : p.name(i) + " (" + p.type(i) + ")")); + arguments[i].cast(TQVariant::nameToType(p.type(i).utf8())); } if(p.count()) updateArgument(0); else updateArgument(-1); } @@ -216,22 +216,22 @@ void EditAction::slotParameterChanged() kdDebug() << type << endl; switch(type) { - case QVariant::Int: case QVariant::UInt: + case TQVariant::Int: case TQVariant::UInt: arguments[theArguments->currentItem()].asInt() = theValueIntNumInput->value(); break; - case QVariant::Double: + case TQVariant::Double: arguments[theArguments->currentItem()].asDouble() = theValueDoubleNumInput->value(); break; - case QVariant::Bool: + case TQVariant::Bool: arguments[theArguments->currentItem()].asBool() = theValueCheckBox->isChecked(); break; - case QVariant::StringList: + case TQVariant::StringList: arguments[theArguments->currentItem()].asStringList() = theValueEditListBox->items(); break; default: arguments[theArguments->currentItem()].asString() = theValueLineEdit->text(); } - arguments[theArguments->currentItem()].cast(QVariant::Type(type)); + arguments[theArguments->currentItem()].cast(TQVariant::Type(type)); kdDebug() << "out: " << arguments[theArguments->currentItem()].toString() << endl; } @@ -242,21 +242,21 @@ void EditAction::updateArgument(int index) if(index >= 0) { switch(arguments[index].type()) { - case QVariant::Int: case QVariant::UInt: + case TQVariant::Int: case TQVariant::UInt: theValue->raiseWidget(2); theValueIntNumInput->setValue(arguments[index].toInt()); break; - case QVariant::Double: + case TQVariant::Double: theValue->raiseWidget(3); theValueDoubleNumInput->setValue(arguments[index].toDouble()); break; - case QVariant::Bool: + case TQVariant::Bool: theValue->raiseWidget(1); theValueCheckBox->setChecked(arguments[index].toBool()); break; - case QVariant::StringList: + case TQVariant::StringList: { theValue->raiseWidget(4); - QStringList backup = arguments[index].toStringList(); + TQStringList backup = arguments[index].toStringList(); // backup needed because calling clear will kill what ever has been saved. theValueEditListBox->clear(); theValueEditListBox->insertStringList(backup); @@ -284,8 +284,8 @@ void EditAction::updateApplications() theApplications->clear(); applicationMap.clear(); - QDict dict = theServer->profiles(); - QDictIterator i(dict); + TQDict dict = theServer->profiles(); + TQDictIterator i(dict); for(; i.current(); ++i) { theApplications->insertItem(i.current()->name()); applicationMap[i.current()->name()] = i.currentKey(); @@ -302,8 +302,8 @@ void EditAction::updateFunctions() const Profile *p = theServer->profiles()[applicationMap[theApplications->currentText()]]; - QDict dict = p->actions(); - for(QDictIterator i(dict); i.current(); ++i) + TQDict dict = p->actions(); + for(TQDictIterator i(dict); i.current(); ++i) { theFunctions->insertItem(i.current()->name()); functionMap[i.current()->name()] = i.currentKey(); } @@ -312,21 +312,21 @@ void EditAction::updateFunctions() void EditAction::updateDCOPApplications() { - QStringList names; + TQStringList names; theDCOPApplications->clear(); DCOPClient *theClient = KApplication::kApplication()->dcopClient(); QCStringList theApps = theClient->registeredApplications(); for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i) { - if(!QString(*i).find("anonymous")) continue; - QRegExp r("(.*)-[0-9]+"); - QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i; + if(!TQString(*i).find("anonymous")) continue; + TQRegExp r("(.*)-[0-9]+"); + TQString name = r.exactMatch(TQString(*i)) ? r.cap(1) : *i; if(names.contains(name)) continue; names += name; theDCOPApplications->insertItem(name); - uniqueProgramMap[name] = name == QString(*i); + uniqueProgramMap[name] = name == TQString(*i); nameProgramMap[name] = *i; @@ -343,7 +343,7 @@ void EditAction::updateDCOPObjects() if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object()); for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j) if(*j != "ksycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count()) - theDCOPObjects->insertItem(QString::fromUtf8(*j)); + theDCOPObjects->insertItem(TQString::fromUtf8(*j)); updateDCOPFunctions(); } @@ -351,9 +351,9 @@ void EditAction::updateDCOPFunctions() { theDCOPFunctions->clear(); if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return; - QStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText()); + TQStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText()); if(!functions.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPFunctions->insertItem((*theAction).method().prototype()); - for(QStringList::iterator i = functions.begin(); i != functions.end(); ++i) + for(TQStringList::iterator i = functions.begin(); i != functions.end(); ++i) theDCOPFunctions->insertItem(*i); updateArguments(); } diff --git a/kdelirc/kcmlirc/editaction.h b/kdelirc/kcmlirc/editaction.h index 1a7aa00..7efa7ca 100644 --- a/kdelirc/kcmlirc/editaction.h +++ b/kdelirc/kcmlirc/editaction.h @@ -13,7 +13,7 @@ #ifndef EDITACTION_H #define EDITACTION_H -#include +#include #include "iractions.h" #include "editactionbase.h" @@ -27,11 +27,11 @@ class EditAction : public EditActionBase { Q_OBJECT IRAIt theAction; - QMap applicationMap, functionMap; - QMap nameProgramMap; - QMap uniqueProgramMap; + TQMap applicationMap, functionMap; + TQMap nameProgramMap; + TQMap uniqueProgramMap; Arguments arguments; - QString program; + TQString program; bool isUnique; public: @@ -48,7 +48,7 @@ public: virtual void updateDCOPObjects(); virtual void updateDCOPFunctions(); - EditAction(IRAIt action, QWidget *parent = 0, const char *name = 0); + EditAction(IRAIt action, TQWidget *parent = 0, const char *name = 0); ~EditAction(); }; diff --git a/kdelirc/kcmlirc/editmode.cpp b/kdelirc/kcmlirc/editmode.cpp index 3fba8f0..aad27da 100644 --- a/kdelirc/kcmlirc/editmode.cpp +++ b/kdelirc/kcmlirc/editmode.cpp @@ -16,7 +16,7 @@ #include "editmode.h" -EditMode::EditMode(QWidget *parent, const char *name, bool modal, WFlags fl) : EditModeBase(parent, name, modal, fl) +EditMode::EditMode(TQWidget *parent, const char *name, bool modal, WFlags fl) : EditModeBase(parent, name, modal, fl) { theIcon->setIconType(KIcon::Panel, KIcon::Any); } @@ -30,7 +30,7 @@ void EditMode::slotClearIcon() theIcon->resetIcon(); } -void EditMode::slotCheckText(const QString &newText) +void EditMode::slotCheckText(const TQString &newText) { theOK->setEnabled(!newText.isEmpty()); } diff --git a/kdelirc/kcmlirc/editmode.h b/kdelirc/kcmlirc/editmode.h index 14a709d..df3c888 100644 --- a/kdelirc/kcmlirc/editmode.h +++ b/kdelirc/kcmlirc/editmode.h @@ -23,10 +23,10 @@ class EditMode : public EditModeBase Q_OBJECT public: - void slotCheckText(const QString &newText); + void slotCheckText(const TQString &newText); void slotClearIcon(); - EditMode(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0); + EditMode(TQWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0); ~EditMode(); }; diff --git a/kdelirc/kcmlirc/kcmlirc.cpp b/kdelirc/kcmlirc/kcmlirc.cpp index 1686bcd..b248127 100644 --- a/kdelirc/kcmlirc/kcmlirc.cpp +++ b/kdelirc/kcmlirc/kcmlirc.cpp @@ -8,14 +8,14 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -46,10 +46,10 @@ #include "modeslist.h" #include "selectprofile.h" -typedef KGenericFactory theFactory; +typedef KGenericFactory theFactory; K_EXPORT_COMPONENT_FACTORY(kcmlirc, theFactory("kcmlirc")) -KCMLirc::KCMLirc(QWidget *parent, const char *name, QStringList /*args*/) : DCOPObject("KCMLirc"), KCModule(parent, name) +KCMLirc::KCMLirc(TQWidget *parent, const char *name, TQStringList /*args*/) : DCOPObject("KCMLirc"), KCModule(parent, name) { KGlobal::locale()->insertCatalogue( "kcmlirc" ); setAboutData(new KAboutData("kcmlirc", I18N_NOOP("KDE Lirc"), VERSION, I18N_NOOP("The KDE IR Remote Control System"), KAboutData::License_GPL_V2, "Copyright (c)2003 Gav Wood", I18N_NOOP("Use this to configure KDE's infrared remote control system in order to control any KDE application with your infrared remote control."), "http://www.kde.org")); @@ -71,22 +71,22 @@ KCMLirc::KCMLirc(QWidget *parent, const char *name, QStringList /*args*/) : DCOP kdDebug() << "OK" << ok << endl; - (new QHBoxLayout(this))->setAutoAdd(true); + (new TQHBoxLayout(this))->setAutoAdd(true); theKCMLircBase = new KCMLircBase(this); - connect(theKCMLircBase->theModes, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateActions() )); - connect(theKCMLircBase->theModes, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateModesStatus(QListViewItem *) )); - connect(theKCMLircBase->theActions, SIGNAL( currentChanged(QListViewItem *) ), this, SLOT( updateActionsStatus(QListViewItem *) )); - connect(theKCMLircBase->theExtensions, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateInformation() )); - connect(theKCMLircBase->theModes, SIGNAL( itemRenamed(QListViewItem *) ), this, SLOT( slotRenamed(QListViewItem *) )); - connect(theKCMLircBase->theModes, SIGNAL(dropped(KListView*, QDropEvent*, QListViewItem*, QListViewItem*)), this, SLOT(slotDrop(KListView*, QDropEvent*, QListViewItem*, QListViewItem*))); - connect((QObject *)(theKCMLircBase->theAddActions), SIGNAL( clicked() ), this, SLOT( slotAddActions() )); - connect((QObject *)(theKCMLircBase->theAddAction), SIGNAL( clicked() ), this, SLOT( slotAddAction() )); - connect((QObject *)(theKCMLircBase->theEditAction), SIGNAL( clicked() ), this, SLOT( slotEditAction() )); - connect((QObject *)(theKCMLircBase->theActions), SIGNAL( doubleClicked(QListViewItem *) ), this, SLOT( slotEditAction() )); - connect((QObject *)(theKCMLircBase->theRemoveAction), SIGNAL( clicked() ), this, SLOT( slotRemoveAction() )); - connect((QObject *)(theKCMLircBase->theAddMode), SIGNAL( clicked() ), this, SLOT( slotAddMode() )); - connect((QObject *)(theKCMLircBase->theEditMode), SIGNAL( clicked() ), this, SLOT( slotEditMode() )); - connect((QObject *)(theKCMLircBase->theRemoveMode), SIGNAL( clicked() ), this, SLOT( slotRemoveMode() )); + connect(theKCMLircBase->theModes, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), this, TQT_SLOT( updateActions() )); + connect(theKCMLircBase->theModes, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), this, TQT_SLOT( updateModesStatus(TQListViewItem *) )); + connect(theKCMLircBase->theActions, TQT_SIGNAL( currentChanged(TQListViewItem *) ), this, TQT_SLOT( updateActionsStatus(TQListViewItem *) )); + connect(theKCMLircBase->theExtensions, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), this, TQT_SLOT( updateInformation() )); + connect(theKCMLircBase->theModes, TQT_SIGNAL( itemRenamed(TQListViewItem *) ), this, TQT_SLOT( slotRenamed(TQListViewItem *) )); + connect(theKCMLircBase->theModes, TQT_SIGNAL(dropped(KListView*, TQDropEvent*, TQListViewItem*, TQListViewItem*)), this, TQT_SLOT(slotDrop(KListView*, TQDropEvent*, TQListViewItem*, TQListViewItem*))); + connect((TQObject *)(theKCMLircBase->theAddActions), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddActions() )); + connect((TQObject *)(theKCMLircBase->theAddAction), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddAction() )); + connect((TQObject *)(theKCMLircBase->theEditAction), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEditAction() )); + connect((TQObject *)(theKCMLircBase->theActions), TQT_SIGNAL( doubleClicked(TQListViewItem *) ), this, TQT_SLOT( slotEditAction() )); + connect((TQObject *)(theKCMLircBase->theRemoveAction), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveAction() )); + connect((TQObject *)(theKCMLircBase->theAddMode), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddMode() )); + connect((TQObject *)(theKCMLircBase->theEditMode), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEditMode() )); + connect((TQObject *)(theKCMLircBase->theRemoveMode), TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveMode() )); load(); } @@ -94,7 +94,7 @@ KCMLirc::~KCMLirc() { } -void KCMLirc::updateModesStatus(QListViewItem *item) +void KCMLirc::updateModesStatus(TQListViewItem *item) { theKCMLircBase->theModes->setItemsRenameable(item && item->parent()); theKCMLircBase->theAddActions->setEnabled(ProfileServer::profileServer()->profiles().count() && theKCMLircBase->theModes->selectedItem() && RemoteServer::remoteServer()->remotes()[modeMap[theKCMLircBase->theModes->selectedItem()].remote()]); @@ -104,13 +104,13 @@ void KCMLirc::updateModesStatus(QListViewItem *item) theKCMLircBase->theEditMode->setEnabled(item); } -void KCMLirc::updateActionsStatus(QListViewItem *item) +void KCMLirc::updateActionsStatus(TQListViewItem *item) { theKCMLircBase->theRemoveAction->setEnabled(item); theKCMLircBase->theEditAction->setEnabled(item); } -void KCMLirc::slotRenamed(QListViewItem *item) +void KCMLirc::slotRenamed(TQListViewItem *item) { if(!item) return; @@ -127,13 +127,13 @@ void KCMLirc::slotEditAction() if(!theKCMLircBase->theActions->currentItem()) return; EditAction theDialog(actionMap[theKCMLircBase->theActions->currentItem()], this); - QListViewItem *item = theKCMLircBase->theModes->currentItem(); + TQListViewItem *item = theKCMLircBase->theModes->currentItem(); if(item->parent()) item = item->parent(); theDialog.theModes->insertItem(i18n("[Exit current mode]")); for(item = item->firstChild(); item; item = item->nextSibling()) theDialog.theModes->insertItem(item->text(0)); theDialog.readFrom(); - if(theDialog.exec() == QDialog::Accepted) { theDialog.writeBack(); emit changed(true); updateActions(); } + if(theDialog.exec() == TQDialog::Accepted) { theDialog.writeBack(); emit changed(true); updateActions(); } } void KCMLirc::slotAddActions() @@ -144,11 +144,11 @@ void KCMLirc::slotAddActions() SelectProfile theDialog(this, 0); - QMap profileMap; - QDict dict = ProfileServer::profileServer()->profiles(); - for(QDictIterator i(dict); i.current(); ++i) profileMap[new QListViewItem(theDialog.theProfiles, i.current()->name())] = i.current(); + TQMap profileMap; + TQDict dict = ProfileServer::profileServer()->profiles(); + for(TQDictIterator i(dict); i.current(); ++i) profileMap[new TQListViewItem(theDialog.theProfiles, i.current()->name())] = i.current(); - if(theDialog.exec() == QDialog::Accepted && theDialog.theProfiles->currentItem()) + if(theDialog.exec() == TQDialog::Accepted && theDialog.theProfiles->currentItem()) { autoPopulate(*(profileMap[theDialog.theProfiles->currentItem()]), *(RemoteServer::remoteServer()->remotes()[m.remote()]), m.name()); updateActions(); emit changed(true); @@ -162,10 +162,10 @@ void KCMLirc::slotAddAction() Mode m = modeMap[theKCMLircBase->theModes->selectedItem()]; AddAction theDialog(this, 0, m); - connect(this, SIGNAL(haveButton(const QString &, const QString &)), &theDialog, SLOT(updateButton(const QString &, const QString &))); + connect(this, TQT_SIGNAL(haveButton(const TQString &, const TQString &)), &theDialog, TQT_SLOT(updateButton(const TQString &, const TQString &))); // populate the modes list box - QListViewItem *item = theKCMLircBase->theModes->selectedItem(); + TQListViewItem *item = theKCMLircBase->theModes->selectedItem(); if(item->parent()) item = item->parent(); theDialog.theModes->setEnabled(item->firstChild()); theDialog.theSwitchMode->setEnabled(item->firstChild()); @@ -174,7 +174,7 @@ void KCMLirc::slotAddAction() if(item->isSelected()) { a->setSelected(true); theDialog.theModes->setCurrentItem(a); } } - if(theDialog.exec() == QDialog::Accepted && theDialog.theButtons->selectedItem()) + if(theDialog.exec() == TQDialog::Accepted && theDialog.theButtons->selectedItem()) { IRAction a; a.setRemote(m.remote()); a.setMode(m.name()); @@ -246,10 +246,10 @@ void KCMLirc::slotRemoveAction() emit changed(true); } -void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const QString &mode) +void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const TQString &mode) { - QDict d = remote.buttons(); - for(QDictIterator i(d); i.current(); ++i) + TQDict d = remote.buttons(); + for(TQDictIterator i(d); i.current(); ++i) { const ProfileAction *pa = profile.searchClass(i.current()->getClass()); if(pa) { @@ -267,8 +267,8 @@ void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const Q Arguments l; // argument count should be either 0 or 1. undefined if > 1. if(Prototype(pa->prototype()).argumentCount() == 1) - { l.append(QString().setNum(i.current()->parameter().toFloat() * pa->multiplier())); - l.back().cast(QVariant::nameToType(Prototype(pa->prototype()).type(0).utf8())); + { l.append(TQString().setNum(i.current()->parameter().toFloat() * pa->multiplier())); + l.back().cast(TQVariant::nameToType(Prototype(pa->prototype()).type(0).utf8())); } a.setArguments(l); allActions.addAction(a); @@ -281,15 +281,15 @@ void KCMLirc::slotAddMode() if(!theKCMLircBase->theModes->selectedItem()) return; NewMode theDialog(this, 0); - QMap remoteMap; - QListViewItem *tr = theKCMLircBase->theModes->selectedItem(); + TQMap remoteMap; + TQListViewItem *tr = theKCMLircBase->theModes->selectedItem(); if(tr) if(tr->parent()) tr = tr->parent(); - for(QListViewItem *i = theKCMLircBase->theModes->firstChild(); i; i = i->nextSibling()) + for(TQListViewItem *i = theKCMLircBase->theModes->firstChild(); i; i = i->nextSibling()) { KListViewItem *a = new KListViewItem(theDialog.theRemotes, i->text(0)); remoteMap[a] = modeMap[i].remote(); if(i == tr) { a->setSelected(true); theDialog.theRemotes->setCurrentItem(a); } } - if(theDialog.exec() == QDialog::Accepted && theDialog.theRemotes->selectedItem() && !theDialog.theName->text().isEmpty()) + if(theDialog.exec() == TQDialog::Accepted && theDialog.theRemotes->selectedItem() && !theDialog.theName->text().isEmpty()) { allModes.add(Mode(remoteMap[theDialog.theRemotes->selectedItem()], theDialog.theName->text())); updateModes(); @@ -313,9 +313,9 @@ void KCMLirc::slotEditMode() theDialog.theDefault->setChecked(allModes.isDefault(mode)); theDialog.theDefault->setEnabled(!allModes.isDefault(mode)); - if(theDialog.exec() == QDialog::Accepted) + if(theDialog.exec() == TQDialog::Accepted) { kdDebug() << "Setting icon : " << theDialog.theIcon->icon() << endl; - mode.setIconFile(theDialog.theIcon->icon().isEmpty() ? QString::null : theDialog.theIcon->icon()); + mode.setIconFile(theDialog.theIcon->icon().isEmpty() ? TQString::null : theDialog.theIcon->icon()); allModes.updateMode(mode); if(!mode.name().isEmpty()) { allActions.renameMode(mode, theDialog.theName->text()); @@ -348,7 +348,7 @@ void KCMLirc::slotSetDefaultMode() emit changed(true); } -void KCMLirc::slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem *after) +void KCMLirc::slotDrop(KListView *, TQDropEvent *, TQListViewItem *, TQListViewItem *after) { Mode m = modeMap[after]; @@ -357,7 +357,7 @@ void KCMLirc::slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem KMessageBox::error(this, i18n("You may only drag the selected items onto a mode of the same remote control"), i18n("You May Not Drag Here")); return; } - for(QListViewItem *i = theKCMLircBase->theActions->firstChild(); i; i = i->nextSibling()) + for(TQListViewItem *i = theKCMLircBase->theActions->firstChild(); i; i = i->nextSibling()) if(i->isSelected()) (*(actionMap[i])).setMode(m.name()); @@ -379,7 +379,7 @@ void KCMLirc::updateActions() theKCMLircBase->theModeLabel->setText(m.remoteName() + ": " + (m.name().isEmpty() ? i18n("Actions always available") : i18n("Actions available only in mode %1").arg(m.name()))); IRAItList l = allActions.findByMode(m); for(IRAItList::iterator i = l.begin(); i != l.end(); ++i) - { QListViewItem *b = new KListViewItem(theKCMLircBase->theActions, (**i).buttonName(), (**i).application(), (**i).function(), (**i).arguments().toString(), (**i).notes()); + { TQListViewItem *b = new KListViewItem(theKCMLircBase->theActions, (**i).buttonName(), (**i).application(), (**i).function(), (**i).arguments().toString(), (**i).notes()); actionMap[b] = *i; if(*i == oldCurrent) { b->setSelected(true); theKCMLircBase->theActions->setCurrentItem(b); } } @@ -389,7 +389,7 @@ void KCMLirc::updateActions() updateActionsStatus(theKCMLircBase->theActions->currentItem()); } -void KCMLirc::gotButton(QString remote, QString button) +void KCMLirc::gotButton(TQString remote, TQString button) { emit haveButton(remote, button); } @@ -403,14 +403,14 @@ void KCMLirc::updateModes() modeMap.clear(); IRKick_stub IRKick("irkick", "IRKick"); - QStringList remotes = IRKick.remotes(); + TQStringList remotes = IRKick.remotes(); if(remotes.begin() == remotes.end()) theKCMLircBase->theMainLabel->setMaximumSize(32767, 32767); else theKCMLircBase->theMainLabel->setMaximumSize(0, 0); - for(QStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) + for(TQStringList::iterator i = remotes.begin(); i != remotes.end(); ++i) { Mode mode = allModes.getMode(*i, ""); - QListViewItem *a = new KListViewItem(theKCMLircBase->theModes, RemoteServer::remoteServer()->getRemoteName(*i), allModes.isDefault(mode) ? "Default" : "", mode.iconFile().isNull() ? "" : ""); + TQListViewItem *a = new KListViewItem(theKCMLircBase->theModes, RemoteServer::remoteServer()->getRemoteName(*i), allModes.isDefault(mode) ? "Default" : "", mode.iconFile().isNull() ? "" : ""); if(!mode.iconFile().isNull()) a->setPixmap(2, KIconLoader().loadIcon(mode.iconFile(), KIcon::Panel)); modeMap[a] = mode; // the null mode @@ -419,7 +419,7 @@ void KCMLirc::updateModes() ModeList l = allModes.getModes(*i); for(ModeList::iterator j = l.begin(); j != l.end(); ++j) if(!(*j).name().isEmpty()) - { QListViewItem *b = new KListViewItem(a, (*j).name(), allModes.isDefault(*j) ? i18n("Default") : "", (*j).iconFile().isNull() ? "" : ""); + { TQListViewItem *b = new KListViewItem(a, (*j).name(), allModes.isDefault(*j) ? i18n("Default") : "", (*j).iconFile().isNull() ? "" : ""); if(!(*j).iconFile().isNull()) b->setPixmap(2, KIconLoader().loadIcon((*j).iconFile(), KIcon::Panel)); modeMap[b] = *j; @@ -437,22 +437,22 @@ void KCMLirc::updateExtensions() theKCMLircBase->theExtensions->clear(); { ProfileServer *theServer = ProfileServer::profileServer(); - QListViewItem *a = new QListViewItem(theKCMLircBase->theExtensions, i18n("Applications")); + TQListViewItem *a = new TQListViewItem(theKCMLircBase->theExtensions, i18n("Applications")); a->setOpen(true); profileMap.clear(); - QDict dict = theServer->profiles(); - QDictIterator i(dict); + TQDict dict = theServer->profiles(); + TQDictIterator i(dict); for(; i.current(); ++i) - profileMap[new QListViewItem(a, i.current()->name())] = i.currentKey(); + profileMap[new TQListViewItem(a, i.current()->name())] = i.currentKey(); } { RemoteServer *theServer = RemoteServer::remoteServer(); - QListViewItem *a = new QListViewItem(theKCMLircBase->theExtensions, i18n("Remote Controls")); + TQListViewItem *a = new TQListViewItem(theKCMLircBase->theExtensions, i18n("Remote Controls")); a->setOpen(true); remoteMap.clear(); - QDict dict = theServer->remotes(); - QDictIterator i(dict); + TQDict dict = theServer->remotes(); + TQDictIterator i(dict); for(; i.current(); ++i) - remoteMap[new QListViewItem(a, i.current()->name())] = i.currentKey(); + remoteMap[new TQListViewItem(a, i.current()->name())] = i.currentKey(); } updateInformation(); } @@ -468,28 +468,28 @@ void KCMLirc::updateInformation() { theKCMLircBase->theInformationLabel->setText(i18n("Information on %1:").arg(theKCMLircBase->theExtensions->selectedItem()->text(0))); if(theKCMLircBase->theExtensions->selectedItem()->text(0) == i18n("Applications")) - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Applications"), QString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Applications"), TQString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); else if(theKCMLircBase->theExtensions->selectedItem()->text(0) == i18n("Remote Controls")) - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Remote Controls"), QString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Remote Controls"), TQString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount())); } else if(theKCMLircBase->theExtensions->selectedItem()->parent()->text(0) == i18n("Applications")) { ProfileServer *theServer = ProfileServer::profileServer(); const Profile *p = theServer->profiles()[profileMap[theKCMLircBase->theExtensions->selectedItem()]]; - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Application Identifier"), p->id()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Actions"), QString().setNum(p->actions().count())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Application Identifier"), p->id()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Actions"), TQString().setNum(p->actions().count())); theKCMLircBase->theInformationLabel->setText(i18n("Information on %1:").arg(p->name())); } else if(theKCMLircBase->theExtensions->selectedItem()->parent()->text(0) == i18n("Remote Controls")) { RemoteServer *theServer = RemoteServer::remoteServer(); const Remote *p = theServer->remotes()[remoteMap[theKCMLircBase->theExtensions->selectedItem()]]; - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Remote Control Identifier"), p->id()); - new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Buttons"), QString().setNum(p->buttons().count())); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Remote Control Identifier"), p->id()); + new TQListViewItem(theKCMLircBase->theInformation, i18n("Number of Buttons"), TQString().setNum(p->buttons().count())); theKCMLircBase->theInformationLabel->setText(i18n("Information on %1:").arg(p->name())); } } @@ -533,7 +533,7 @@ void KCMLirc::configChanged() // TODO: Take this out when I know how extern "C" { - KDE_EXPORT KCModule *create_kcmlirc(QWidget *parent, const char *) + KDE_EXPORT KCModule *create_kcmlirc(TQWidget *parent, const char *) { KGlobal::locale()->insertCatalogue("kcmlirc"); return new KCMLirc(parent, "KCMLirc"); } diff --git a/kdelirc/kcmlirc/kcmlirc.h b/kdelirc/kcmlirc/kcmlirc.h index ba88ae2..517004f 100644 --- a/kdelirc/kcmlirc/kcmlirc.h +++ b/kdelirc/kcmlirc/kcmlirc.h @@ -11,8 +11,8 @@ #ifndef _KCMLIRC_H_ #define _KCMLIRC_H_ -#include -#include +#include +#include #include @@ -37,16 +37,16 @@ private: KCMLircBase *theKCMLircBase; IRActions allActions; Modes allModes; - QMap actionMap; - QMap modeMap; - QMap profileMap, remoteMap; + TQMap actionMap; + TQMap modeMap; + TQMap profileMap, remoteMap; - void autoPopulate(const Profile &profile, const Remote &remote, const QString &mode); + void autoPopulate(const Profile &profile, const Remote &remote, const TQString &mode); public slots: void updateActions(); - void updateModesStatus(QListViewItem *); - void updateActionsStatus(QListViewItem *); + void updateModesStatus(TQListViewItem *); + void updateActionsStatus(TQListViewItem *); void updateModes(); void updateExtensions(); void updateInformation(); @@ -57,8 +57,8 @@ public slots: void slotAddActions(); void slotEditAction(); void slotRemoveAction(); - void slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem *after); - void slotRenamed(QListViewItem *item); + void slotDrop(KListView *, TQDropEvent *, TQListViewItem *, TQListViewItem *after); + void slotRenamed(TQListViewItem *item); void slotEditMode(); @@ -66,9 +66,9 @@ public slots: k_dcop: // MOC_SKIP_END // now just used as a proxy to AddAction class - virtual void gotButton(QString remote, QString button); + virtual void gotButton(TQString remote, TQString button); signals: - void haveButton(const QString &remote, const QString &button); + void haveButton(const TQString &remote, const TQString &button); public: virtual void load(); @@ -76,7 +76,7 @@ public: virtual void defaults(); virtual void configChanged(); - KCMLirc(QWidget *parent = 0, const char *name = 0, QStringList args = QStringList()); + KCMLirc(TQWidget *parent = 0, const char *name = 0, TQStringList args = TQStringList()); ~KCMLirc(); }; diff --git a/kdelirc/kcmlirc/kcmlircbase.ui.h b/kdelirc/kcmlirc/kcmlircbase.ui.h index f9082b6..124ab3f 100644 --- a/kdelirc/kcmlirc/kcmlircbase.ui.h +++ b/kdelirc/kcmlirc/kcmlircbase.ui.h @@ -23,7 +23,7 @@ void KCMLircBase::init() { delete theModes; modeLayout->removeItem(modeButtonLayout); - theModes = new ModesList(dynamic_cast(modeLayout->parent()), "theModes"); + theModes = new ModesList(dynamic_cast(modeLayout->parent()), "theModes"); theModes->addColumn(i18n("Remote Control")); theModes->addColumn(i18n("Default")); theModes->addColumn(i18n("Icon")); diff --git a/kdelirc/kcmlirc/modeslist.cpp b/kdelirc/kcmlirc/modeslist.cpp index 6150705..83678d1 100644 --- a/kdelirc/kcmlirc/modeslist.cpp +++ b/kdelirc/kcmlirc/modeslist.cpp @@ -10,20 +10,20 @@ // Copyright: See COPYING file that comes with this distribution // // -#include +#include #include #include "modeslist.h" -ModesList::ModesList(QWidget *parent, const char *name) : KListView(parent, name) +ModesList::ModesList(TQWidget *parent, const char *name) : KListView(parent, name) { setAcceptDrops(true); setDropVisualizer(false); setDropHighlighter(true); } -bool ModesList::acceptDrag(QDropEvent *) const +bool ModesList::acceptDrag(TQDropEvent *) const { // TODO: make safer by checking source/mime type // TODO: make safer by only allowing drops on the correct remote control's modes diff --git a/kdelirc/kcmlirc/modeslist.h b/kdelirc/kcmlirc/modeslist.h index 2fee458..22e6cc0 100644 --- a/kdelirc/kcmlirc/modeslist.h +++ b/kdelirc/kcmlirc/modeslist.h @@ -26,8 +26,8 @@ class ModesList : public KListView { Q_OBJECT public: - virtual bool acceptDrag(QDropEvent *) const; - ModesList(QWidget *parent = 0, const char *name = 0); + virtual bool acceptDrag(TQDropEvent *) const; + ModesList(TQWidget *parent = 0, const char *name = 0); }; #endif diff --git a/kdelirc/kcmlirc/newmode.ui.h b/kdelirc/kcmlirc/newmode.ui.h index 96c1eb4..2bb2f54 100644 --- a/kdelirc/kcmlirc/newmode.ui.h +++ b/kdelirc/kcmlirc/newmode.ui.h @@ -18,7 +18,7 @@ *****************************************************************************/ -void NewMode::slotTextChanged( const QString &newText ) +void NewMode::slotTextChanged( const TQString &newText ) { kPushButton6->setEnabled(newText != ""); } diff --git a/kdelirc/kdelirc/arguments.cpp b/kdelirc/kdelirc/arguments.cpp index 10fc69b..fc678ce 100644 --- a/kdelirc/kdelirc/arguments.cpp +++ b/kdelirc/kdelirc/arguments.cpp @@ -10,7 +10,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#include +#include #include "arguments.h" @@ -22,11 +22,11 @@ Arguments::~Arguments() { } -const QString Arguments::toString() const +const TQString Arguments::toString() const { - QString ret = ""; + TQString ret = ""; for(Arguments::const_iterator i = begin(); i != end(); ++i) - { QString s = (*i).toString(); + { TQString s = (*i).toString(); if(s.isNull()) s = "..."; if(i != begin()) ret += ", "; ret += s; diff --git a/kdelirc/kdelirc/arguments.h b/kdelirc/kdelirc/arguments.h index 97448a5..dae1f5c 100644 --- a/kdelirc/kdelirc/arguments.h +++ b/kdelirc/kdelirc/arguments.h @@ -13,17 +13,17 @@ #ifndef ARGUMENTS_H #define ARGUMENTS_H -#include -#include +#include +#include /** @author Gav Wood */ -class Arguments : public QValueList +class Arguments : public TQValueList { public: - const QString toString() const; + const TQString toString() const; Arguments(); ~Arguments(); diff --git a/kdelirc/kdelirc/iraction.cpp b/kdelirc/kdelirc/iraction.cpp index 9081a2e..ad558b5 100644 --- a/kdelirc/kdelirc/iraction.cpp +++ b/kdelirc/kdelirc/iraction.cpp @@ -11,7 +11,7 @@ // // -#include +#include #include #include @@ -20,7 +20,7 @@ #include "profileserver.h" #include "remoteserver.h" -IRAction::IRAction(const QString &newProgram, const QString &newObject, const QString &newMethod, const Arguments &newArguments, const QString &newRemote, const QString &newMode, const QString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti) +IRAction::IRAction(const TQString &newProgram, const TQString &newObject, const TQString &newMethod, const Arguments &newArguments, const TQString &newRemote, const TQString &newMode, const TQString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti) { theProgram = newProgram; theObject = newObject; @@ -39,12 +39,12 @@ IRAction::IRAction(const QString &newProgram, const QString &newObject, const QS const IRAction &IRAction::loadFromConfig(KConfig &theConfig, int index) { - QString Binding = "Binding" + QString().setNum(index); + TQString Binding = "Binding" + TQString().setNum(index); int numArguments = theConfig.readNumEntry(Binding + "Arguments"); theArguments.clear(); for(int j = 0; j < numArguments; j++) - { QVariant::Type theType = (QVariant::Type)theConfig.readNumEntry(Binding + "ArgumentType" + QString().setNum(j), QVariant::String); - theArguments += theConfig.readPropertyEntry(Binding + "Argument" + QString().setNum(j), theType == QVariant::CString ? QVariant::String : theType); + { TQVariant::Type theType = (TQVariant::Type)theConfig.readNumEntry(Binding + "ArgumentType" + TQString().setNum(j), TQVariant::String); + theArguments += theConfig.readPropertyEntry(Binding + "Argument" + TQString().setNum(j), theType == TQVariant::CString ? TQVariant::String : theType); theArguments.last().cast(theType); } @@ -66,15 +66,15 @@ const IRAction &IRAction::loadFromConfig(KConfig &theConfig, int index) void IRAction::saveToConfig(KConfig &theConfig, int index) const { - QString Binding = "Binding" + QString().setNum(index); + TQString Binding = "Binding" + TQString().setNum(index); theConfig.writeEntry(Binding + "Arguments", theArguments.count()); for(unsigned j = 0; j < theArguments.count(); j++) - { QVariant arg = theArguments[j]; - QVariant::Type preType = arg.type(); - if(preType == QVariant::CString) arg.cast(QVariant::String); - theConfig.writeEntry(Binding + "Argument" + QString().setNum(j), arg); - theConfig.writeEntry(Binding + "ArgumentType" + QString().setNum(j), preType); + { TQVariant arg = theArguments[j]; + TQVariant::Type preType = arg.type(); + if(preType == TQVariant::CString) arg.cast(TQVariant::String); + theConfig.writeEntry(Binding + "Argument" + TQString().setNum(j), arg); + theConfig.writeEntry(Binding + "ArgumentType" + TQString().setNum(j), preType); } theConfig.writeEntry(Binding + "Program", theProgram); theConfig.writeEntry(Binding + "Object", theObject); @@ -90,7 +90,7 @@ void IRAction::saveToConfig(KConfig &theConfig, int index) const theConfig.writeEntry(Binding + "IfMulti", theIfMulti); } -const QString IRAction::function() const +const TQString IRAction::function() const { ProfileServer *theServer = ProfileServer::profileServer(); if(theProgram.isEmpty()) @@ -111,24 +111,24 @@ const QString IRAction::function() const } } -const QString IRAction::notes() const +const TQString IRAction::notes() const { if(isModeChange()) - return QString(theDoBefore ? i18n("Do actions before. ") : "") + - QString(theDoAfter ? i18n("Do actions after. ") : ""); + return TQString(theDoBefore ? i18n("Do actions before. ") : "") + + TQString(theDoAfter ? i18n("Do actions after. ") : ""); else if(isJustStart()) return ""; else - return QString(theAutoStart ? i18n("Auto-start. ") : "") - + QString(theRepeat ? i18n("Repeatable. ") : "") - + QString(!theUnique ? (theIfMulti == IM_DONTSEND ? i18n("Do nothing if many instances. ") + return TQString(theAutoStart ? i18n("Auto-start. ") : "") + + TQString(theRepeat ? i18n("Repeatable. ") : "") + + TQString(!theUnique ? (theIfMulti == IM_DONTSEND ? i18n("Do nothing if many instances. ") : theIfMulti == IM_SENDTOTOP ? i18n("Send to top instance. ") : theIfMulti == IM_SENDTOBOTTOM ? i18n("Send to bottom instance. ") : i18n("Send to all instances. ")) : ""); } -const QString IRAction::application() const +const TQString IRAction::application() const { ProfileServer *theServer = ProfileServer::profileServer(); if(theProgram.isEmpty()) @@ -143,12 +143,12 @@ const QString IRAction::application() const } } -const QString IRAction::remoteName() const +const TQString IRAction::remoteName() const { return RemoteServer::remoteServer()->getRemoteName(theRemote); } -const QString IRAction::buttonName() const +const TQString IRAction::buttonName() const { return RemoteServer::remoteServer()->getButtonName(theRemote, theButton); } diff --git a/kdelirc/kdelirc/iraction.h b/kdelirc/kdelirc/iraction.h index f7008ff..8fdd44e 100644 --- a/kdelirc/kdelirc/iraction.h +++ b/kdelirc/kdelirc/iraction.h @@ -13,7 +13,7 @@ #ifndef IRACTION_H #define IRACTION_H -#include +#include #include "prototype.h" #include "arguments.h" @@ -27,7 +27,7 @@ class KConfig; class IRAction { - QString theProgram, theObject, theRemote, theButton, theMode; + TQString theProgram, theObject, theRemote, theButton, theMode; Prototype theMethod; Arguments theArguments; bool theRepeat, theAutoStart, theDoBefore, theDoAfter; @@ -40,49 +40,49 @@ public: void saveToConfig(KConfig &theConfig, int index) const; // may be changed to a profile-based representation in the future. - const QString function() const; - const QString application() const; - const QString buttonName() const; - const QString remoteName() const; - const QString notes() const; + const TQString function() const; + const TQString application() const; + const TQString buttonName() const; + const TQString remoteName() const; + const TQString notes() const; // bog standard raw DCOP stuff - const QString &program() const { return theProgram; } - const QString &object() const { return theObject; } + const TQString &program() const { return theProgram; } + const TQString &object() const { return theObject; } const Prototype &method() const { return theMethod; } - const QString &remote() const { return theRemote; } - const QString &mode() const { return theMode; } - const QString &button() const { return theButton; } + const TQString &remote() const { return theRemote; } + const TQString &mode() const { return theMode; } + const TQString &button() const { return theButton; } const Arguments arguments() const { if(theProgram != "" && theObject != "") return theArguments; return Arguments(); } const bool repeat() const { return theRepeat; } const bool autoStart() const { return theAutoStart; } const IfMulti ifMulti() const { return theIfMulti; } const bool unique() const { return theUnique; } - const QString &modeChange() const { return theObject; } + const TQString &modeChange() const { return theObject; } const bool doBefore() const { return theDoBefore; } const bool doAfter() const { return theDoAfter; } bool isModeChange() const { return theProgram == ""; } bool isJustStart() const { return theProgram != "" && theObject == ""; } - void setProgram(const QString &newProgram) { theProgram = newProgram; } - void setObject(const QString &newObject) { theObject = newObject; } + void setProgram(const TQString &newProgram) { theProgram = newProgram; } + void setObject(const TQString &newObject) { theObject = newObject; } void setMethod(const Prototype &newMethod) { theMethod = newMethod; } - void setRemote(const QString &newRemote) { theRemote = newRemote; } - void setMode(const QString &newMode) { theMode = newMode; } - void setButton(const QString &newButton) { theButton = newButton; } + void setRemote(const TQString &newRemote) { theRemote = newRemote; } + void setMode(const TQString &newMode) { theMode = newMode; } + void setButton(const TQString &newButton) { theButton = newButton; } void setArguments(const Arguments &newArguments) { theArguments = newArguments; } void setRepeat(bool newRepeat) { theRepeat = newRepeat; } void setDoBefore(bool a) { theDoBefore = a; } void setDoAfter(bool a) { theDoAfter = a; } void setAutoStart(bool newAutoStart) { theAutoStart = newAutoStart; } - void setModeChange(const QString &a) { theObject = a; } + void setModeChange(const TQString &a) { theObject = a; } void setIfMulti(const IfMulti a) { theIfMulti = a; } void setUnique(const bool a) { theUnique = a; } - IRAction(const QString &newProgram, const QString &newObject, const QString &newMethod, const Arguments &newArguments, const QString &newRemote, const QString &newMode, const QString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti); - IRAction() { theProgram = QString::null; } + IRAction(const TQString &newProgram, const TQString &newObject, const TQString &newMethod, const Arguments &newArguments, const TQString &newRemote, const TQString &newMode, const TQString &newButton, const bool newRepeat, const bool newAutoStart, const bool newDoBefore, const bool newDoAfter, const bool newUnique, const IfMulti newIfMulti); + IRAction() { theProgram = TQString::null; } }; #endif diff --git a/kdelirc/kdelirc/iractions.cpp b/kdelirc/kdelirc/iractions.cpp index 9bc03e3..e4ec0da 100644 --- a/kdelirc/kdelirc/iractions.cpp +++ b/kdelirc/kdelirc/iractions.cpp @@ -28,11 +28,11 @@ void IRActions::purgeAllBindings(KConfig &theConfig) { int numBindings = theConfig.readNumEntry("Bindings"); for(int i = 0; i < numBindings; i++) - { QString Binding = "Binding" + QString().setNum(i); + { TQString Binding = "Binding" + TQString().setNum(i); int numArguments = theConfig.readNumEntry(Binding + "Arguments"); for(int j = 0; j < numArguments; j++) - { theConfig.deleteEntry(Binding + "Argument" + QString().setNum(j)); - theConfig.deleteEntry(Binding + "ArgumentType" + QString().setNum(j)); + { theConfig.deleteEntry(Binding + "Argument" + TQString().setNum(j)); + theConfig.deleteEntry(Binding + "ArgumentType" + TQString().setNum(j)); } theConfig.deleteEntry(Binding + "Arguments"); theConfig.deleteEntry(Binding + "Program"); theConfig.deleteEntry(Binding + "Object"); theConfig.deleteEntry(Binding + "Method"); @@ -55,7 +55,7 @@ IRAIt IRActions::addAction(const IRAction &theAction) return append(theAction); } -IRAItList IRActions::findByButton(const QString &remote, const QString &button) +IRAItList IRActions::findByButton(const TQString &remote, const TQString &button) { IRAItList ret; for(iterator i = begin(); i != end(); ++i) @@ -64,7 +64,7 @@ IRAItList IRActions::findByButton(const QString &remote, const QString &button) return ret; } -void IRActions::renameMode(const Mode &mode, const QString &to) +void IRActions::renameMode(const Mode &mode, const TQString &to) { for(iterator i = begin(); i != end(); ++i) { if((*i).remote() == mode.remote() && (*i).mode() == mode.name()) (*i).setMode(to); @@ -80,7 +80,7 @@ IRAItList IRActions::findByMode(const Mode &mode) return ret; } -IRAItList IRActions::findByModeButton(const Mode &mode, const QString &button) +IRAItList IRActions::findByModeButton(const Mode &mode, const TQString &button) { IRAItList ret; for(iterator i = begin(); i != end(); ++i) diff --git a/kdelirc/kdelirc/iractions.h b/kdelirc/kdelirc/iractions.h index 24174d9..8373669 100644 --- a/kdelirc/kdelirc/iractions.h +++ b/kdelirc/kdelirc/iractions.h @@ -13,10 +13,10 @@ #ifndef IRACTIONS_H #define IRACTIONS_H -#include -#include -#include -#include +#include +#include +#include +#include #include "iraction.h" #include "mode.h" @@ -27,22 +27,22 @@ class KConfig; -typedef QValueListIterator IRAIt; -typedef QValueList IRAItList; +typedef TQValueListIterator IRAIt; +typedef TQValueList IRAItList; -class IRActions: protected QValueList +class IRActions: protected TQValueList { private: void purgeAllBindings(KConfig &theConfig); public: IRAIt addAction(const IRAction &theAction); - IRAItList findByButton(const QString &remote, const QString &button); + IRAItList findByButton(const TQString &remote, const TQString &button); IRAItList findByMode(const Mode &mode); - IRAItList findByModeButton(const Mode &mode, const QString &button); + IRAItList findByModeButton(const Mode &mode, const TQString &button); - void erase(const IRAIt &action) { QValueList::erase(action); } - void renameMode(const Mode &mode, const QString &to); + void erase(const IRAIt &action) { TQValueList::erase(action); } + void renameMode(const Mode &mode, const TQString &to); void loadFromConfig(KConfig &theConfig); void saveToConfig(KConfig &theConfig); diff --git a/kdelirc/kdelirc/mode.cpp b/kdelirc/kdelirc/mode.cpp index 1f4c34a..71deea8 100644 --- a/kdelirc/kdelirc/mode.cpp +++ b/kdelirc/kdelirc/mode.cpp @@ -16,11 +16,11 @@ #include "modes.h" #include "mode.h" -Mode::Mode() : theName(QString::null) +Mode::Mode() : theName(TQString::null) { } -Mode::Mode(const QString &remote, const QString &name, const QString &iconFile) +Mode::Mode(const TQString &remote, const TQString &name, const TQString &iconFile) { theRemote = remote; theName = name; @@ -33,17 +33,17 @@ Mode::~Mode() const Mode &Mode::loadFromConfig(KConfig &theConfig, int index) { - QString Prefix = "Mode" + QString().setNum(index); + TQString Prefix = "Mode" + TQString().setNum(index); theName = theConfig.readEntry(Prefix + "Name"); theRemote = theConfig.readEntry(Prefix + "Remote"); theIconFile = theConfig.readEntry(Prefix + "IconFile"); - if(theIconFile.isEmpty()) theIconFile = QString::null; + if(theIconFile.isEmpty()) theIconFile = TQString::null; return *this; } void Mode::saveToConfig(KConfig &theConfig, int index) { - QString Prefix = "Mode" + QString().setNum(index); + TQString Prefix = "Mode" + TQString().setNum(index); theConfig.writeEntry(Prefix + "Name", theName); theConfig.writeEntry(Prefix + "Remote", theRemote); theConfig.writeEntry(Prefix + "IconFile", theIconFile); diff --git a/kdelirc/kdelirc/mode.h b/kdelirc/kdelirc/mode.h index e52c042..9a73fbc 100644 --- a/kdelirc/kdelirc/mode.h +++ b/kdelirc/kdelirc/mode.h @@ -13,7 +13,7 @@ #ifndef MODE_H #define MODE_H -#include +#include #include "remoteserver.h" @@ -25,17 +25,17 @@ class KConfig; class Mode { - QString theName, theRemote, theIconFile; + TQString theName, theRemote, theIconFile; public: - void setName(const QString &a) { theName = a; } - void setRemote(const QString &a) { theRemote = a; } - void setIconFile(const QString &a) { theIconFile = a; } + void setName(const TQString &a) { theName = a; } + void setRemote(const TQString &a) { theRemote = a; } + void setIconFile(const TQString &a) { theIconFile = a; } - const QString &name() const { return theName; } - const QString &remote() const { return theRemote; } - const QString &iconFile() const { return theIconFile; } - const QString &remoteName() const { return RemoteServer::remoteServer()->getRemoteName(theRemote); } + const TQString &name() const { return theName; } + const TQString &remote() const { return theRemote; } + const TQString &iconFile() const { return theIconFile; } + const TQString &remoteName() const { return RemoteServer::remoteServer()->getRemoteName(theRemote); } const Mode &loadFromConfig(KConfig &theConfig, int index); void saveToConfig(KConfig &theConfig, int index); @@ -43,7 +43,7 @@ public: bool operator==(const Mode &mode) const { return mode.theName == theName && mode.theRemote == theRemote; } Mode(); - Mode(const QString &remote, const QString &name, const QString &iconFile = QString::null); + Mode(const TQString &remote, const TQString &name, const TQString &iconFile = TQString::null); ~Mode(); }; diff --git a/kdelirc/kdelirc/modes.cpp b/kdelirc/kdelirc/modes.cpp index 1b60647..5346837 100644 --- a/kdelirc/kdelirc/modes.cpp +++ b/kdelirc/kdelirc/modes.cpp @@ -38,9 +38,9 @@ void Modes::loadFromConfig(KConfig &theConfig) theDefaults[i.key()] = theConfig.readEntry("Default" + i.key()); } -void Modes::generateNulls(const QStringList &theRemotes) +void Modes::generateNulls(const TQStringList &theRemotes) { - for(QStringList::const_iterator i = theRemotes.begin(); i != theRemotes.end(); ++i) + for(TQStringList::const_iterator i = theRemotes.begin(); i != theRemotes.end(); ++i) { if(!contains(*i) || !operator[](*i).contains("")) operator[](*i)[""] = Mode(*i, ""); if(!theDefaults.contains(*i)) theDefaults[*i].isEmpty(); } @@ -55,9 +55,9 @@ bool Modes::isDefault(const Mode &mode) const return false; } -const Mode Modes::getDefault(const QString &remote) const +const Mode Modes::getDefault(const TQString &remote) const { -// if(theDefaults[remote] == QString()) +// if(theDefaults[remote] == TQString()) // return Mode(remote, ""); if(contains(remote)) if(operator[](remote).contains(theDefaults[remote])) @@ -71,7 +71,7 @@ void Modes::purgeAllModes(KConfig &theConfig) { int numModes = theConfig.readNumEntry("Modes"); for(int i = 0; i < numModes; i++) - { QString Prefix = "Mode" + QString().setNum(i); + { TQString Prefix = "Mode" + TQString().setNum(i); theConfig.deleteEntry(Prefix + "Name"); theConfig.deleteEntry(Prefix + "Remote"); } @@ -82,26 +82,26 @@ void Modes::saveToConfig(KConfig &theConfig) int index = 0; purgeAllModes(theConfig); for(iterator i = begin(); i != end(); ++i) - for(QMap::iterator j = (*i).begin(); j != (*i).end(); ++j,index++) + for(TQMap::iterator j = (*i).begin(); j != (*i).end(); ++j,index++) (*j).saveToConfig(theConfig, index); theConfig.writeEntry("Modes", index); for(iterator i = begin(); i != end(); ++i) - if(theDefaults[i.key()] == QString()) + if(theDefaults[i.key()] == TQString()) theConfig.writeEntry("Default" + i.key(), ""); else theConfig.writeEntry("Default" + i.key(), theDefaults[i.key()]); } -const Mode &Modes::getMode(const QString &remote, const QString &mode) const +const Mode &Modes::getMode(const TQString &remote, const TQString &mode) const { return operator[](remote)[mode]; } -ModeList Modes::getModes(const QString &remote) const +ModeList Modes::getModes(const TQString &remote) const { ModeList ret; - for(QMap::const_iterator i = operator[](remote).begin(); i != operator[](remote).end(); ++i) + for(TQMap::const_iterator i = operator[](remote).begin(); i != operator[](remote).end(); ++i) ret += *i; return ret; } @@ -117,7 +117,7 @@ void Modes::add(const Mode &mode) operator[](mode.remote())[mode.name()] = mode; } -void Modes::rename(Mode &mode, const QString name) +void Modes::rename(Mode &mode, const TQString name) { bool was = isDefault(mode); erase(mode); diff --git a/kdelirc/kdelirc/modes.h b/kdelirc/kdelirc/modes.h index 9eabd4b..ce89d43 100644 --- a/kdelirc/kdelirc/modes.h +++ b/kdelirc/kdelirc/modes.h @@ -13,10 +13,10 @@ #ifndef MODES_H #define MODES_H -#include -#include -#include -#include +#include +#include +#include +#include #include "mode.h" @@ -26,21 +26,21 @@ class KConfig; -typedef QValueList ModeList; +typedef TQValueList ModeList; -class Modes : protected QMap > +class Modes : protected TQMap > { void purgeAllModes(KConfig &theConfig); - QMap theDefaults; + TQMap theDefaults; public: void loadFromConfig(KConfig &theConfig); void saveToConfig(KConfig &theConfig); - void generateNulls(const QStringList &theRemotes); + void generateNulls(const TQStringList &theRemotes); - const Mode &getMode(const QString &remote, const QString &mode) const; - ModeList getModes(const QString &remote) const; - const Mode getDefault(const QString &remote) const; + const Mode &getMode(const TQString &remote, const TQString &mode) const; + ModeList getModes(const TQString &remote) const; + const Mode getDefault(const TQString &remote) const; bool isDefault(const Mode &mode) const; /** @@ -53,7 +53,7 @@ public: void add(const Mode &mode); // dont use this without renaming all the modes in the actions!!! - void rename(Mode &mode, const QString name); + void rename(Mode &mode, const TQString name); Modes(); ~Modes(); diff --git a/kdelirc/kdelirc/profileserver.cpp b/kdelirc/kdelirc/profileserver.cpp index 484deac..7a72c4d 100644 --- a/kdelirc/kdelirc/profileserver.cpp +++ b/kdelirc/kdelirc/profileserver.cpp @@ -11,8 +11,8 @@ // // -#include -#include +#include +#include #include #include @@ -34,8 +34,8 @@ ProfileServer::~ProfileServer() void ProfileServer::loadProfiles() { - QStringList theFiles = KGlobal::dirs()->findAllResources("data", "profiles/*.profile.xml"); - for(QStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) + TQStringList theFiles = KGlobal::dirs()->findAllResources("data", "profiles/*.profile.xml"); + for(TQStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) { kdDebug() << "Found data file: " << *i << endl; Profile *p = new Profile(); p->loadFromFile(*i); @@ -52,27 +52,27 @@ Profile::Profile() theActions.setAutoDelete(true); } -const ProfileAction *Profile::searchClass(const QString &c) const +const ProfileAction *Profile::searchClass(const TQString &c) const { - for(QDictIterator i(theActions); i.current(); ++i) + for(TQDictIterator i(theActions); i.current(); ++i) if(i.current()->getClass() == c) return i; return 0; } -void Profile::loadFromFile(const QString &fileName) +void Profile::loadFromFile(const TQString &fileName) { charBuffer = ""; curPA = 0; curPAA = 0; - QFile xmlFile(fileName); - QXmlInputSource source(&xmlFile); - QXmlSimpleReader reader; + TQFile xmlFile(fileName); + TQXmlInputSource source(&xmlFile); + TQXmlSimpleReader reader; reader.setContentHandler(this); reader.parse(source); } -const ProfileAction *ProfileServer::getAction(const QString &appId, const QString &actionId) const +const ProfileAction *ProfileServer::getAction(const TQString &appId, const TQString &actionId) const { if(theProfiles[appId]) if(theProfiles[appId]->theActions[actionId]) @@ -80,25 +80,25 @@ const ProfileAction *ProfileServer::getAction(const QString &appId, const QStrin return 0; } -const QString &ProfileServer::getServiceName(const QString &appId) const +const TQString &ProfileServer::getServiceName(const TQString &appId) const { if(theProfiles[appId]) return theProfiles[appId]->serviceName(); - return QString::null; + return TQString::null; } -const ProfileAction *ProfileServer::getAction(const QString &appId, const QString &objId, const QString &prototype) const +const ProfileAction *ProfileServer::getAction(const TQString &appId, const TQString &objId, const TQString &prototype) const { return getAction(appId, objId + "::" + prototype); } -bool Profile::characters(const QString &data) +bool Profile::characters(const TQString &data) { charBuffer += data; return true; } -bool Profile::startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes) +bool Profile::startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes) { if(name == "profile") { theId = attributes.value("id"); @@ -130,7 +130,7 @@ bool Profile::startElement(const QString &, const QString &, const QString &name return true; } -bool Profile::endElement(const QString &, const QString &, const QString &name) +bool Profile::endElement(const TQString &, const TQString &, const TQString &name) { if(name == "name") if(curPA) diff --git a/kdelirc/kdelirc/profileserver.h b/kdelirc/kdelirc/profileserver.h index f906dd0..0228082 100644 --- a/kdelirc/kdelirc/profileserver.h +++ b/kdelirc/kdelirc/profileserver.h @@ -13,12 +13,12 @@ #ifndef PROFILESERVER_H #define PROFILESERVER_H -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /** @author Gav Wood @@ -33,19 +33,19 @@ class Profile; class ProfileActionArgument { - QString theComment, theType; + TQString theComment, theType; Range theRange; - QString theDefault; // should be QVariant? + TQString theDefault; // should be QVariant? const ProfileAction *parent; friend class Profile; public: - const QString &comment() const { return theComment; } - void setComment(const QString &a) { theComment = a; } - const QString &type() const { return theType; } - void setType(const QString &a) { theType = a; } - const QString &getDefault() const { return theDefault; } - void setDefault(const QString &a) { theDefault = a; } + const TQString &comment() const { return theComment; } + void setComment(const TQString &a) { theComment = a; } + const TQString &type() const { return theType; } + void setType(const TQString &a) { theType = a; } + const TQString &getDefault() const { return theDefault; } + void setDefault(const TQString &a) { theDefault = a; } const Range &range() const { return theRange; } void setRange(const Range &a) { theRange = a; } @@ -55,31 +55,31 @@ public: class ProfileAction { - QString theObjId, thePrototype, theName, theComment, theClass; + TQString theObjId, thePrototype, theName, theComment, theClass; float theMultiplier; const Profile *parent; bool theRepeat, theAutoStart; - QValueList theArguments; + TQValueList theArguments; friend class Profile; public: - const QString &objId() const { return theObjId; } - void setObjId(const QString &a) { theObjId = a; } - const QString &prototype() const { return thePrototype; } - void setPrototype(const QString &a) { thePrototype = a; } - const QString &name() const { return theName; } - void setName(const QString &a) { theName = a; } - const QString &comment() const { return theComment; } - void setComment(const QString &a) { theComment = a; } - const QString &getClass() const { return theClass; } - void setClass(const QString &a) { theClass = a; } + const TQString &objId() const { return theObjId; } + void setObjId(const TQString &a) { theObjId = a; } + const TQString &prototype() const { return thePrototype; } + void setPrototype(const TQString &a) { thePrototype = a; } + const TQString &name() const { return theName; } + void setName(const TQString &a) { theName = a; } + const TQString &comment() const { return theComment; } + void setComment(const TQString &a) { theComment = a; } + const TQString &getClass() const { return theClass; } + void setClass(const TQString &a) { theClass = a; } const float multiplier() const { return theMultiplier; } void setMultiplier(const float a) { theMultiplier = a; } bool repeat() const { return theRepeat; } void setRepeat(bool a) { theRepeat = a; } bool autoStart() const { return theAutoStart; } void setAutoStart(bool a) { theAutoStart = a; } - const QValueList &arguments() const { return theArguments; } + const TQValueList &arguments() const { return theArguments; } const Profile *profile() const { return parent; } void setProfile(const Profile *a) { parent = a; } @@ -87,37 +87,37 @@ public: class Profile : public QXmlDefaultHandler { - QString theId, theName, theAuthor, theServiceName; + TQString theId, theName, theAuthor, theServiceName; IfMulti theIfMulti; bool theUnique; - QString charBuffer; + TQString charBuffer; ProfileAction *curPA; ProfileActionArgument *curPAA; - QDict theActions; // objid+"::"+prototype => ProfileAction + TQDict theActions; // objid+"::"+prototype => ProfileAction friend class ProfileServer; public: - bool characters(const QString &data); - bool startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes); - bool endElement(const QString &, const QString &, const QString &name); - - const QString &id() const { return theId; } - void setId(const QString &a) { theId = a; } - const QString &name() const { return theName; } - void setName(const QString &a) { theName = a; } - const QString &author() const { return theAuthor; } - void setAuthor(const QString &a) { theAuthor = a; } + bool characters(const TQString &data); + bool startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes); + bool endElement(const TQString &, const TQString &, const TQString &name); + + const TQString &id() const { return theId; } + void setId(const TQString &a) { theId = a; } + const TQString &name() const { return theName; } + void setName(const TQString &a) { theName = a; } + const TQString &author() const { return theAuthor; } + void setAuthor(const TQString &a) { theAuthor = a; } const bool unique() const { return theUnique; } void setUnique(const bool a) { theUnique = a; } const IfMulti ifMulti() const { return theIfMulti; } void setIfMulti(const IfMulti a) { theIfMulti = a; } - const QString &serviceName() const { if(theServiceName != QString::null) return theServiceName; return theName; } - void setServiceName(const QString &a) { theServiceName = a; } - const QDict &actions() const { return theActions; } - const ProfileAction *searchClass(const QString &c) const; + const TQString &serviceName() const { if(theServiceName != TQString::null) return theServiceName; return theName; } + void setServiceName(const TQString &a) { theServiceName = a; } + const TQDict &actions() const { return theActions; } + const ProfileAction *searchClass(const TQString &c) const; - void loadFromFile(const QString &fileName); + void loadFromFile(const TQString &fileName); Profile(); }; @@ -126,14 +126,14 @@ class ProfileServer { static ProfileServer *theInstance; void loadProfiles(); - QDict theProfiles; // id => Profile + TQDict theProfiles; // id => Profile public: static ProfileServer *profileServer() { if(!theInstance) theInstance = new ProfileServer(); return theInstance; } - const QDict profiles() const { return theProfiles; } - const ProfileAction *getAction(const QString &appId, const QString &objId, const QString &prototype) const; - const ProfileAction *getAction(const QString &appId, const QString &actionId) const; - const QString &getServiceName(const QString &appId) const; + const TQDict profiles() const { return theProfiles; } + const ProfileAction *getAction(const TQString &appId, const TQString &objId, const TQString &prototype) const; + const ProfileAction *getAction(const TQString &appId, const TQString &actionId) const; + const TQString &getServiceName(const TQString &appId) const; ProfileServer(); ~ProfileServer(); diff --git a/kdelirc/kdelirc/prototype.cpp b/kdelirc/kdelirc/prototype.cpp index 9b0a09b..8e2eedf 100644 --- a/kdelirc/kdelirc/prototype.cpp +++ b/kdelirc/kdelirc/prototype.cpp @@ -10,7 +10,7 @@ // Copyright: See COPYING file that comes with this distribution // // -#include +#include #include "prototype.h" @@ -19,7 +19,7 @@ Prototype::Prototype() original = ""; } -Prototype::Prototype(const QString &source) +Prototype::Prototype(const TQString &source) { original = source; parse(); @@ -29,17 +29,17 @@ Prototype::~Prototype() { } -const QString Prototype::argumentList() const +const TQString Prototype::argumentList() const { - QString ret = ""; + TQString ret = ""; for(unsigned i = 0; i < theTypes.count(); i++) ret += (i ? ", " : "") + theTypes[i] + " " + theNames[i]; return ret; } -const QString Prototype::argumentListNN() const +const TQString Prototype::argumentListNN() const { - QString ret = ""; + TQString ret = ""; for(unsigned i = 0; i < theTypes.count(); i++) ret += (i ? ", " : "") + theTypes[i]; return ret; @@ -50,14 +50,14 @@ void Prototype::parse() theNames.clear(); theTypes.clear(); - QRegExp main("^(.*) (\\w[\\d\\w]*)\\((.*)\\)"); - QRegExp parameters("^\\s*([^,\\s]+)(\\s+(\\w[\\d\\w]*))?(,(.*))?$"); + TQRegExp main("^(.*) (\\w[\\d\\w]*)\\((.*)\\)"); + TQRegExp parameters("^\\s*([^,\\s]+)(\\s+(\\w[\\d\\w]*))?(,(.*))?$"); if(main.search(original) == -1) return; theReturn = main.cap(1); theName = main.cap(2); - QString args = main.cap(3); + TQString args = main.cap(3); while(parameters.search(args) != -1) { theTypes += parameters.cap(1); theNames += parameters.cap(3); diff --git a/kdelirc/kdelirc/prototype.h b/kdelirc/kdelirc/prototype.h index 22c1123..0a963f7 100644 --- a/kdelirc/kdelirc/prototype.h +++ b/kdelirc/kdelirc/prototype.h @@ -13,9 +13,9 @@ #ifndef PROTOTYPE_H #define PROTOTYPE_H -#include -#include -#include +#include +#include +#include /** @author Gav Wood @@ -23,29 +23,29 @@ class Prototype { - QString original, theName, theReturn; - QStringList theNames, theTypes; + TQString original, theName, theReturn; + TQStringList theNames, theTypes; void parse(); public: unsigned count() const{ return theTypes.count(); } - const QPair operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); } - const QString &name(int i) const { return theNames[i]; } - const QString &type(int i) const { return theTypes[i]; } - const QString &returnType() const { return theReturn; } - const QString &name() const { return theName; } - const QString &prototype() const { return original; } - const QString argumentList() const; - const QString argumentListNN() const; + const QPair operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); } + const TQString &name(int i) const { return theNames[i]; } + const TQString &type(int i) const { return theTypes[i]; } + const TQString &returnType() const { return theReturn; } + const TQString &name() const { return theName; } + const TQString &prototype() const { return original; } + const TQString argumentList() const; + const TQString argumentListNN() const; const int argumentCount() { return theTypes.count(); } - const QString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } + const TQString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } - void setPrototype(const QString &source) { original = source; parse(); } + void setPrototype(const TQString &source) { original = source; parse(); } - Prototype &operator=(const QString &source) { setPrototype(source); return *this; } + Prototype &operator=(const TQString &source) { setPrototype(source); return *this; } - Prototype(const QString &source); + Prototype(const TQString &source); Prototype(); ~Prototype(); diff --git a/kdelirc/kdelirc/remoteserver.cpp b/kdelirc/kdelirc/remoteserver.cpp index 25d8f44..db33591 100644 --- a/kdelirc/kdelirc/remoteserver.cpp +++ b/kdelirc/kdelirc/remoteserver.cpp @@ -11,8 +11,8 @@ // // -#include -#include +#include +#include #include #include @@ -34,8 +34,8 @@ RemoteServer::~RemoteServer() void RemoteServer::loadRemotes() { - QStringList theFiles = KGlobal::dirs()->findAllResources("data", "remotes/*.remote.xml"); - for(QStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) + TQStringList theFiles = KGlobal::dirs()->findAllResources("data", "remotes/*.remote.xml"); + for(TQStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i) { kdDebug() << "Found data file: " << *i << endl; Remote *p = new Remote(); p->loadFromFile(*i); @@ -52,25 +52,25 @@ Remote::~Remote() { } -void Remote::loadFromFile(const QString &fileName) +void Remote::loadFromFile(const TQString &fileName) { charBuffer = ""; curRB = 0; - QFile xmlFile(fileName); - QXmlInputSource source(&xmlFile); - QXmlSimpleReader reader; + TQFile xmlFile(fileName); + TQXmlInputSource source(&xmlFile); + TQXmlSimpleReader reader; reader.setContentHandler(this); reader.parse(source); } -bool Remote::characters(const QString &data) +bool Remote::characters(const TQString &data) { charBuffer += data; return true; } -bool Remote::startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes) +bool Remote::startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes) { if(name == "remote") theId = theName = attributes.value("id"); @@ -89,7 +89,7 @@ bool Remote::startElement(const QString &, const QString &, const QString &name, return true; } -bool Remote::endElement(const QString &, const QString &, const QString &name) +bool Remote::endElement(const TQString &, const TQString &, const TQString &name) { if(name == "name") if(curRB) diff --git a/kdelirc/kdelirc/remoteserver.h b/kdelirc/kdelirc/remoteserver.h index 3700acd..e74b02e 100644 --- a/kdelirc/kdelirc/remoteserver.h +++ b/kdelirc/kdelirc/remoteserver.h @@ -13,9 +13,9 @@ #ifndef REMOTESERVER_H #define REMOTESERVER_H -#include -#include -#include +#include +#include +#include /** @author Gav Wood @@ -24,45 +24,45 @@ class RemoteButton { - QString theName, theId, theClass, theParameter; + TQString theName, theId, theClass, theParameter; friend class Remote; public: - void setName(const QString &a) { theName = a; } - const QString &name(void) const { return theName; } - void setClass(const QString &a) { theClass = a; } - const QString &getClass(void) const { return theClass; } - void setParameter(const QString &a) { theParameter = a; } - const QString ¶meter(void) const { return theParameter; } - void setId(const QString &a) { theId = a; } - const QString &id(void) const { return theId; } + void setName(const TQString &a) { theName = a; } + const TQString &name(void) const { return theName; } + void setClass(const TQString &a) { theClass = a; } + const TQString &getClass(void) const { return theClass; } + void setParameter(const TQString &a) { theParameter = a; } + const TQString ¶meter(void) const { return theParameter; } + void setId(const TQString &a) { theId = a; } + const TQString &id(void) const { return theId; } }; class Remote : public QXmlDefaultHandler { - QString theName, theId, theAuthor; - QDict theButtons; + TQString theName, theId, theAuthor; + TQDict theButtons; - QString charBuffer; + TQString charBuffer; RemoteButton *curRB; friend class RemoteServer; public: - bool characters(const QString &data); - bool startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attributes); - bool endElement(const QString &, const QString &, const QString &name); + bool characters(const TQString &data); + bool startElement(const TQString &, const TQString &, const TQString &name, const TQXmlAttributes &attributes); + bool endElement(const TQString &, const TQString &, const TQString &name); - void setName(const QString &a) { theName = a; } - const QString &name(void) const { return theName; } - void setId(const QString &a) { theId = a; } - const QString &id(void) const { return theId; } - void setAuthor(const QString &a) { theAuthor = a; } - const QString &author(void) const { return theAuthor; } - const QDict &buttons() const { return theButtons; } + void setName(const TQString &a) { theName = a; } + const TQString &name(void) const { return theName; } + void setId(const TQString &a) { theId = a; } + const TQString &id(void) const { return theId; } + void setAuthor(const TQString &a) { theAuthor = a; } + const TQString &author(void) const { return theAuthor; } + const TQDict &buttons() const { return theButtons; } - void loadFromFile(const QString &fileName); + void loadFromFile(const TQString &fileName); - const QString &getButtonName(const QString &id) const { if(theButtons[id]) return theButtons[id]->name(); return id; } + const TQString &getButtonName(const TQString &id) const { if(theButtons[id]) return theButtons[id]->name(); return id; } Remote(); ~Remote(); @@ -72,15 +72,15 @@ class RemoteServer { static RemoteServer *theInstance; void loadRemotes(); - QDict theRemotes; + TQDict theRemotes; public: static RemoteServer *remoteServer() { if(!theInstance) theInstance = new RemoteServer(); return theInstance; } - const QDict &remotes() const { return theRemotes; } + const TQDict &remotes() const { return theRemotes; } - const QString &getRemoteName(const QString &id) const { if(theRemotes[id]) return theRemotes[id]->name(); return id; } - const QString &getButtonName(const QString &remote, const QString &button) const { if(theRemotes[remote]) return theRemotes[remote]->getButtonName(button); return button; } + const TQString &getRemoteName(const TQString &id) const { if(theRemotes[id]) return theRemotes[id]->name(); return id; } + const TQString &getButtonName(const TQString &remote, const TQString &button) const { if(theRemotes[remote]) return theRemotes[remote]->getButtonName(button); return button; } RemoteServer(); ~RemoteServer(); -- cgit v1.2.1