summaryrefslogtreecommitdiffstats
path: root/src/fetch/discogsfetcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch/discogsfetcher.cpp')
-rw-r--r--src/fetch/discogsfetcher.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/fetch/discogsfetcher.cpp b/src/fetch/discogsfetcher.cpp
index 13341f6..5260794 100644
--- a/src/fetch/discogsfetcher.cpp
+++ b/src/fetch/discogsfetcher.cpp
@@ -45,7 +45,7 @@ using Tellico::Fetch::DiscogsFetcher;
DiscogsFetcher::DiscogsFetcher(TQObject* parent_, const char* name_)
: Fetcher(parent_, name_), m_xsltHandler(0),
m_limit(DISCOGS_MAX_RETURNS_TOTAL), m_job(0), m_started(false),
- m_apiKey(TQString::tqfromLatin1(DISCOGS_API_KEY)) {
+ m_apiKey(TQString::fromLatin1(DISCOGS_API_KEY)) {
}
DiscogsFetcher::~DiscogsFetcher() {
@@ -89,9 +89,9 @@ void DiscogsFetcher::continueSearch() {
}
void DiscogsFetcher::doSearch() {
- KURL u(TQString::tqfromLatin1(DISCOGS_API_URL));
- u.addQueryItem(TQString::tqfromLatin1("f"), TQString::tqfromLatin1("xml"));
- u.addQueryItem(TQString::tqfromLatin1("api_key"), m_apiKey);
+ KURL u(TQString::fromLatin1(DISCOGS_API_URL));
+ u.addQueryItem(TQString::fromLatin1("f"), TQString::fromLatin1("xml"));
+ u.addQueryItem(TQString::fromLatin1("api_key"), m_apiKey);
if(!canFetch(Kernel::self()->collectionType())) {
message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
@@ -101,19 +101,19 @@ void DiscogsFetcher::doSearch() {
switch(m_key) {
case Title:
- u.setPath(TQString::tqfromLatin1("/search"));
- u.addQueryItem(TQString::tqfromLatin1("q"), m_value);
- u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("release"));
+ u.setPath(TQString::fromLatin1("/search"));
+ u.addQueryItem(TQString::fromLatin1("q"), m_value);
+ u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("release"));
break;
case Person:
- u.setPath(TQString::tqfromLatin1("/artist/%1").tqarg(m_value));
+ u.setPath(TQString::fromLatin1("/artist/%1").tqarg(m_value));
break;
case Keyword:
- u.setPath(TQString::tqfromLatin1("/search"));
- u.addQueryItem(TQString::tqfromLatin1("q"), m_value);
- u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all"));
+ u.setPath(TQString::fromLatin1("/search"));
+ u.addQueryItem(TQString::fromLatin1("q"), m_value);
+ u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("all"));
break;
default:
@@ -123,7 +123,7 @@ void DiscogsFetcher::doSearch() {
}
#ifdef DISCOGS_TEST
- u = KURL(TQString::tqfromLatin1("/home/robby/discogs-results.xml"));
+ u = KURL(TQString::fromLatin1("/home/robby/discogs-results.xml"));
#endif
// myDebug() << "DiscogsFetcher::search() - url: " << u.url() << endl;
@@ -168,7 +168,7 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from discogsfetcher.cpp" << endl;
- TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::fromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
TQTextStream t(&f);
t.setEncoding(TQTextStream::UnicodeUTF8);
@@ -192,11 +192,11 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) {
return;
}
// total is /resp/searchresults/@numResults
- TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("resp"))
- .namedItem(TQString::tqfromLatin1("searchresults"));
+ TQDomNode n = dom.documentElement().namedItem(TQString::fromLatin1("resp"))
+ .namedItem(TQString::fromLatin1("searchresults"));
TQDomElement e = n.toElement();
if(!e.isNull()) {
- m_total = e.attribute(TQString::tqfromLatin1("numResults")).toInt();
+ m_total = e.attribute(TQString::fromLatin1("numResults")).toInt();
myDebug() << "total = " << m_total;
}
}
@@ -218,9 +218,9 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- TQString desc = entry->field(TQString::tqfromLatin1("artist"))
+ TQString desc = entry->field(TQString::fromLatin1("artist"))
+ TQChar('/')
- + entry->field(TQString::tqfromLatin1("label"));
+ + entry->field(TQString::fromLatin1("label"));
SearchResult* r = new SearchResult(this, entry->title(), desc, TQString());
m_entries.insert(r->uid, Data::EntryPtr(entry));
@@ -241,24 +241,24 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {
}
// one way we tell if this entry has been fully initialized is to
// check for a cover image
- if(!entry->field(TQString::tqfromLatin1("cover")).isEmpty()) {
+ if(!entry->field(TQString::fromLatin1("cover")).isEmpty()) {
myLog() << "DiscogsFetcher::fetchEntry() - already downloaded " << entry->title() << endl;
return entry;
}
- TQString release = entry->field(TQString::tqfromLatin1("discogs-id"));
+ TQString release = entry->field(TQString::fromLatin1("discogs-id"));
if(release.isEmpty()) {
myDebug() << "DiscogsFetcher::fetchEntry() - no discogs release found" << endl;
return entry;
}
#ifdef DISCOGS_TEST
- KURL u(TQString::tqfromLatin1("/home/robby/discogs-release.xml"));
+ KURL u(TQString::fromLatin1("/home/robby/discogs-release.xml"));
#else
- KURL u(TQString::tqfromLatin1(DISCOGS_API_URL));
- u.setPath(TQString::tqfromLatin1("/release/%1").tqarg(release));
- u.addQueryItem(TQString::tqfromLatin1("f"), TQString::tqfromLatin1("xml"));
- u.addQueryItem(TQString::tqfromLatin1("api_key"), m_apiKey);
+ KURL u(TQString::fromLatin1(DISCOGS_API_URL));
+ u.setPath(TQString::fromLatin1("/release/%1").tqarg(release));
+ u.addQueryItem(TQString::fromLatin1("f"), TQString::fromLatin1("xml"));
+ u.addQueryItem(TQString::fromLatin1("api_key"), m_apiKey);
#endif
// myDebug() << "DiscogsFetcher::fetchEntry() - url: " << u << endl;
@@ -266,7 +266,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {
TQString output = FileHandler::readTextFile(u, true, true, true);
#if 0
kdWarning() << "Remove output debug from discogsfetcher.cpp" << endl;
- TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::fromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
TQTextStream t(&f);
t.setEncoding(TQTextStream::UnicodeUTF8);
@@ -295,7 +295,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {
}
// don't want to include id
- coll->removeField(TQString::tqfromLatin1("discogs-id"));
+ coll->removeField(TQString::fromLatin1("discogs-id"));
entry = coll->entries().front();
m_entries.replace(uid_, entry);
@@ -303,7 +303,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {
}
void DiscogsFetcher::initXSLTHandler() {
- TQString xsltfile = locate("appdata", TQString::tqfromLatin1("discogs2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::fromLatin1("discogs2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "DiscogsFetcher::initXSLTHandler() - can not locate discogs2tellico.xsl." << endl;
return;
@@ -326,13 +326,13 @@ void DiscogsFetcher::updateEntry(Data::EntryPtr entry_) {
// myDebug() << "DiscogsFetcher::updateEntry()" << endl;
TQString value;
- TQString title = entry_->field(TQString::tqfromLatin1("title"));
+ TQString title = entry_->field(TQString::fromLatin1("title"));
if(!title.isEmpty()) {
search(Title, value);
return;
}
- TQString artist = entry_->field(TQString::tqfromLatin1("artist"));
+ TQString artist = entry_->field(TQString::fromLatin1("artist"));
if(!artist.isEmpty()) {
search(Person, artist);
return;
@@ -382,7 +382,7 @@ DiscogsFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const DiscogsFetch
m_apiKeyEdit->setText(fetcher_->m_apiKey);
m_fetchImageCheck->setChecked(fetcher_->m_fetchImages);
} else {
- m_apiKeyEdit->setText(TQString::tqfromLatin1(DISCOGS_API_KEY));
+ m_apiKeyEdit->setText(TQString::fromLatin1(DISCOGS_API_KEY));
m_fetchImageCheck->setChecked(true);
}
}
@@ -404,9 +404,9 @@ TQString DiscogsFetcher::ConfigWidget::preferredName() const {
Tellico::StringMap DiscogsFetcher::customFields() {
StringMap map;
- map[TQString::tqfromLatin1("producer")] = i18n("Producer");
- map[TQString::tqfromLatin1("nationality")] = i18n("Nationality");
- map[TQString::tqfromLatin1("discogs")] = i18n("Discogs Link");
+ map[TQString::fromLatin1("producer")] = i18n("Producer");
+ map[TQString::fromLatin1("nationality")] = i18n("Nationality");
+ map[TQString::fromLatin1("discogs")] = i18n("Discogs Link");
return map;
}