diff options
Diffstat (limited to 'src/translators/bibtexmlexporter.cpp')
-rw-r--r-- | src/translators/bibtexmlexporter.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/translators/bibtexmlexporter.cpp b/src/translators/bibtexmlexporter.cpp index 4a0a4d3..153fd3f 100644 --- a/src/translators/bibtexmlexporter.cpp +++ b/src/translators/bibtexmlexporter.cpp @@ -25,19 +25,19 @@ #include <klocale.h> #include <kdebug.h> -#include <qvbox.h> -#include <qdom.h> -#include <qregexp.h> -#include <qtextcodec.h> +#include <tqvbox.h> +#include <tqdom.h> +#include <tqregexp.h> +#include <tqtextcodec.h> using Tellico::Export::BibtexmlExporter; -QString BibtexmlExporter::formatString() const { +TQString BibtexmlExporter::formatString() const { return i18n("Bibtexml"); } -QString BibtexmlExporter::fileFilter() const { - return i18n("*.xml|Bibtexml Files (*.xml)") + QChar('\n') + i18n("*|All Files"); +TQString BibtexmlExporter::fileFilter() const { + return i18n("*.xml|Bibtexml Files (*.xml)") + TQChar('\n') + i18n("*|All Files"); } bool BibtexmlExporter::exec() { @@ -49,16 +49,16 @@ bool BibtexmlExporter::exec() { // there are some special fields // the entry-type specifies the entry type - book, inproceedings, whatever - QString typeField; + TQString typeField; // the key specifies the cite-key - QString keyField; + TQString keyField; - const QString bibtex = QString::fromLatin1("bibtex"); + const TQString bibtex = TQString::tqfromLatin1("bibtex"); // keep a list of all the 'ordinary' fields to iterate through later Data::FieldVec fields; Data::FieldVec vec = coll->fields(); for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) { - QString bibtexField = it->property(bibtex); + TQString bibtexField = it->property(bibtex); if(bibtexField == Latin1Literal("entry-type")) { typeField = it->name(); } else if(bibtexField == Latin1Literal("key")) { @@ -68,29 +68,29 @@ bool BibtexmlExporter::exec() { } } - QDomImplementation impl; - QDomDocumentType doctype = impl.createDocumentType(QString::fromLatin1("file"), - QString::null, + TQDomImplementation impl; + TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("file"), + TQString(), XML::dtdBibtexml); //default namespace - const QString& ns = XML::nsBibtexml; + const TQString& ns = XML::nsBibtexml; - QDomDocument dom = impl.createDocument(ns, QString::fromLatin1("file"), doctype); + TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("file"), doctype); // root element - QDomElement root = dom.documentElement(); + TQDomElement root = dom.documentElement(); - QString encodeStr = QString::fromLatin1("version=\"1.0\" encoding=\""); + TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\""); if(options() & Export::ExportUTF8) { - encodeStr += QString::fromLatin1("UTF-8"); + encodeStr += TQString::tqfromLatin1("UTF-8"); } else { - encodeStr += QString::fromLatin1(QTextCodec::codecForLocale()->mimeName()); + encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName()); } encodeStr += '"'; // createDocument creates a root node, insert the processing instruction before it - dom.insertBefore(dom.createProcessingInstruction(QString::fromLatin1("xml"), encodeStr), root); - QString comment = QString::fromLatin1("Generated by Tellico ") + QString::fromLatin1(VERSION); + dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root); + TQString comment = TQString::tqfromLatin1("Generated by Tellico ") + TQString::tqfromLatin1(VERSION); dom.insertBefore(dom.createComment(comment), root); Data::ConstFieldPtr field; @@ -98,14 +98,14 @@ bool BibtexmlExporter::exec() { bool format = options() & Export::ExportFormatted; StringSet usedKeys; - QString type, key, newKey, value, elemName, parElemName; - QDomElement btElem, entryElem, parentElem, fieldElem; + TQString type, key, newKey, value, elemName, parElemName; + TQDomElement btElem, entryElem, tqparentElem, fieldElem; for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) { key = entryIt->field(keyField); if(key.isEmpty()) { key = BibtexHandler::bibtexKey(entryIt.data()); } - QString newKey = key; + TQString newKey = key; char c = 'a'; while(usedKeys.has(newKey)) { // duplicate found! @@ -115,8 +115,8 @@ bool BibtexmlExporter::exec() { key = newKey; usedKeys.add(key); - btElem = dom.createElement(QString::fromLatin1("entry")); - btElem.setAttribute(QString::fromLatin1("id"), key); + btElem = dom.createElement(TQString::tqfromLatin1("entry")); + btElem.setAttribute(TQString::tqfromLatin1("id"), key); root.appendChild(btElem); type = entryIt->field(typeField); @@ -149,23 +149,23 @@ bool BibtexmlExporter::exec() { elemName == Latin1Literal("editor") || elemName == Latin1Literal("keywords")) { if(elemName == Latin1Literal("author")) { - parElemName = QString::fromLatin1("authorlist"); + parElemName = TQString::tqfromLatin1("authorlist"); } else if(elemName == Latin1Literal("editor")) { - parElemName = QString::fromLatin1("editorlist"); + parElemName = TQString::tqfromLatin1("editorlist"); } else { // keywords - parElemName = QString::fromLatin1("keywords"); - elemName = QString::fromLatin1("keyword"); + parElemName = TQString::tqfromLatin1("keywords"); + elemName = TQString::tqfromLatin1("keyword"); } - parentElem = dom.createElement(parElemName); - const QStringList values = entryIt->fields(field->name(), false); - for(QStringList::ConstIterator it = values.begin(); it != values.end(); ++it) { + tqparentElem = dom.createElement(parElemName); + const TQStringList values = entryIt->fields(field->name(), false); + for(TQStringList::ConstIterator it = values.begin(); it != values.end(); ++it) { fieldElem = dom.createElement(elemName); fieldElem.appendChild(dom.createTextNode(*it)); - parentElem.appendChild(fieldElem); + tqparentElem.appendChild(fieldElem); } - if(parentElem.hasChildNodes()) { - entryElem.appendChild(parentElem); + if(tqparentElem.hasChildNodes()) { + entryElem.appendChild(tqparentElem); } } else { fieldElem = dom.createElement(elemName); |