summaryrefslogtreecommitdiffstats
path: root/src/translators/gcfilmsimporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/translators/gcfilmsimporter.cpp')
-rw-r--r--src/translators/gcfilmsimporter.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/translators/gcfilmsimporter.cpp b/src/translators/gcfilmsimporter.cpp
index 6e24f59..027a233 100644
--- a/src/translators/gcfilmsimporter.cpp
+++ b/src/translators/gcfilmsimporter.cpp
@@ -24,7 +24,7 @@
#include <kapplication.h>
#include <kstandarddirs.h>
-#include <textcodec.h>
+#include <tqtextcodec.h>
#define CHECKLIMITS(n) if(values.count() <= n) continue
@@ -55,11 +55,11 @@ Tellico::Data::CollPtr GCfilmsImporter::collection() {
TQString str = text();
TQTextIStream t(&str);
TQString line = t.readLine();
- if(line.startsWith(TQString::fromLatin1("GCfilms"))) {
+ if(line.startsWith(TQString::tqfromLatin1("GCfilms"))) {
readGCfilms(str);
} else {
// need to reparse the string if it's in utf-8
- if(line.lower().find(TQString::fromLatin1("utf-8")) > 0) {
+ if(line.lower().find(TQString::tqfromLatin1("utf-8")) > 0) {
str = TQString::fromUtf8(str.local8Bit());
}
readGCstar(str);
@@ -70,10 +70,10 @@ Tellico::Data::CollPtr GCfilmsImporter::collection() {
void GCfilmsImporter::readGCfilms(const TQString& text_) {
m_coll = new Data::VideoCollection(true);
bool hasURL = false;
- if(m_coll->hasField(TQString::fromLatin1("url"))) {
- hasURL = m_coll->fieldByName(TQString::fromLatin1("url"))->type() == Data::Field::URL;
+ if(m_coll->hasField(TQString::tqfromLatin1("url"))) {
+ hasURL = m_coll->fieldByName(TQString::tqfromLatin1("url"))->type() == Data::Field::URL;
} else {
- Data::FieldPtr field = new Data::Field(TQString::fromLatin1("url"), i18n("URL"), Data::Field::URL);
+ Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("url"), i18n("URL"), Data::Field::URL);
field->setCategory(i18n("General"));
m_coll->addField(field);
hasURL = true;
@@ -81,10 +81,10 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
bool convertUTF8 = false;
TQMap<TQString, Data::BorrowerPtr> borrowers;
- const TQRegExp rx(TQString::fromLatin1("\\s*,\\s*"));
- TQRegExp year(TQString::fromLatin1("\\d{4}"));
- TQRegExp runTimeHr(TQString::fromLatin1("(\\d+)\\s?hr?"));
- TQRegExp runTimeMin(TQString::fromLatin1("(\\d+)\\s?mi?n?"));
+ const TQRegExp rx(TQString::tqfromLatin1("\\s*,\\s*"));
+ TQRegExp year(TQString::tqfromLatin1("\\d{4}"));
+ TQRegExp runTimeHr(TQString::tqfromLatin1("(\\d+)\\s?hr?"));
+ TQRegExp runTimeMin(TQString::tqfromLatin1("(\\d+)\\s?mi?n?"));
bool gotFirstLine = false;
uint total = 0;
@@ -126,9 +126,9 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
Data::EntryPtr entry = new Data::Entry(m_coll);
entry->setId(Tellico::toUInt(values[0], &ok));
- entry->setField(TQString::fromLatin1("title"), values[1]);
+ entry->setField(TQString::tqfromLatin1("title"), values[1]);
if(year.search(values[2]) > -1) {
- entry->setField(TQString::fromLatin1("year"), year.cap());
+ entry->setField(TQString::tqfromLatin1("year"), year.cap());
}
uint time = 0;
@@ -139,35 +139,35 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
time += Tellico::toUInt(runTimeMin.cap(1), &ok);
}
if(time > 0) {
- entry->setField(TQString::fromLatin1("running-time"), TQString::number(time));
+ entry->setField(TQString::tqfromLatin1("running-time"), TQString::number(time));
}
- entry->setField(TQString::fromLatin1("director"), splitJoin(rx, values[4]));
- entry->setField(TQString::fromLatin1("nationality"), splitJoin(rx, values[5]));
- entry->setField(TQString::fromLatin1("genre"), splitJoin(rx, values[6]));
+ entry->setField(TQString::tqfromLatin1("director"), splitJoin(rx, values[4]));
+ entry->setField(TQString::tqfromLatin1("nationality"), splitJoin(rx, values[5]));
+ entry->setField(TQString::tqfromLatin1("genre"), splitJoin(rx, values[6]));
KURL u = KURL::fromPathOrURL(values[7]);
if(!u.isEmpty()) {
TQString id = ImageFactory::addImage(u, true /* quiet */);
if(!id.isEmpty()) {
- entry->setField(TQString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
}
- entry->setField(TQString::fromLatin1("cast"), splitJoin(rx, values[8]));
+ entry->setField(TQString::tqfromLatin1("cast"), splitJoin(rx, values[8]));
// values[9] is the original title
- entry->setField(TQString::fromLatin1("plot"), values[10]);
+ entry->setField(TQString::tqfromLatin1("plot"), values[10]);
if(hasURL) {
- entry->setField(TQString::fromLatin1("url"), values[11]);
+ entry->setField(TQString::tqfromLatin1("url"), values[11]);
}
CHECKLIMITS(12);
// values[12] is whether the film has been viewed or not
- entry->setField(TQString::fromLatin1("medium"), values[13]);
+ entry->setField(TQString::tqfromLatin1("medium"), values[13]);
// values[14] is number of DVDS?
// values[15] is place?
// gcfilms's ratings go 0-10, just divide by two
- entry->setField(TQString::fromLatin1("rating"), TQString::number(int(Tellico::toUInt(values[16], &ok)/2)));
- entry->setField(TQString::fromLatin1("comments"), values[17]);
+ entry->setField(TQString::tqfromLatin1("rating"), TQString::number(int(Tellico::toUInt(values[16], &ok)/2)));
+ entry->setField(TQString::tqfromLatin1("comments"), values[17]);
CHECKLIMITS(18);
@@ -177,10 +177,10 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
langs << (*it).section(';', 0, 0);
tracks << (*it).section(';', 1, 1);
}
- entry->setField(TQString::fromLatin1("language"), langs.join(TQString::fromLatin1("; ")));
- entry->setField(TQString::fromLatin1("audio-track"), tracks.join(TQString::fromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("language"), langs.join(TQString::tqfromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("audio-track"), tracks.join(TQString::tqfromLatin1("; ")));
- entry->setField(TQString::fromLatin1("subtitle"), splitJoin(rx, values[19]));
+ entry->setField(TQString::tqfromLatin1("subtitle"), splitJoin(rx, values[19]));
CHECKLIMITS(20);
@@ -199,7 +199,7 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
int m = Tellico::toUInt(tmp.section('/', 1, 1), &ok);
int y = Tellico::toUInt(tmp.section('/', 2, 2), &ok);
b->addLoan(new Data::Loan(entry, TQDate(y, m, d), TQDate(), TQString()));
- entry->setField(TQString::fromLatin1("loaned"), TQString::fromLatin1("true"));
+ entry->setField(TQString::tqfromLatin1("loaned"), TQString::tqfromLatin1("true"));
}
}
// values[22] is history ?
@@ -209,15 +209,15 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
int age = Tellico::toUInt(values[23], &ok);
if(age < 2) {
- entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("U (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("U (USA)"));
} else if(age < 3) {
- entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("G (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("G (USA)"));
} else if(age < 6) {
- entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("PG (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("PG (USA)"));
} else if(age < 14) {
- entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("PG-13 (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("PG-13 (USA)"));
} else {
- entry->setField(TQString::fromLatin1("certification"), TQString::fromLatin1("R (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("R (USA)"));
}
m_coll->addEntries(entry);
@@ -241,7 +241,7 @@ void GCfilmsImporter::readGCfilms(const TQString& text_) {
}
void GCfilmsImporter::readGCstar(const TQString& text_) {
- TQString xsltFile = locate("appdata", TQString::fromLatin1("gcstar2tellico.xsl"));
+ TQString xsltFile = locate("appdata", TQString::tqfromLatin1("gcstar2tellico.xsl"));
XSLTHandler handler(xsltFile);
if(!handler.isValid()) {
setStatusMessage(i18n("Tellico encountered an error in XSLT processing."));
@@ -262,7 +262,7 @@ void GCfilmsImporter::readGCstar(const TQString& text_) {
inline
TQString GCfilmsImporter::splitJoin(const TQRegExp& rx, const TQString& s) {
- return TQStringList::split(rx, s, false).join(TQString::fromLatin1("; "));
+ return TQStringList::split(rx, s, false).join(TQString::tqfromLatin1("; "));
}
void GCfilmsImporter::slotCancel() {