diff options
Diffstat (limited to 'src/translators/dcimporter.cpp')
-rw-r--r-- | src/translators/dcimporter.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/translators/dcimporter.cpp b/src/translators/dcimporter.cpp index c8bb59f..55d9716 100644 --- a/src/translators/dcimporter.cpp +++ b/src/translators/dcimporter.cpp @@ -21,41 +21,41 @@ using Tellico::Import::DCImporter; DCImporter::DCImporter(const KURL& url_) : XMLImporter(url_) { } -DCImporter::DCImporter(const QString& text_) : XMLImporter(text_) { +DCImporter::DCImporter(const TQString& text_) : XMLImporter(text_) { } -DCImporter::DCImporter(const QDomDocument& dom_) : XMLImporter(dom_) { +DCImporter::DCImporter(const TQDomDocument& dom_) : XMLImporter(dom_) { } Tellico::Data::CollPtr DCImporter::collection() { - const QString& dc = XML::nsDublinCore; - const QString& zing = XML::nsZing; + const TQString& dc = XML::nsDublinCore; + const TQString& zing = XML::nsZing; Data::CollPtr c = new Data::BookCollection(true); - QDomDocument doc = domDocument(); + TQDomDocument doc = domDocument(); - QRegExp authorDateRX(QString::fromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$")); - QRegExp dateRX(QString::fromLatin1("\\d{4}")); + TQRegExp authorDateRX(TQString::tqfromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$")); + TQRegExp dateRX(TQString::tqfromLatin1("\\d{4}")); - QDomNodeList recordList = doc.elementsByTagNameNS(zing, QString::fromLatin1("recordData")); + TQDomNodeList recordList = doc.elementsByTagNameNS(zing, TQString::tqfromLatin1("recordData")); myDebug() << "DCImporter::collection() - number of records: " << recordList.count() << endl; enum { UnknownNS, UseNS, NoNS } useNS = UnknownNS; #define GETELEMENTS(s) (useNS == NoNS) \ - ? elem.elementsByTagName(QString::fromLatin1(s)) \ - : elem.elementsByTagNameNS(dc, QString::fromLatin1(s)) + ? elem.elementsByTagName(TQString::tqfromLatin1(s)) \ + : elem.elementsByTagNameNS(dc, TQString::tqfromLatin1(s)) for(uint i = 0; i < recordList.count(); ++i) { Data::EntryPtr e = new Data::Entry(c); - QDomElement elem = recordList.item(i).toElement(); + TQDomElement elem = recordList.item(i).toElement(); - QDomNodeList nodeList = GETELEMENTS("title"); + TQDomNodeList nodeList = GETELEMENTS("title"); if(nodeList.count() == 0) { // no title, skip if(useNS == UnknownNS) { - nodeList = elem.elementsByTagName(QString::fromLatin1("title")); + nodeList = elem.elementsByTagName(TQString::tqfromLatin1("title")); if(nodeList.count() > 0) { useNS = NoNS; } else { @@ -69,15 +69,15 @@ Tellico::Data::CollPtr DCImporter::collection() { } else if(useNS == UnknownNS) { useNS = UseNS; } - QString s = nodeList.item(0).toElement().text(); - s.replace('\n', ' '); + TQString s = nodeList.item(0).toElement().text(); + s.tqreplace('\n', ' '); s = s.simplifyWhiteSpace(); - e->setField(QString::fromLatin1("title"), s); + e->setField(TQString::tqfromLatin1("title"), s); nodeList = GETELEMENTS("creator"); - QStringList creators; + TQStringList creators; for(uint j = 0; j < nodeList.count(); ++j) { - QString s = nodeList.item(j).toElement().text(); + TQString s = nodeList.item(j).toElement().text(); if(authorDateRX.search(s) > -1) { // check if anything after date like [publisher] if(authorDateRX.cap(2).stripWhiteSpace().isEmpty()) { @@ -91,33 +91,33 @@ Tellico::Data::CollPtr DCImporter::collection() { creators << s; } } - e->setField(QString::fromLatin1("author"), creators.join(QString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("author"), creators.join(TQString::tqfromLatin1("; "))); nodeList = GETELEMENTS("publisher"); - QStringList publishers; + TQStringList publishers; for(uint j = 0; j < nodeList.count(); ++j) { publishers << nodeList.item(j).toElement().text(); } - e->setField(QString::fromLatin1("publisher"), publishers.join(QString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("publisher"), publishers.join(TQString::tqfromLatin1("; "))); nodeList = GETELEMENTS("subject"); - QStringList keywords; + TQStringList keywords; for(uint j = 0; j < nodeList.count(); ++j) { keywords << nodeList.item(j).toElement().text(); } - e->setField(QString::fromLatin1("keyword"), keywords.join(QString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("keyword"), keywords.join(TQString::tqfromLatin1("; "))); nodeList = GETELEMENTS("date"); if(nodeList.count() > 0) { - QString s = nodeList.item(0).toElement().text(); + TQString s = nodeList.item(0).toElement().text(); if(dateRX.search(s) > -1) { - e->setField(QString::fromLatin1("pub_year"), dateRX.cap()); + e->setField(TQString::tqfromLatin1("pub_year"), dateRX.cap()); } } nodeList = GETELEMENTS("description"); if(nodeList.count() > 0) { // no title, skip - e->setField(QString::fromLatin1("comments"), nodeList.item(0).toElement().text()); + e->setField(TQString::tqfromLatin1("comments"), nodeList.item(0).toElement().text()); } c->addEntries(e); |