summaryrefslogtreecommitdiffstats
path: root/src/fetch/yahoofetcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch/yahoofetcher.cpp')
-rw-r--r--src/fetch/yahoofetcher.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/fetch/yahoofetcher.cpp b/src/fetch/yahoofetcher.cpp
index dcd1823..b54aae9 100644
--- a/src/fetch/yahoofetcher.cpp
+++ b/src/fetch/yahoofetcher.cpp
@@ -83,12 +83,12 @@ void YahooFetcher::continueSearch() {
void YahooFetcher::doSearch() {
// myDebug() << "YahooFetcher::search() - value = " << value_ << endl;
- KURL u(TQString::tqfromLatin1(YAHOO_BASE_URL));
- u.addQueryItem(TQString::tqfromLatin1("appid"), TQString::tqfromLatin1(YAHOO_APP_ID));
- u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all"));
- u.addQueryItem(TQString::tqfromLatin1("output"), TQString::tqfromLatin1("xml"));
- u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start));
- u.addQueryItem(TQString::tqfromLatin1("results"), TQString::number(YAHOO_MAX_RETURNS_TOTAL));
+ KURL u(TQString::fromLatin1(YAHOO_BASE_URL));
+ u.addQueryItem(TQString::fromLatin1("appid"), TQString::fromLatin1(YAHOO_APP_ID));
+ u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("all"));
+ u.addQueryItem(TQString::fromLatin1("output"), TQString::fromLatin1("xml"));
+ u.addQueryItem(TQString::fromLatin1("start"), TQString::number(m_start));
+ u.addQueryItem(TQString::fromLatin1("results"), TQString::number(YAHOO_MAX_RETURNS_TOTAL));
if(!canFetch(Kernel::self()->collectionType())) {
message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
@@ -98,17 +98,17 @@ void YahooFetcher::doSearch() {
switch(m_key) {
case Title:
- u.addQueryItem(TQString::tqfromLatin1("album"), m_value);
+ u.addQueryItem(TQString::fromLatin1("album"), m_value);
break;
case Person:
- u.addQueryItem(TQString::tqfromLatin1("artist"), m_value);
+ u.addQueryItem(TQString::fromLatin1("artist"), m_value);
break;
// raw is used for the entry updates
case Raw:
-// u.removeQueryItem(TQString::tqfromLatin1("type"));
-// u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("phrase"));
+// u.removeQueryItem(TQString::fromLatin1("type"));
+// u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("phrase"));
u.setQuery(u.query() + '&' + m_value);
break;
@@ -163,7 +163,7 @@ void YahooFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from yahoofetcher.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);
@@ -189,7 +189,7 @@ void YahooFetcher::slotComplete(KIO::Job* job_) {
// total is top level element, with attribute totalResultsAvailable
TQDomElement e = dom.documentElement();
if(!e.isNull()) {
- m_total = e.attribute(TQString::tqfromLatin1("totalResultsAvailable")).toInt();
+ m_total = e.attribute(TQString::fromLatin1("totalResultsAvailable")).toInt();
}
}
@@ -210,13 +210,13 @@ void YahooFetcher::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"))
+ TQChar('/')
- + entry->field(TQString::tqfromLatin1("year"));
+ + entry->field(TQString::fromLatin1("year"));
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -232,30 +232,30 @@ Tellico::Data::EntryPtr YahooFetcher::fetchEntry(uint uid_) {
return 0;
}
- KURL imageURL = entry->field(TQString::tqfromLatin1("image"));
+ KURL imageURL = entry->field(TQString::fromLatin1("image"));
if(!imageURL.isEmpty()) {
TQString id = ImageFactory::addImage(imageURL, true);
if(id.isEmpty()) {
// rich text causes tqlayout issues
-// emit signaltqStatus(i18n("<qt>The cover image for <i>%1</i> could not be loaded.</qt>").tqarg(
-// entry->field(TQString::tqfromLatin1("title"))));
+// emit signalStatus(i18n("<qt>The cover image for <i>%1</i> could not be loaded.</qt>").tqarg(
+// entry->field(TQString::fromLatin1("title"))));
message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
} else {
- entry->setField(TQString::tqfromLatin1("cover"), id);
+ entry->setField(TQString::fromLatin1("cover"), id);
}
}
getTracks(entry);
// don't want to show image urls in the fetch dialog
- entry->setField(TQString::tqfromLatin1("image"), TQString());
+ entry->setField(TQString::fromLatin1("image"), TQString());
// no need for album id now ?
- entry->setField(TQString::tqfromLatin1("yahoo"), TQString());
+ entry->setField(TQString::fromLatin1("yahoo"), TQString());
return entry;
}
void YahooFetcher::initXSLTHandler() {
- TQString xsltfile = locate("appdata", TQString::tqfromLatin1("yahoo2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::fromLatin1("yahoo2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "YahooFetcher::initXSLTHandler() - can not locate yahoo2tellico.xsl." << endl;
return;
@@ -276,20 +276,20 @@ void YahooFetcher::initXSLTHandler() {
void YahooFetcher::getTracks(Data::EntryPtr entry_) {
// get album id
- if(!entry_ || entry_->field(TQString::tqfromLatin1("yahoo")).isEmpty()) {
+ if(!entry_ || entry_->field(TQString::fromLatin1("yahoo")).isEmpty()) {
return;
}
- const TQString albumid = entry_->field(TQString::tqfromLatin1("yahoo"));
+ const TQString albumid = entry_->field(TQString::fromLatin1("yahoo"));
- KURL u(TQString::tqfromLatin1(YAHOO_BASE_URL));
- u.setFileName(TQString::tqfromLatin1("songSearch"));
- u.addQueryItem(TQString::tqfromLatin1("appid"), TQString::tqfromLatin1(YAHOO_APP_ID));
- u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all"));
- u.addQueryItem(TQString::tqfromLatin1("output"), TQString::tqfromLatin1("xml"));
+ KURL u(TQString::fromLatin1(YAHOO_BASE_URL));
+ u.setFileName(TQString::fromLatin1("songSearch"));
+ u.addQueryItem(TQString::fromLatin1("appid"), TQString::fromLatin1(YAHOO_APP_ID));
+ u.addQueryItem(TQString::fromLatin1("type"), TQString::fromLatin1("all"));
+ u.addQueryItem(TQString::fromLatin1("output"), TQString::fromLatin1("xml"));
// go ahesad and ask for all results, since there might well be more than 10 songs on the CD
- u.addQueryItem(TQString::tqfromLatin1("results"), TQString::number(50));
- u.addQueryItem(TQString::tqfromLatin1("albumid"), albumid);
+ u.addQueryItem(TQString::fromLatin1("results"), TQString::number(50));
+ u.addQueryItem(TQString::fromLatin1("albumid"), albumid);
// myDebug() << "YahooFetcher::getTracks() - url: " << u.url() << endl;
TQDomDocument dom = FileHandler::readXMLFile(u, false /*no namespace*/, true /*quiet*/);
@@ -300,7 +300,7 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) {
#if 0
kdWarning() << "Remove debug from yahoofetcher.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);
@@ -309,7 +309,7 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) {
f.close();
#endif
- const TQString track = TQString::tqfromLatin1("track");
+ const TQString track = TQString::fromLatin1("track");
TQDomNodeList nodes = dom.documentElement().childNodes();
for(uint i = 0; i < nodes.count(); ++i) {
@@ -317,16 +317,16 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) {
if(e.isNull()) {
continue;
}
- TQString t = e.namedItem(TQString::tqfromLatin1("Title")).toElement().text();
- TQString n = e.namedItem(TQString::tqfromLatin1("Track")).toElement().text();
+ TQString t = e.namedItem(TQString::fromLatin1("Title")).toElement().text();
+ TQString n = e.namedItem(TQString::fromLatin1("Track")).toElement().text();
bool ok;
int trackNum = Tellico::toUInt(n, &ok);
// trackNum might be 0
if(t.isEmpty() || !ok || trackNum < 1) {
continue;
}
- TQString a = e.namedItem(TQString::tqfromLatin1("Artist")).toElement().text();
- TQString l = e.namedItem(TQString::tqfromLatin1("Length")).toElement().text();
+ TQString a = e.namedItem(TQString::fromLatin1("Artist")).toElement().text();
+ TQString l = e.namedItem(TQString::fromLatin1("Length")).toElement().text();
int len = Tellico::toUInt(l, &ok);
TQString value = t + "::" + a;
@@ -346,14 +346,14 @@ TQString YahooFetcher::insertValue(const TQString& str_, const TQString& value_,
bool write = true;
if(!list[pos_-1].isNull()) {
// for some reason, some songs are repeated from yahoo, with 0 length, don't overwrite that
- if(value_.contains(TQString::tqfromLatin1("::")) < 2) { // means no length value
+ if(value_.contains(TQString::fromLatin1("::")) < 2) { // means no length value
write = false;
}
}
if(!value_.isEmpty() && write) {
list[pos_-1] = value_;
}
- return list.join(TQString::tqfromLatin1("; "));
+ return list.join(TQString::fromLatin1("; "));
}
void YahooFetcher::updateEntry(Data::EntryPtr entry_) {
@@ -362,16 +362,16 @@ void YahooFetcher::updateEntry(Data::EntryPtr entry_) {
m_limit = 5;
TQString value;
- TQString title = entry_->field(TQString::tqfromLatin1("title"));
+ TQString title = entry_->field(TQString::fromLatin1("title"));
if(!title.isEmpty()) {
- value += TQString::tqfromLatin1("album=") + title;
+ value += TQString::fromLatin1("album=") + title;
}
- TQString artist = entry_->field(TQString::tqfromLatin1("artist"));
+ TQString artist = entry_->field(TQString::fromLatin1("artist"));
if(!artist.isEmpty()) {
if(!value.isEmpty()) {
value += '&';
}
- value += TQString::tqfromLatin1("artist=") + artist;
+ value += TQString::fromLatin1("artist=") + artist;
}
if(!value.isEmpty()) {
search(Fetch::Raw, value);