summaryrefslogtreecommitdiffstats
path: root/src/translators/grs1importer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/translators/grs1importer.cpp')
-rw-r--r--src/translators/grs1importer.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/translators/grs1importer.cpp b/src/translators/grs1importer.cpp
index 7eca9e3..6b6c8d2 100644
--- a/src/translators/grs1importer.cpp
+++ b/src/translators/grs1importer.cpp
@@ -26,24 +26,24 @@ void GRS1Importer::initTagMap() {
if(!s_tagMap) {
s_tagMap = new TagMap();
// BT is special and is handled separately
- s_tagMap->insert(TagPair(2, 1), QString::fromLatin1("title"));
- s_tagMap->insert(TagPair(2, 2), QString::fromLatin1("author"));
- s_tagMap->insert(TagPair(2, 4), QString::fromLatin1("year"));
- s_tagMap->insert(TagPair(2, 7), QString::fromLatin1("publisher"));
- s_tagMap->insert(TagPair(2, 31), QString::fromLatin1("publisher"));
- s_tagMap->insert(TagPair(2, 20), QString::fromLatin1("language"));
- s_tagMap->insert(TagPair(2, 21), QString::fromLatin1("keyword"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("isbn/issn")), QString::fromLatin1("isbn"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("isbn")), QString::fromLatin1("isbn"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("notes")), QString::fromLatin1("note"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("note")), QString::fromLatin1("note"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("series")), QString::fromLatin1("series"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("physical description")), QString::fromLatin1("note"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("subtitle")), QString::fromLatin1("subtitle"));
+ s_tagMap->insert(TagPair(2, 1), TQString::tqfromLatin1("title"));
+ s_tagMap->insert(TagPair(2, 2), TQString::tqfromLatin1("author"));
+ s_tagMap->insert(TagPair(2, 4), TQString::tqfromLatin1("year"));
+ s_tagMap->insert(TagPair(2, 7), TQString::tqfromLatin1("publisher"));
+ s_tagMap->insert(TagPair(2, 31), TQString::tqfromLatin1("publisher"));
+ s_tagMap->insert(TagPair(2, 20), TQString::tqfromLatin1("language"));
+ s_tagMap->insert(TagPair(2, 21), TQString::tqfromLatin1("keyword"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("isbn/issn")), TQString::tqfromLatin1("isbn"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("isbn")), TQString::tqfromLatin1("isbn"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("notes")), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("note")), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("series")), TQString::tqfromLatin1("series"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("physical description")), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("subtitle")), TQString::tqfromLatin1("subtitle"));
}
}
-GRS1Importer::GRS1Importer(const QString& text_) : TextImporter(text_) {
+GRS1Importer::GRS1Importer(const TQString& text_) : TextImporter(text_) {
initTagMap();
}
@@ -54,12 +54,12 @@ bool GRS1Importer::canImport(int type) const {
Tellico::Data::CollPtr GRS1Importer::collection() {
Data::CollPtr coll = new Data::BibtexCollection(true);
- Data::FieldPtr f = new Data::Field(QString::fromLatin1("isbn"), i18n("ISBN#"));
+ Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#"));
f->setCategory(i18n("Publishing"));
f->setDescription(i18n("International Standard Book Number"));
coll->addField(f);
- f = new Data::Field(QString::fromLatin1("language"), i18n("Language"));
+ f = new Data::Field(TQString::tqfromLatin1("language"), i18n("Language"));
f->setCategory(i18n("Publishing"));
f->setFlags(Data::Field::AllowCompletion | Data::Field::AllowGrouped | Data::Field::AllowMultiple);
coll->addField(f);
@@ -68,20 +68,20 @@ Tellico::Data::CollPtr GRS1Importer::collection() {
bool empty = true;
// in format "(tag, tag) value"
- QRegExp rx(QString::fromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*"));
+ TQRegExp rx(TQString::tqfromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*"));
// rx.setMinimal(true);
- QRegExp dateRx(QString::fromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors
- QRegExp pubRx(QString::fromLatin1("([^:]+):([^,]+),?")); // split location and publisher
+ TQRegExp dateRx(TQString::tqfromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors
+ TQRegExp pubRx(TQString::tqfromLatin1("([^:]+):([^,]+),?")); // split location and publisher
bool ok;
int n;
- QVariant v;
- QString tmp, field, val, str = text();
+ TQVariant v;
+ TQString tmp, field, val, str = text();
if(str.isEmpty()) {
return 0;
}
- QTextStream t(&str, IO_ReadOnly);
- for(QString line = t.readLine(); !line.isNull(); line = t.readLine()) {
+ TQTextStream t(&str, IO_ReadOnly);
+ for(TQString line = t.readLine(); !line.isNull(); line = t.readLine()) {
// myDebug() << line << endl;
if(!rx.exactMatch(line)) {
continue;
@@ -105,18 +105,18 @@ Tellico::Data::CollPtr GRS1Importer::collection() {
if(field == Latin1Literal("title")) {
val = val.section('/', 0, 0).stripWhiteSpace(); // only take portion of title before slash
} else if(field == Latin1Literal("author")) {
- val.replace(dateRx, QString::null);
+ val.tqreplace(dateRx, TQString());
} else if(field == Latin1Literal("publisher")) {
- int pos = val.find(pubRx);
+ int pos = val.tqfind(pubRx);
if(pos > -1) {
- e->setField(QString::fromLatin1("address"), pubRx.cap(1));
+ e->setField(TQString::tqfromLatin1("address"), pubRx.cap(1));
val = pubRx.cap(2);
}
}
tmp = e->field(field);
if(!tmp.isEmpty()) {
- tmp += QString::fromLatin1("; ");
+ tmp += TQString::tqfromLatin1("; ");
}
e->setField(field, tmp + val);
}