diff options
Diffstat (limited to 'juk/ktrm.cpp')
-rw-r--r-- | juk/ktrm.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/juk/ktrm.cpp b/juk/ktrm.cpp index 38fd4ef5..cb45c685 100644 --- a/juk/ktrm.cpp +++ b/juk/ktrm.cpp @@ -29,11 +29,11 @@ #include <kurl.h> #include <kdebug.h> -#include <qmutex.h> -#include <qregexp.h> -#include <qevent.h> -#include <qobject.h> -#include <qfile.h> +#include <tqmutex.h> +#include <tqregexp.h> +#include <tqevent.h> +#include <tqobject.h> +#include <tqfile.h> #include <tunepimp/tp_c.h> #include <fixx11h.h> @@ -58,7 +58,7 @@ class KTRMRequestHandler public: static KTRMRequestHandler *instance() { - static QMutex mutex; + static TQMutex mutex; mutex.lock(); static KTRMRequestHandler handler; mutex.unlock(); @@ -71,9 +71,9 @@ public: if(!m_fileMap.contains(lookup->file())) { #if HAVE_MUSICBRAINZ >= 4 - id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()), 0); + id = tp_AddFile(m_pimp, TQFile::encodeName(lookup->file()), 0); #else - id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file())); + id = tp_AddFile(m_pimp, TQFile::encodeName(lookup->file())); #endif m_fileMap.insert(lookup->file(), id); } @@ -141,18 +141,18 @@ protected: if(KProtocolManager::useProxy()) { // split code copied from kcm_kio. - QString noProxiesFor = KProtocolManager::noProxyFor(); - QStringList noProxies = QStringList::split(QRegExp("[',''\t'' ']"), noProxiesFor); + TQString noProxiesFor = KProtocolManager::noProxyFor(); + TQStringList noProxies = TQStringList::split(TQRegExp("[',''\t'' ']"), noProxiesFor); bool useProxy = true; // Host that libtunepimp will contact. - QString tunepimpHost = "www.musicbrainz.org"; - QString tunepimpHostWithPort = "www.musicbrainz.org:80"; + TQString tunepimpHost = "www.musicbrainz.org"; + TQString tunepimpHostWithPort = "www.musicbrainz.org:80"; // Check what hosts are allowed to proceed without being proxied, // or is using reversed proxy, what hosts must be proxied. - for(QStringList::ConstIterator it = noProxies.constBegin(); it != noProxies.constEnd(); ++it) { - QString normalizedHost = KNetwork::KResolver::normalizeDomain(*it); + for(TQStringList::ConstIterator it = noProxies.constBegin(); it != noProxies.constEnd(); ++it) { + TQString normalizedHost = KNetwork::KResolver::normalizeDomain(*it); if(normalizedHost == tunepimpHost || tunepimpHost.endsWith("." + normalizedHost)) @@ -177,7 +177,7 @@ protected: if(useProxy) { KURL proxy = KProtocolManager::proxyFor("http"); - QString proxyHost = proxy.host(); + TQString proxyHost = proxy.host(); kdDebug(65432) << "Using proxy server " << proxyHost << " for www.musicbrainz.org.\n"; tp_SetProxy(m_pimp, proxyHost.latin1(), short(proxy.port())); @@ -192,9 +192,9 @@ protected: private: tunepimp_t m_pimp; - QMap<int, KTRMLookup *> m_lookupMap; - QMap<QString, int> m_fileMap; - mutable QMutex m_lookupMapMutex; + TQMap<int, KTRMLookup *> m_lookupMap; + TQMap<TQString, int> m_fileMap; + mutable TQMutex m_lookupMapMutex; }; @@ -213,7 +213,7 @@ public: }; KTRMEvent(int fileId, Status status) : - QCustomEvent(id), + TQCustomEvent(id), m_fileId(fileId), m_status(status) {} @@ -248,25 +248,25 @@ public: } protected: - KTRMEventHandler() : QObject() {} + KTRMEventHandler() : TQObject() {} static KTRMEventHandler *instance() { - static QMutex mutex; + static TQMutex mutex; mutex.lock(); static KTRMEventHandler handler; mutex.unlock(); return &handler; } - virtual void customEvent(QCustomEvent *event) + virtual void customEvent(TQCustomEvent *event) { if(!event->type() == KTRMEvent::id) return; KTRMEvent *e = static_cast<KTRMEvent *>(event); - static QMutex mutex; + static TQMutex mutex; mutex.lock(); if(!KTRMRequestHandler::instance()->lookupMapContains(e->fileId())) { @@ -348,9 +348,9 @@ class KTRMResult::KTRMResultPrivate { public: KTRMResultPrivate() : track(0), year(0), relevance(0) {} - QString title; - QString artist; - QString album; + TQString title; + TQString artist; + TQString album; int track; int year; int relevance; @@ -375,17 +375,17 @@ KTRMResult::~KTRMResult() delete d; } -QString KTRMResult::title() const +TQString KTRMResult::title() const { return d->title; } -QString KTRMResult::artist() const +TQString KTRMResult::artist() const { return d->artist; } -QString KTRMResult::album() const +TQString KTRMResult::album() const { return d->album; } @@ -425,7 +425,7 @@ class KTRMLookup::KTRMLookupPrivate public: KTRMLookupPrivate() : fileId(-1) {} - QString file; + TQString file; KTRMResultList results; int fileId; bool autoDelete; @@ -435,7 +435,7 @@ public: // KTRMLookup public methods //////////////////////////////////////////////////////////////////////////////// -KTRMLookup::KTRMLookup(const QString &file, bool autoDelete) +KTRMLookup::KTRMLookup(const TQString &file, bool autoDelete) { d = new KTRMLookupPrivate; d->file = file; @@ -449,7 +449,7 @@ KTRMLookup::~KTRMLookup() delete d; } -QString KTRMLookup::file() const +TQString KTRMLookup::file() const { return d->file; } @@ -472,9 +472,9 @@ void KTRMLookup::recognized() KTRMResult result; - result.d->title = QString::fromUtf8(metaData->track); - result.d->artist = QString::fromUtf8(metaData->artist); - result.d->album = QString::fromUtf8(metaData->album); + result.d->title = TQString::fromUtf8(metaData->track); + result.d->artist = TQString::fromUtf8(metaData->artist); + result.d->album = TQString::fromUtf8(metaData->album); result.d->track = metaData->trackNum; result.d->year = metaData->releaseYear; @@ -548,14 +548,14 @@ void KTRMLookup::collision() for(int i = 0; i < resultCount; i++) { KTRMResult result; - result.d->title = QString::fromUtf8(tracks[i]->name); + result.d->title = TQString::fromUtf8(tracks[i]->name); #if HAVE_MUSICBRAINZ >= 4 - result.d->artist = QString::fromUtf8(tracks[i]->artist.name); - result.d->album = QString::fromUtf8(tracks[i]->album.name); + result.d->artist = TQString::fromUtf8(tracks[i]->artist.name); + result.d->album = TQString::fromUtf8(tracks[i]->album.name); result.d->year = tracks[i]->album.releaseYear; #else - result.d->artist = QString::fromUtf8(tracks[i]->artist->name); - result.d->album = QString::fromUtf8(tracks[i]->album->name); + result.d->artist = TQString::fromUtf8(tracks[i]->artist->name); + result.d->album = TQString::fromUtf8(tracks[i]->album->name); result.d->year = tracks[i]->album->releaseYear; #endif result.d->track = tracks[i]->trackNum; |