summaryrefslogtreecommitdiffstats
path: root/src/fetch/arxivfetcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch/arxivfetcher.cpp')
-rw-r--r--src/fetch/arxivfetcher.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/fetch/arxivfetcher.cpp b/src/fetch/arxivfetcher.cpp
index 6586d94..795db25 100644
--- a/src/fetch/arxivfetcher.cpp
+++ b/src/fetch/arxivfetcher.cpp
@@ -140,7 +140,7 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from arxivfetcher.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);
@@ -164,8 +164,8 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
return;
}
// total is top level element, with attribute totalResultsAvailable
- TQDomNodeList list = dom.elementsByTagNameNS(TQString::tqfromLatin1("http://a9.com/-/spec/opensearch/1.1/"),
- TQString::tqfromLatin1("totalResults"));
+ TQDomNodeList list = dom.elementsByTagNameNS(TQString::fromLatin1("http://a9.com/-/spec/opensearch/1.1/"),
+ TQString::fromLatin1("totalResults"));
if(list.count() > 0) {
m_total = list.item(0).toElement().text().toInt();
}
@@ -188,13 +188,13 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- TQString desc = entry->field(TQString::tqfromLatin1("author"))
- + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
- if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
- desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year"));
+ TQString desc = entry->field(TQString::fromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::fromLatin1("publisher"));
+ if(!entry->field(TQString::fromLatin1("year")).isEmpty()) {
+ desc += TQChar('/') + 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);
}
@@ -207,19 +207,19 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
Tellico::Data::EntryPtr ArxivFetcher::fetchEntry(uint uid_) {
Data::EntryPtr entry = m_entries[uid_];
// if URL but no cover image, fetch it
- if(!entry->field(TQString::tqfromLatin1("url")).isEmpty()) {
+ if(!entry->field(TQString::fromLatin1("url")).isEmpty()) {
Data::CollPtr coll = entry->collection();
- Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover"));
+ Data::FieldPtr field = coll->fieldByName(TQString::fromLatin1("cover"));
if(!field && !coll->imageFields().isEmpty()) {
field = coll->imageFields().front();
} else if(!field) {
- field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
+ field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
coll->addField(field);
}
if(entry->field(field).isEmpty()) {
- TQPixmap pix = NetAccess::filePreview(entry->field(TQString::tqfromLatin1("url")));
+ TQPixmap pix = NetAccess::filePreview(entry->field(TQString::fromLatin1("url")));
if(!pix.isNull()) {
- TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG"));
if(!id.isEmpty()) {
entry->setField(field, id);
}
@@ -230,7 +230,7 @@ Tellico::Data::EntryPtr ArxivFetcher::fetchEntry(uint uid_) {
}
void ArxivFetcher::initXSLTHandler() {
- TQString xsltfile = locate("appdata", TQString::tqfromLatin1("arxiv2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::fromLatin1("arxiv2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "ArxivFetcher::initXSLTHandler() - can not locate arxiv2tellico.xsl." << endl;
return;
@@ -250,33 +250,33 @@ void ArxivFetcher::initXSLTHandler() {
}
KURL ArxivFetcher::searchURL(FetchKey key_, const TQString& value_) const {
- KURL u(TQString::tqfromLatin1(ARXIV_BASE_URL));
- u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start));
- u.addQueryItem(TQString::tqfromLatin1("max_results"), TQString::number(ARXIV_RETURNS_PER_REQUEST));
+ KURL u(TQString::fromLatin1(ARXIV_BASE_URL));
+ u.addQueryItem(TQString::fromLatin1("start"), TQString::number(m_start));
+ u.addQueryItem(TQString::fromLatin1("max_results"), TQString::number(ARXIV_RETURNS_PER_REQUEST));
// quotes should be used if spaces are present, just use all the time
TQString quotedValue = '"' + value_ + '"';
switch(key_) {
case Title:
- u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("ti:%1").tqarg(quotedValue));
+ u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("ti:%1").tqarg(quotedValue));
break;
case Person:
- u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("au:%1").tqarg(quotedValue));
+ u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("au:%1").tqarg(quotedValue));
break;
case Keyword:
// keyword gets to use all the words without being quoted
- u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("all:%1").tqarg(value_));
+ u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("all:%1").tqarg(value_));
break;
case ArxivID:
{
// remove prefix and/or version number
TQString value = value_;
- value.remove(TQRegExp(TQString::tqfromLatin1("^arxiv:"), false));
- value.remove(TQRegExp(TQString::tqfromLatin1("v\\d+$")));
- u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("id:%1").tqarg(value));
+ value.remove(TQRegExp(TQString::fromLatin1("^arxiv:"), false));
+ value.remove(TQRegExp(TQString::fromLatin1("v\\d+$")));
+ u.addQueryItem(TQString::fromLatin1("search_query"), TQString::fromLatin1("id:%1").tqarg(value));
}
break;
@@ -286,21 +286,21 @@ KURL ArxivFetcher::searchURL(FetchKey key_, const TQString& value_) const {
}
#ifdef ARXIV_TEST
- u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/arxiv.xml"));
+ u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/arxiv.xml"));
#endif
myDebug() << "ArxivFetcher::search() - url: " << u.url() << endl;
return u;
}
void ArxivFetcher::updateEntry(Data::EntryPtr entry_) {
- TQString id = entry_->field(TQString::tqfromLatin1("arxiv"));
+ TQString id = entry_->field(TQString::fromLatin1("arxiv"));
if(!id.isEmpty()) {
search(Fetch::ArxivID, id);
return;
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- TQString t = entry_->field(TQString::tqfromLatin1("title"));
+ TQString t = entry_->field(TQString::fromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -314,7 +314,7 @@ void ArxivFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
if(!entry) {
return;
}
- TQString arxiv = entry->field(TQString::tqfromLatin1("arxiv"));
+ TQString arxiv = entry->field(TQString::fromLatin1("arxiv"));
if(arxiv.isEmpty()) {
return;
}
@@ -340,8 +340,8 @@ void ArxivFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
myLog() << "ArxivFetcher::updateEntrySynchronous() - found Arxiv result, merging" << endl;
Data::Collection::mergeEntry(entry, coll->entries().front(), false /*overwrite*/);
// the arxiv id might have a version#
- entry->setField(TQString::tqfromLatin1("arxiv"),
- coll->entries().front()->field(TQString::tqfromLatin1("arxiv")));
+ entry->setField(TQString::fromLatin1("arxiv"),
+ coll->entries().front()->field(TQString::fromLatin1("arxiv")));
}
}