summaryrefslogtreecommitdiffstats
path: root/src/translators/bibtexmlimporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/translators/bibtexmlimporter.cpp')
-rw-r--r--src/translators/bibtexmlimporter.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/translators/bibtexmlimporter.cpp b/src/translators/bibtexmlimporter.cpp
index 2feb2f2..9131320 100644
--- a/src/translators/bibtexmlimporter.cpp
+++ b/src/translators/bibtexmlimporter.cpp
@@ -38,25 +38,25 @@ Tellico::Data::CollPtr BibtexmlImporter::collection() {
}
void BibtexmlImporter::loadDomDocument() {
- QDomElement root = domDocument().documentElement();
+ TQDomElement root = domDocument().documentElement();
if(root.isNull() || root.localName() != Latin1Literal("file")) {
- setStatusMessage(i18n(errorLoad).arg(url().fileName()));
+ setStatusMessage(i18n(errorLoad).tqarg(url().fileName()));
return;
}
- const QString& ns = XML::nsBibtexml;
+ const TQString& ns = XML::nsBibtexml;
m_coll = new Data::BibtexCollection(true);
- QDomNodeList entryelems = root.elementsByTagNameNS(ns, QString::fromLatin1("entry"));
+ TQDomNodeList entryelems = root.elementsByTagNameNS(ns, TQString::tqfromLatin1("entry"));
// kdDebug() << "BibtexmlImporter::loadDomDocument - found " << entryelems.count() << " entries" << endl;
const uint count = entryelems.count();
- const uint stepSize = QMAX(s_stepSize, count/100);
+ const uint stepSize = TQMAX(s_stepSize, count/100);
const bool showProgress = options() & ImportProgress;
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(count);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
for(uint j = 0; !m_cancelled && j < entryelems.count(); ++j) {
@@ -69,8 +69,8 @@ void BibtexmlImporter::loadDomDocument() {
} // end entry loop
}
-void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
- QDomNode node = const_cast<QDomNode&>(entryNode_);
+void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) {
+ TQDomNode node = const_cast<TQDomNode&>(entryNode_);
Data::EntryPtr entry = new Data::Entry(m_coll);
@@ -82,14 +82,14 @@ void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
</authorlist>
<publisher>...</publisher> */
- QString type = node.firstChild().toElement().tagName();
- entry->setField(QString::fromLatin1("entry-type"), type);
- QString id = node.toElement().attribute(QString::fromLatin1("id"));
- entry->setField(QString::fromLatin1("bibtex-key"), id);
+ TQString type = node.firstChild().toElement().tagName();
+ entry->setField(TQString::tqfromLatin1("entry-type"), type);
+ TQString id = node.toElement().attribute(TQString::tqfromLatin1("id"));
+ entry->setField(TQString::tqfromLatin1("bibtex-key"), id);
- QString name, value;
+ TQString name, value;
// field values are first child of first child of entry node
- for(QDomNode n = node.firstChild().firstChild(); !n.isNull(); n = n.nextSibling()) {
+ for(TQDomNode n = node.firstChild().firstChild(); !n.isNull(); n = n.nextSibling()) {
// n could be something like authorlist, with multiple authors, or just
// a plain element with a single text child...
// second case first
@@ -98,9 +98,9 @@ void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
value = n.toElement().text();
} else {
// is either titlelist, authorlist, editorlist, or keywords
- QString parName = n.toElement().tagName();
+ TQString parName = n.toElement().tagName();
if(parName == Latin1Literal("titlelist")) {
- for(QDomNode n2 = node.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
+ for(TQDomNode n2 = node.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
name = n2.toElement().tagName();
value = n2.toElement().text();
if(!name.isEmpty() && !value.isEmpty()) {
@@ -112,38 +112,38 @@ void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
} else {
name = n.firstChild().toElement().tagName();
if(name == Latin1Literal("keyword")) {
- name = QString::fromLatin1("keywords");
+ name = TQString::tqfromLatin1("keywords");
}
value.truncate(0);
- for(QDomNode n2 = n.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
+ for(TQDomNode n2 = n.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
// n2 could have first, middle, lastname elements...
if(name == Latin1Literal("person")) {
- QStringList names;
- names << QString::fromLatin1("initials") << QString::fromLatin1("first")
- << QString::fromLatin1("middle") << QString::fromLatin1("prelast")
- << QString::fromLatin1("last") << QString::fromLatin1("lineage");
- for(QStringList::ConstIterator it = names.begin(); it != names.end(); ++it) {
- QDomNodeList list = n2.toElement().elementsByTagName(*it);
+ TQStringList names;
+ names << TQString::tqfromLatin1("initials") << TQString::tqfromLatin1("first")
+ << TQString::tqfromLatin1("middle") << TQString::tqfromLatin1("prelast")
+ << TQString::tqfromLatin1("last") << TQString::tqfromLatin1("lineage");
+ for(TQStringList::ConstIterator it = names.begin(); it != names.end(); ++it) {
+ TQDomNodeList list = n2.toElement().elementsByTagName(*it);
if(list.count() > 1) {
value += list.item(0).toElement().text();
}
if(*it != names.last()) {
- value += QString::fromLatin1(" ");
+ value += TQString::tqfromLatin1(" ");
}
}
}
- for(QDomNode n3 = n2.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
+ for(TQDomNode n3 = n2.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
if(n3.isElement()) {
value += n3.toElement().text();
} else if(n3.isText()) {
value += n3.toText().data();
}
if(n3 != n2.lastChild()) {
- value += QString::fromLatin1(" ");
+ value += TQString::tqfromLatin1(" ");
}
}
if(n2 != n.lastChild()) {
- value += QString::fromLatin1("; ");
+ value += TQString::tqfromLatin1("; ");
}
}
}