From 70b9eea2ba01c3691497f49e4c45cb070c16193c Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 1 Jul 2011 03:43:07 +0000 Subject: 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 --- kradio3/src/soundstreamclient_interfaces.cpp | 90 ++++++++++++++-------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'kradio3/src/soundstreamclient_interfaces.cpp') diff --git a/kradio3/src/soundstreamclient_interfaces.cpp b/kradio3/src/soundstreamclient_interfaces.cpp index c030ec4..943276c 100644 --- a/kradio3/src/soundstreamclient_interfaces.cpp +++ b/kradio3/src/soundstreamclient_interfaces.cpp @@ -27,7 +27,7 @@ const char *dev_urandom = "/dev/urandom"; void ISoundStreamServer::noticeConnectedI(cmplInterface *i, bool pointer_valid) { - for (QPtrListIterator it(iConnections); it.current(); ++it) { + for (TQPtrListIterator it(iConnections); it.current(); ++it) { it.current()->noticeConnectedSoundClient(i, pointer_valid); cmplInterface *x = it.current(); if (x != i && pointer_valid) @@ -37,7 +37,7 @@ void ISoundStreamServer::noticeConnectedI(cmplInterface *i, bool pointer_valid) void ISoundStreamServer::noticeDisconnectedI(cmplInterface *i, bool pointer_valid) { - for (QPtrListIterator it(iConnections); it.current(); ++it) { + for (TQPtrListIterator it(iConnections); it.current(); ++it) { it.current()->noticeDisconnectedSoundClient(i, pointer_valid); cmplInterface *x = it.current(); if (x != i && pointer_valid) @@ -47,20 +47,20 @@ void ISoundStreamServer::noticeDisconnectedI(cmplInterface *i, bool pointer_vali -QPtrList ISoundStreamServer::getPlaybackMixers() const +TQPtrList ISoundStreamServer::getPlaybackMixers() const { - QPtrList tmp; - for (QPtrListIterator it(iConnections); it.current(); ++it) { + TQPtrList tmp; + for (TQPtrListIterator it(iConnections); it.current(); ++it) { if (it.current()->supportsPlayback()) tmp.append(it.current()); } return tmp; } -QPtrList ISoundStreamServer::getCaptureMixers() const +TQPtrList ISoundStreamServer::getCaptureMixers() const { - QPtrList tmp; - for (QPtrListIterator it(iConnections); it.current(); ++it) { + TQPtrList tmp; + for (TQPtrListIterator it(iConnections); it.current(); ++it) { if (it.current()->supportsCapture()) tmp.append(it.current()); } @@ -196,18 +196,18 @@ IF_IMPL_SENDER_FINE ( ISoundStreamServer, queryIsMuted, (SoundStreamID id, bool isMuted(id, m) ); -IF_IMPL_SENDER_FINE ( ISoundStreamServer, notifyPlaybackChannelsChanged, (const QString &client_id, const QStringList &map), +IF_IMPL_SENDER_FINE ( ISoundStreamServer, notifyPlaybackChannelsChanged, (const TQString &client_id, const TQStringList &map), noticePlaybackChannelsChanged(client_id, map) ); -IF_IMPL_SENDER_FINE ( ISoundStreamServer, notifyCaptureChannelsChanged, (const QString &client_id, const QStringList &map), +IF_IMPL_SENDER_FINE ( ISoundStreamServer, notifyCaptureChannelsChanged, (const TQString &client_id, const TQStringList &map), noticeCaptureChannelsChanged (client_id, map) ); -IF_IMPL_SENDER_FINE ( ISoundStreamServer, querySoundStreamDescription, (SoundStreamID id, QString &descr), +IF_IMPL_SENDER_FINE ( ISoundStreamServer, querySoundStreamDescription, (SoundStreamID id, TQString &descr), getSoundStreamDescription(id, descr) ); IF_IMPL_SENDER_FINE ( ISoundStreamServer, querySoundStreamRadioStation, (SoundStreamID id, const RadioStation *&rs), getSoundStreamRadioStation(id, rs) ); -IF_IMPL_SENDER_FINE ( ISoundStreamServer, queryEnumerateSoundStreams, (QMap &list), +IF_IMPL_SENDER_FINE ( ISoundStreamServer, queryEnumerateSoundStreams, (TQMap &list), enumerateSoundStreams(list) ); @@ -228,26 +228,26 @@ ISoundStreamClient::~ISoundStreamClient() { } -QString ISoundStreamClient::createNewSoundStreamClientID() +TQString ISoundStreamClient::createNewSoundStreamClientID() { const int buffersize = 32; unsigned char buffer[buffersize]; - QString stime, srandom = QString::null; + TQString stime, srandom = TQString(); stime.setNum(time(NULL)); int fd = open (dev_urandom, O_RDONLY); read(fd, buffer, buffersize); close(fd); for (int i = 0; i < buffersize; ++i) - srandom += QString().sprintf("%02X", (unsigned int)buffer[i]); + srandom += TQString().sprintf("%02X", (unsigned int)buffer[i]); return stime + srandom; } -void ISoundStreamClient::setSoundStreamClientID(const QString &s) +void ISoundStreamClient::setSoundStreamClientID(const TQString &s) { ISoundStreamServer *server = getSoundStreamServer(); if (server) @@ -258,7 +258,7 @@ void ISoundStreamClient::setSoundStreamClientID(const QString &s) } -const QString &ISoundStreamClient::getSoundStreamClientID() const +const TQString &ISoundStreamClient::getSoundStreamClientID() const { return m_SoundStreamClientID; } @@ -304,30 +304,30 @@ void ISoundStreamClient::closeSoundStream(SoundStreamID id, bool notify) } -static const QStringList emptyList; +static const TQStringList emptyList; -const QStringList &ISoundStreamClient::getPlaybackChannels() const +const TQStringList &ISoundStreamClient::getPlaybackChannels() const { return emptyList; } -const QStringList &ISoundStreamClient::getCaptureChannels() const +const TQStringList &ISoundStreamClient::getCaptureChannels() const { return emptyList; } -static const QMap emptyClientMap; -QMap ISoundStreamClient::getPlaybackClients() const +static const TQMap emptyClientMap; +TQMap ISoundStreamClient::getPlaybackClients() const { return iConnections.count() ? iConnections.getFirst()->getPlaybackClients() : emptyClientMap; } -QMap ISoundStreamServer::getPlaybackClients() const +TQMap ISoundStreamServer::getPlaybackClients() const { - QMap map; - for (QPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { + TQMap map; + for (TQPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { if (it.current()->supportsPlayback()) map.insert(it.current()->getSoundStreamClientID(), it.current()); } @@ -336,16 +336,16 @@ QMap ISoundStreamServer::getPlaybackClients() con -static const QMap emptyClientDescrMap; -QMap ISoundStreamClient::getPlaybackClientDescriptions() const +static const TQMap emptyClientDescrMap; +TQMap ISoundStreamClient::getPlaybackClientDescriptions() const { return iConnections.count() ? iConnections.getFirst()->getPlaybackClientDescriptions() : emptyClientDescrMap; } -QMap ISoundStreamServer::getPlaybackClientDescriptions() const +TQMap ISoundStreamServer::getPlaybackClientDescriptions() const { - QMap map; - for (QPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { + TQMap map; + for (TQPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { if (it.current()->supportsPlayback()) map.insert(it.current()->getSoundStreamClientID(), it.current()->getSoundStreamClientDescription()); } @@ -355,16 +355,16 @@ QMap ISoundStreamServer::getPlaybackClientDescriptions() const -QMap ISoundStreamClient::getCaptureClients() const +TQMap ISoundStreamClient::getCaptureClients() const { return iConnections.count() ? iConnections.getFirst()->getCaptureClients() : emptyClientMap; } -QMap ISoundStreamServer::getCaptureClients() const +TQMap ISoundStreamServer::getCaptureClients() const { - QMap map; - for (QPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { + TQMap map; + for (TQPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { if (it.current()->supportsCapture()) map.insert(it.current()->getSoundStreamClientID(), it.current()); } @@ -374,15 +374,15 @@ QMap ISoundStreamServer::getCaptureClients() cons -QMap ISoundStreamClient::getCaptureClientDescriptions() const +TQMap ISoundStreamClient::getCaptureClientDescriptions() const { return iConnections.count() ? iConnections.getFirst()->getCaptureClientDescriptions() : emptyClientDescrMap; } -QMap ISoundStreamServer::getCaptureClientDescriptions() const +TQMap ISoundStreamServer::getCaptureClientDescriptions() const { - QMap map; - for (QPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { + TQMap map; + for (TQPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { if (it.current()->supportsCapture()) map.insert(it.current()->getSoundStreamClientID(), it.current()->getSoundStreamClientDescription()); } @@ -393,15 +393,15 @@ QMap ISoundStreamServer::getCaptureClientDescriptions() const -ISoundStreamClient *ISoundStreamClient::getSoundStreamClientWithID(const QString &search_id) const +ISoundStreamClient *ISoundStreamClient::getSoundStreamClientWithID(const TQString &search_id) const { return iConnections.count() ? iConnections.getFirst()->getSoundStreamClientWithID(search_id) : NULL; } -ISoundStreamClient *ISoundStreamServer::getSoundStreamClientWithID(const QString &search_id) const +ISoundStreamClient *ISoundStreamServer::getSoundStreamClientWithID(const TQString &search_id) const { - for (QPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { - const QString &id = it.current()->getSoundStreamClientID(); + for (TQPtrListIterator it(ISoundStreamServer::iConnections); it.current(); ++it) { + const TQString &id = it.current()->getSoundStreamClientID(); if (id == search_id) return it.current(); } @@ -416,11 +416,11 @@ void ISoundStreamClient::noticeDisconnectedSoundClient(thisInterface */*i*/, boo { } -static const QPtrList emptyClientList; -IF_IMPL_QUERY ( QPtrList ISoundStreamClient::queryPlaybackMixers(), +static const TQPtrList emptyClientList; +IF_IMPL_TQUERY ( TQPtrList ISoundStreamClient::queryPlaybackMixers(), getPlaybackMixers(), emptyClientList ); -IF_IMPL_QUERY ( QPtrList ISoundStreamClient::queryCaptureMixers(), +IF_IMPL_TQUERY ( TQPtrList ISoundStreamClient::queryCaptureMixers(), getPlaybackMixers(), emptyClientList ); -- cgit v1.2.1