summaryrefslogtreecommitdiffstats
path: root/src/translators/gcfilmsexporter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/translators/gcfilmsexporter.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/translators/gcfilmsexporter.cpp')
-rw-r--r--src/translators/gcfilmsexporter.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/translators/gcfilmsexporter.cpp b/src/translators/gcfilmsexporter.cpp
index b172996..5bf3285 100644
--- a/src/translators/gcfilmsexporter.cpp
+++ b/src/translators/gcfilmsexporter.cpp
@@ -33,12 +33,12 @@ using Tellico::Export::GCfilmsExporter;
GCfilmsExporter::GCfilmsExporter() : Tellico::Export::Exporter() {
}
-QString GCfilmsExporter::formatString() const {
+TQString GCfilmsExporter::formatString() const {
return i18n("GCfilms");
}
-QString GCfilmsExporter::fileFilter() const {
- return i18n("*.gcf|GCfilms Data Files (*.gcf)") + QChar('\n') + i18n("*|All Files");
+TQString GCfilmsExporter::fileFilter() const {
+ return i18n("*.gcf|GCfilms Data Files (*.gcf)") + TQChar('\n') + i18n("*|All Files");
#if 0
i18n("*.gcs|GCstar Data Files (*.gcs)")
#endif
@@ -50,8 +50,8 @@ bool GCfilmsExporter::exec() {
return false;
}
- QString text;
- QTextOStream ts(&text);
+ TQString text;
+ TQTextOStream ts(&text);
ts << "GCfilms|" << coll->entryCount() << "|";
if(options() & Export::ExportUTF8) {
@@ -61,19 +61,19 @@ bool GCfilmsExporter::exec() {
char d = GCFILMS_DELIMITER;
bool format = options() & Export::ExportFormatted;
// when importing GCfilms, a url field is added
- bool hasURL = coll->hasField(QString::fromLatin1("url"))
- && coll->fieldByName(QString::fromLatin1("url"))->type() == Data::Field::URL;
+ bool hasURL = coll->hasField(TQString::tqfromLatin1("url"))
+ && coll->fieldByName(TQString::tqfromLatin1("url"))->type() == Data::Field::URL;
uint minRating = 1;
uint maxRating = 5;
- Data::FieldPtr f = coll->fieldByName(QString::fromLatin1("rating"));
+ Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("rating"));
if(f) {
bool ok;
- uint n = Tellico::toUInt(f->property(QString::fromLatin1("minimum")), &ok);
+ uint n = Tellico::toUInt(f->property(TQString::tqfromLatin1("minimum")), &ok);
if(ok) {
minRating = n;
}
- n = Tellico::toUInt(f->property(QString::fromLatin1("maximum")), &ok);
+ n = Tellico::toUInt(f->property(TQString::tqfromLatin1("maximum")), &ok);
if(ok) {
maxRating = n;
}
@@ -83,8 +83,8 @@ bool GCfilmsExporter::exec() {
KURL imageDir;
if(url().isLocalFile()) {
imageDir = url();
- imageDir.cd(QString::fromLatin1(".."));
- imageDir.addPath(url().fileName().section('.', 0, 0) + QString::fromLatin1("_images/"));
+ imageDir.cd(TQString::tqfromLatin1(".."));
+ imageDir.addPath(url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_images/"));
if(!KIO::NetAccess::exists(imageDir, false, 0)) {
bool success = KIO::NetAccess::mkdir(imageDir, Kernel::self()->widget());
if(!success) {
@@ -93,7 +93,7 @@ bool GCfilmsExporter::exec() {
}
}
- QStringList images;
+ TQStringList images;
for(Data::EntryVec::ConstIterator entry = entries().begin(); entry != entries().end(); ++entry) {
ts << entry->id() << d;
push(ts, "title", entry, format);
@@ -103,7 +103,7 @@ bool GCfilmsExporter::exec() {
push(ts, "nationality", entry, format);
push(ts, "genre", entry, format);
// do image
- QString tmp = entry->field(QString::fromLatin1("cover"));
+ TQString tmp = entry->field(TQString::tqfromLatin1("cover"));
if(!tmp.isEmpty() && !imageDir.isEmpty()) {
images << tmp;
ts << imageDir.path() << tmp;
@@ -111,9 +111,9 @@ bool GCfilmsExporter::exec() {
ts << d;
// do not format cast since the commas could get mixed up
- const QStringList cast = entry->fields(QString::fromLatin1("cast"), false);
- for(QStringList::ConstIterator it = cast.begin(); it != cast.end(); ++it) {
- ts << (*it).section(QString::fromLatin1("::"), 0, 0);
+ const TQStringList cast = entry->fields(TQString::tqfromLatin1("cast"), false);
+ for(TQStringList::ConstIterator it = cast.begin(); it != cast.end(); ++it) {
+ ts << (*it).section(TQString::tqfromLatin1("::"), 0, 0);
if(it != cast.fromLast()) {
ts << ", ";
}
@@ -142,7 +142,7 @@ bool GCfilmsExporter::exec() {
// gcfilms's ratings go 0-10, just multiply by two
bool ok;
- int rat = Tellico::toUInt(entry->field(QString::fromLatin1("rating"), format), &ok);
+ int rat = Tellico::toUInt(entry->field(TQString::tqfromLatin1("rating"), format), &ok);
if(ok) {
ts << rat * 10/(maxRating-minRating);
}
@@ -154,7 +154,7 @@ bool GCfilmsExporter::exec() {
push(ts, "subtitle", entry, format);
// values[20] is borrower name, values[21] is loan date
- if(entry->field(QString::fromLatin1("loaned")).isEmpty()) {
+ if(entry->field(TQString::tqfromLatin1("loaned")).isEmpty()) {
ts << d << d;
} else {
// find loan
@@ -179,7 +179,7 @@ bool GCfilmsExporter::exec() {
ts << d;
// for certification, only thing we can do is assume default american ratings
- tmp = entry->field(QString::fromLatin1("certification"), format);
+ tmp = entry->field(TQString::tqfromLatin1("certification"), format);
int age = 0;
if(tmp == Latin1Literal("U (USA)")) {
age = 1;
@@ -202,7 +202,7 @@ bool GCfilmsExporter::exec() {
}
StringSet imageSet;
- for(QStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
+ for(TQStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
if(imageSet.has(*it)) {
continue;
}
@@ -217,15 +217,15 @@ bool GCfilmsExporter::exec() {
return FileHandler::writeTextURL(url(), text, options() & Export::ExportUTF8, options() & Export::ExportForce);
}
-void GCfilmsExporter::push(QTextOStream& ts_, QCString fieldName_, Data::EntryVec::ConstIterator entry_, bool format_) {
- Data::FieldPtr f = collection()->fieldByName(QString::fromLatin1(fieldName_));
+void GCfilmsExporter::push(TQTextOStream& ts_, TQCString fieldName_, Data::EntryVec::ConstIterator entry_, bool format_) {
+ Data::FieldPtr f = collection()->fieldByName(TQString::tqfromLatin1(fieldName_));
// don't format multiple names cause commas will cause problems
if(f->formatFlag() == Data::Field::FormatName && (f->flags() & Data::Field::AllowMultiple)) {
format_ = false;
}
- QString s = entry_->field(QString::fromLatin1(fieldName_), format_);
+ TQString s = entry_->field(TQString::tqfromLatin1(fieldName_), format_);
if(f->flags() & Data::Field::AllowMultiple) {
- ts_ << s.replace(QString::fromLatin1("; "), QChar(','));
+ ts_ << s.tqreplace(TQString::tqfromLatin1("; "), TQChar(','));
} else {
ts_ << s;
}