summaryrefslogtreecommitdiffstats
path: root/src/fetch/crossreffetcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch/crossreffetcher.cpp')
-rw-r--r--src/fetch/crossreffetcher.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/fetch/crossreffetcher.cpp b/src/fetch/crossreffetcher.cpp
index d888902..2969e60 100644
--- a/src/fetch/crossreffetcher.cpp
+++ b/src/fetch/crossreffetcher.cpp
@@ -31,7 +31,7 @@
#include <tqlabel.h>
#include <tqwhatsthis.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqfile.h>
// #define CROSSREF_TEST
@@ -54,7 +54,7 @@ CrossRefFetcher::~CrossRefFetcher() {
}
TQString CrossRefFetcher::defaultName() {
- return TQString::fromLatin1("CrossRef");
+ return TQString::tqfromLatin1("CrossRef");
}
TQString CrossRefFetcher::source() const {
@@ -82,13 +82,13 @@ void CrossRefFetcher::search(FetchKey key_, const TQString& value_) {
m_started = true;
if(m_user.isEmpty() || m_password.isEmpty()) {
- message(i18n("%1 requires a username and password.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 requires a username and password.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -148,7 +148,7 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from crossreffetcher.cpp" << endl;
- TQFile f(TQString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
TQTextStream t(&f);
t.setEncoding(TQTextStream::UnicodeUTF8);
@@ -182,13 +182,13 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- 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"));
+ 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"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -199,19 +199,19 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
Tellico::Data::EntryPtr CrossRefFetcher::fetchEntry(uint uid_) {
Data::EntryPtr entry = m_entries[uid_];
// if URL but no cover image, fetch it
- if(!entry->field(TQString::fromLatin1("url")).isEmpty()) {
+ if(!entry->field(TQString::tqfromLatin1("url")).isEmpty()) {
Data::CollPtr coll = entry->collection();
- Data::FieldPtr field = coll->fieldByName(TQString::fromLatin1("cover"));
+ Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover"));
if(!field && !coll->imageFields().isEmpty()) {
field = coll->imageFields().front();
} else if(!field) {
- field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
+ field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
coll->addField(field);
}
if(entry->field(field).isEmpty()) {
- TQPixmap pix = NetAccess::filePreview(entry->field(TQString::fromLatin1("url")));
+ TQPixmap pix = NetAccess::filePreview(entry->field(TQString::tqfromLatin1("url")));
if(!pix.isNull()) {
- TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty()) {
entry->setField(field, id);
}
@@ -223,9 +223,9 @@ Tellico::Data::EntryPtr CrossRefFetcher::fetchEntry(uint uid_) {
void CrossRefFetcher::initXSLTHandler() {
#ifdef CROSSREF_USE_UNIXREF
- TQString xsltfile = locate("appdata", TQString::fromLatin1("unixref2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("unixref2tellico.xsl"));
#else
- TQString xsltfile = locate("appdata", TQString::fromLatin1("crossref2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("crossref2tellico.xsl"));
#endif
if(xsltfile.isEmpty()) {
kdWarning() << "CrossRefFetcher::initXSLTHandler() - can not locate xslt file." << endl;
@@ -246,15 +246,15 @@ void CrossRefFetcher::initXSLTHandler() {
}
KURL CrossRefFetcher::searchURL(FetchKey key_, const TQString& value_) const {
- KURL u(TQString::fromLatin1(CROSSREF_BASE_URL));
+ KURL u(TQString::tqfromLatin1(CROSSREF_BASE_URL));
#ifdef CROSSREF_USE_UNIXREF
- u.addQueryItem(TQString::fromLatin1("format"), TQString::fromLatin1("unixref"));
+ u.addQueryItem(TQString::tqfromLatin1("format"), TQString::tqfromLatin1("unixref"));
#endif
- u.addQueryItem(TQString::fromLatin1("req_dat"), TQString::fromLatin1("ourl_%1:%2").arg(m_user, m_password));
+ u.addQueryItem(TQString::tqfromLatin1("req_dat"), TQString::tqfromLatin1("ourl_%1:%2").tqarg(m_user, m_password));
switch(key_) {
case DOI:
- u.addQueryItem(TQString::fromLatin1("rft_id"), TQString::fromLatin1("info:doi/%1").arg(value_));
+ u.addQueryItem(TQString::tqfromLatin1("rft_id"), TQString::tqfromLatin1("info:doi/%1").tqarg(value_));
break;
default:
@@ -263,14 +263,14 @@ KURL CrossRefFetcher::searchURL(FetchKey key_, const TQString& value_) const {
}
#ifdef CROSSREF_TEST
- u = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/crossref.xml"));
+ u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/crossref.xml"));
#endif
myDebug() << "CrossRefFetcher::search() - url: " << u.url() << endl;
return u;
}
void CrossRefFetcher::updateEntry(Data::EntryPtr entry_) {
- TQString doi = entry_->field(TQString::fromLatin1("doi"));
+ TQString doi = entry_->field(TQString::tqfromLatin1("doi"));
if(!doi.isEmpty()) {
search(Fetch::DOI, doi);
return;
@@ -278,7 +278,7 @@ void CrossRefFetcher::updateEntry(Data::EntryPtr entry_) {
#if 0
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- TQString t = entry_->field(TQString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
m_limit = 10; // raise limit so more possibility of match
search(Fetch::Title, t);
@@ -298,7 +298,7 @@ void CrossRefFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
myDebug() << "CrossRefFetcher::updateEntrySynchronous() - username and password is required" << endl;
return;
}
- TQString doi = entry->field(TQString::fromLatin1("doi"));
+ TQString doi = entry->field(TQString::tqfromLatin1("doi"));
if(doi.isEmpty()) {
return;
}
@@ -347,7 +347,7 @@ CrossRefFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const CrossRefFet
++row;
l->addMultiCellWidget(al, row, row, 0, 1);
// richtext gets weird with size
- al->setMinimumWidth(al->sizeHint().width());
+ al->setMinimumWidth(al->tqsizeHint().width());
TQLabel* label = new TQLabel(i18n("&Username: "), optionsWidget());
l->addWidget(label, ++row, 0);