summaryrefslogtreecommitdiffstats
path: root/src/fetch/bibsonomyfetcher.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/fetch/bibsonomyfetcher.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/fetch/bibsonomyfetcher.cpp')
-rw-r--r--src/fetch/bibsonomyfetcher.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/fetch/bibsonomyfetcher.cpp b/src/fetch/bibsonomyfetcher.cpp
index faa48a4..b2e7d2e 100644
--- a/src/fetch/bibsonomyfetcher.cpp
+++ b/src/fetch/bibsonomyfetcher.cpp
@@ -24,8 +24,8 @@
#include <klocale.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
namespace {
// always bibtex
@@ -35,18 +35,18 @@ namespace {
using Tellico::Fetch::BibsonomyFetcher;
-BibsonomyFetcher::BibsonomyFetcher(QObject* parent_)
- : Fetcher(parent_), m_job(0), m_started(false) {
+BibsonomyFetcher::BibsonomyFetcher(TQObject* tqparent_)
+ : Fetcher(tqparent_), m_job(0), m_started(false) {
}
BibsonomyFetcher::~BibsonomyFetcher() {
}
-QString BibsonomyFetcher::defaultName() {
- return QString::fromLatin1("Bibsonomy");
+TQString BibsonomyFetcher::defaultName() {
+ return TQString::tqfromLatin1("Bibsonomy");
}
-QString BibsonomyFetcher::source() const {
+TQString BibsonomyFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -57,13 +57,13 @@ bool BibsonomyFetcher::canFetch(int type) const {
void BibsonomyFetcher::readConfigHook(const KConfigGroup&) {
}
-void BibsonomyFetcher::search(FetchKey key_, const QString& value_) {
+void BibsonomyFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
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;
}
@@ -79,10 +79,10 @@ void BibsonomyFetcher::search(FetchKey key_, const QString& value_) {
}
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void BibsonomyFetcher::stop() {
@@ -99,8 +99,8 @@ void BibsonomyFetcher::stop() {
emit signalDone(this);
}
-void BibsonomyFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void BibsonomyFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -121,7 +121,7 @@ void BibsonomyFetcher::slotComplete(KIO::Job* job_) {
return;
}
- Import::BibtexImporter imp(QString::fromUtf8(m_data, m_data.size()));
+ Import::BibtexImporter imp(TQString::fromUtf8(m_data, m_data.size()));
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -136,13 +136,13 @@ void BibsonomyFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::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(QString::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);
}
@@ -154,17 +154,17 @@ Tellico::Data::EntryPtr BibsonomyFetcher::fetchEntry(uint uid_) {
return m_entries[uid_];
}
-KURL BibsonomyFetcher::searchURL(FetchKey key_, const QString& value_) const {
- KURL u(QString::fromLatin1(BIBSONOMY_BASE_URL));
- u.setPath(QString::fromLatin1("/bib/"));
+KURL BibsonomyFetcher::searchURL(FetchKey key_, const TQString& value_) const {
+ KURL u(TQString::tqfromLatin1(BIBSONOMY_BASE_URL));
+ u.setPath(TQString::tqfromLatin1("/bib/"));
switch(key_) {
case Person:
- u.addPath(QString::fromLatin1("author/%1").arg(value_));
+ u.addPath(TQString::tqfromLatin1("author/%1").tqarg(value_));
break;
case Keyword:
- u.addPath(QString::fromLatin1("search/%1").arg(value_));
+ u.addPath(TQString::tqfromLatin1("search/%1").tqarg(value_));
break;
default:
@@ -172,13 +172,13 @@ KURL BibsonomyFetcher::searchURL(FetchKey key_, const QString& value_) const {
return KURL();
}
- u.addQueryItem(QString::fromLatin1("items"), QString::number(BIBSONOMY_MAX_RESULTS));
+ u.addQueryItem(TQString::tqfromLatin1("items"), TQString::number(BIBSONOMY_MAX_RESULTS));
myDebug() << "BibsonomyFetcher::search() - url: " << u.url() << endl;
return u;
}
void BibsonomyFetcher::updateEntry(Data::EntryPtr entry_) {
- QString title = entry_->field(QString::fromLatin1("title"));
+ TQString title = entry_->field(TQString::tqfromLatin1("title"));
if(!title.isEmpty()) {
search(Fetch::Keyword, title);
return;
@@ -188,21 +188,21 @@ void BibsonomyFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* BibsonomyFetcher::configWidget(QWidget* parent_) const {
- return new BibsonomyFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* BibsonomyFetcher::configWidget(TQWidget* tqparent_) const {
+ return new BibsonomyFetcher::ConfigWidget(tqparent_, this);
}
-BibsonomyFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const BibsonomyFetcher*)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+BibsonomyFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const BibsonomyFetcher*)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
void BibsonomyFetcher::ConfigWidget::saveConfig(KConfigGroup&) {
}
-QString BibsonomyFetcher::ConfigWidget::preferredName() const {
+TQString BibsonomyFetcher::ConfigWidget::preferredName() const {
return BibsonomyFetcher::defaultName();
}