diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
commit | 70b9eea2ba01c3691497f49e4c45cb070c16193c (patch) | |
tree | 9a6df61aa247a27275aad9c5245e419e89c2c640 /kradio3/plugins/lirc/lircsupport.cpp | |
parent | 998c1384ace4ae4655997c181fa33242148cd0a4 (diff) | |
download | tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.tar.gz tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.zip |
TQt4 port kradio
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1238952 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/plugins/lirc/lircsupport.cpp')
-rw-r--r-- | kradio3/plugins/lirc/lircsupport.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kradio3/plugins/lirc/lircsupport.cpp b/kradio3/plugins/lirc/lircsupport.cpp index 3b64580..68bcb6a 100644 --- a/kradio3/plugins/lirc/lircsupport.cpp +++ b/kradio3/plugins/lirc/lircsupport.cpp @@ -21,9 +21,9 @@ #include <lirc/lirc_client.h> #endif -#include <qsocketnotifier.h> -#include <qtimer.h> -#include <qfile.h> +#include <tqsocketnotifier.h> +#include <tqtimer.h> +#include <tqfile.h> #include <kapplication.h> #include <kaboutdata.h> @@ -49,7 +49,7 @@ PLUGIN_LIBRARY_FUNCTIONS(LircSupport, "kradio-lirc", i18n("Linux Infrared Contro ///////////////////////////////////////////////////////////////////////////// -LircSupport::LircSupport(const QString &name) +LircSupport::LircSupport(const TQString &name) : PluginBase(name, i18n("LIRC Plugin")), m_TakeRawLIRC(false) { @@ -59,13 +59,13 @@ LircSupport::LircSupport(const QString &name) fprintf (stderr, "%s\n", (const char*)i18n("initializing kradio lirc plugin").utf8()); char *prg = (char*)"kradio"; - QString slircrc = getenv("HOME"); + TQString slircrc = getenv("HOME"); slircrc += "/" LIRCRC; - QFile lircrc(slircrc); + TQFile lircrc(slircrc); if (!lircrc.exists()) { - logWarning(i18n("%1 does not exist. File was created with KRadio's default .lircrc proposal").arg(LIRCRC)); - QFile default_lircrc(locate("data", "kradio/default-dot-lircrc")); + logWarning(i18n("%1 does not exist. File was created with KRadio's default .lircrc proposal").tqarg(LIRCRC)); + TQFile default_lircrc(locate("data", "kradio/default-dot-lircrc")); lircrc.open(IO_WriteOnly); default_lircrc.open(IO_ReadOnly); char *buf = new char [default_lircrc.size() + 1]; @@ -82,14 +82,14 @@ LircSupport::LircSupport(const QString &name) if (m_fd_lirc != -1) { if (lirc_readconfig (NULL, &m_lircConfig, NULL) == 0) { - m_lirc_notify = new QSocketNotifier(m_fd_lirc, QSocketNotifier::Read, this, "lirc_notifier"); + m_lirc_notify = new TQSocketNotifier(m_fd_lirc, TQSocketNotifier::Read, this, "lirc_notifier"); if (m_lirc_notify) - QObject::connect(m_lirc_notify, SIGNAL(activated(int)), this, SLOT(slotLIRC(int))); + TQObject::connect(m_lirc_notify, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotLIRC(int))); // check config lirc_config_entry *found = NULL; for (lirc_config_entry *e = m_lircConfig->first; e; e = e->next) { - if (QString(e->prog) == prg) + if (TQString(e->prog) == prg) found = e; } if (!found) { @@ -113,8 +113,8 @@ LircSupport::LircSupport(const QString &name) } #endif - m_kbdTimer = new QTimer (this); - QObject::connect (m_kbdTimer, SIGNAL(timeout()), this, SLOT(slotKbdTimedOut())); + m_kbdTimer = new TQTimer (this); + TQObject::connect (m_kbdTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotKbdTimedOut())); m_addIndex = 0; } @@ -143,10 +143,10 @@ void LircSupport::slotLIRC(int /*socket*/ ) if (lirc_nextcode(&code) == 0) { while(m_TakeRawLIRC || (lirc_code2char (m_lircConfig, code, &c) == 0 && c != NULL)) { - QString x = c; + TQString x = c; int repeat_counter = 1; - if (m_TakeRawLIRC || (QString(c) == "eventmap")) { - QStringList l = QStringList::split(" ", code); + if (m_TakeRawLIRC || (TQString(c) == "eventmap")) { + TQStringList l = TQStringList::split(" ", code); if (l.count() >=4) { x = l[2]; repeat_counter = l[1].toInt(NULL, 16); @@ -154,7 +154,7 @@ void LircSupport::slotLIRC(int /*socket*/ ) } bool consumed = false; - logDebug(QString("LIRC: ") + x); + logDebug(TQString("LIRC: ") + x); emit sigRawLIRCSignal(x, repeat_counter, consumed); @@ -238,7 +238,7 @@ void LircSupport::saveState (KConfig *c) const c->writeEntry("LIRC_SEARCH_NEXT", m_Actions[LIRC_SEARCH_NEXT]); c->writeEntry("LIRC_SEARCH_PREV", m_Actions[LIRC_SEARCH_PREV]); c->writeEntry("LIRC_SLEEP", m_Actions[LIRC_SLEEP]); - c->writeEntry("LIRC_APPLICATION_QUIT", m_Actions[LIRC_APPLICATION_QUIT]); + c->writeEntry("LIRC_APPLICATION_TQUIT", m_Actions[LIRC_APPLICATION_TQUIT]); c->writeEntry("ALT_LIRC_DIGIT_0", m_AlternativeActions[LIRC_DIGIT_0]); @@ -263,7 +263,7 @@ void LircSupport::saveState (KConfig *c) const c->writeEntry("ALT_LIRC_SEARCH_NEXT", m_AlternativeActions[LIRC_SEARCH_NEXT]); c->writeEntry("ALT_LIRC_SEARCH_PREV", m_AlternativeActions[LIRC_SEARCH_PREV]); c->writeEntry("ALT_LIRC_SLEEP", m_AlternativeActions[LIRC_SLEEP]); - c->writeEntry("ALT_LIRC_APPLICATION_QUIT", m_AlternativeActions[LIRC_APPLICATION_QUIT]); + c->writeEntry("ALT_LIRC_APPLICATION_TQUIT", m_AlternativeActions[LIRC_APPLICATION_TQUIT]); } void LircSupport::restoreState (KConfig *c) @@ -290,7 +290,7 @@ void LircSupport::restoreState (KConfig *c) m_Actions[LIRC_SEARCH_NEXT] = c->readEntry("LIRC_SEARCH_NEXT", "SOURCE"); m_Actions[LIRC_SEARCH_PREV] = c->readEntry("LIRC_SEARCH_PREV", "MUTE"); m_Actions[LIRC_SLEEP] = c->readEntry("LIRC_SLEEP", "MINIMIZE"); - m_Actions[LIRC_APPLICATION_QUIT] = c->readEntry("LIRC_APPLICATION_QUIT", ""); + m_Actions[LIRC_APPLICATION_TQUIT] = c->readEntry("LIRC_APPLICATION_TQUIT", ""); m_AlternativeActions[LIRC_DIGIT_0] = c->readEntry("ALT_LIRC_DIGIT_0", ""); @@ -315,7 +315,7 @@ void LircSupport::restoreState (KConfig *c) m_AlternativeActions[LIRC_SEARCH_NEXT] = c->readEntry("ALT_LIRC_SEARCH_NEXT", ""); m_AlternativeActions[LIRC_SEARCH_PREV] = c->readEntry("ALT_LIRC_SEARCH_PREV", ""); m_AlternativeActions[LIRC_SLEEP] = c->readEntry("ALT_LIRC_SLEEP", ""); - m_AlternativeActions[LIRC_APPLICATION_QUIT] = c->readEntry("ALT_LIRC_APPLICATION_QUIT", ""); + m_AlternativeActions[LIRC_APPLICATION_TQUIT] = c->readEntry("ALT_LIRC_APPLICATION_TQUIT", ""); emit sigUpdateConfig(); } @@ -324,9 +324,9 @@ void LircSupport::restoreState (KConfig *c) ConfigPageInfo LircSupport::createConfigurationPage() { LIRCConfiguration *conf = new LIRCConfiguration(NULL, this); - QObject::connect(this, SIGNAL(sigUpdateConfig()), conf, SLOT(slotUpdateConfig())); - QObject::connect(this, SIGNAL(sigRawLIRCSignal(const QString &, int, bool &)), - conf, SLOT (slotRawLIRCSignal(const QString &, int, bool &))); + TQObject::connect(this, TQT_SIGNAL(sigUpdateConfig()), conf, TQT_SLOT(slotUpdateConfig())); + TQObject::connect(this, TQT_SIGNAL(sigRawLIRCSignal(const TQString &, int, bool &)), + conf, TQT_SLOT (slotRawLIRCSignal(const TQString &, int, bool &))); return ConfigPageInfo (conf, i18n("LIRC Support"), i18n("LIRC Plugin"), @@ -357,7 +357,7 @@ AboutPageInfo LircSupport::createAboutPage() } -bool LircSupport::checkActions(const QString &lirc_string, int repeat_counter, const QMap<LIRC_Actions, QString> &map) +bool LircSupport::checkActions(const TQString &lirc_string, int repeat_counter, const TQMap<LIRC_Actions, TQString> &map) { SoundStreamID streamID = queryCurrentSoundStreamID(); @@ -366,8 +366,8 @@ bool LircSupport::checkActions(const QString &lirc_string, int repeat_counter, c SoundFormat sf; ISeekRadio *seeker = NULL; - QMapConstIterator<LIRC_Actions, QString> it = map.begin(); - QMapConstIterator<LIRC_Actions, QString> end = map.end(); + TQMapConstIterator<LIRC_Actions, TQString> it = map.begin(); + TQMapConstIterator<LIRC_Actions, TQString> end = map.end(); for (; !retval && it != end; ++it) { if ((*it).length() && lirc_string == *it) { LIRC_Actions action = it.key(); @@ -519,7 +519,7 @@ bool LircSupport::checkActions(const QString &lirc_string, int repeat_counter, c sendStartCountdown(); } break; - case LIRC_APPLICATION_QUIT : + case LIRC_APPLICATION_TQUIT : retval = true; kapp->quit(); break; @@ -543,7 +543,7 @@ bool LircSupport::checkActions(const QString &lirc_string, int repeat_counter, c } -void LircSupport::setActions(const QMap<LIRC_Actions, QString> &actions, const QMap<LIRC_Actions, QString> &alt_actions) +void LircSupport::setActions(const TQMap<LIRC_Actions, TQString> &actions, const TQMap<LIRC_Actions, TQString> &alt_actions) { m_Actions = actions; m_AlternativeActions = alt_actions; |