summaryrefslogtreecommitdiffstats
path: root/src/translators/alexandriaexporter.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-12-18 18:15:24 -0600
committerTimothy Pearson <[email protected]>2011-12-18 18:15:24 -0600
commit8d9b90ca794ffabf151719c2edebe9278a2d3f36 (patch)
tree55f446de8694c45be6bf0f1178920c2b92b0c9f5 /src/translators/alexandriaexporter.cpp
parent2781e27b871150395a5a82e221684108641002b2 (diff)
downloadtellico-8d9b90ca794ffabf151719c2edebe9278a2d3f36.tar.gz
tellico-8d9b90ca794ffabf151719c2edebe9278a2d3f36.zip
Rename old tq methods that no longer need a unique name
Diffstat (limited to 'src/translators/alexandriaexporter.cpp')
-rw-r--r--src/translators/alexandriaexporter.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/translators/alexandriaexporter.cpp b/src/translators/alexandriaexporter.cpp
index f59cefe..9a46268 100644
--- a/src/translators/alexandriaexporter.cpp
+++ b/src/translators/alexandriaexporter.cpp
@@ -35,7 +35,7 @@ namespace {
using Tellico::Export::AlexandriaExporter;
TQString& AlexandriaExporter::escapeText(TQString& str_) {
- str_.replace('"', TQString::tqfromLatin1("\\\""));
+ str_.replace('"', TQString::fromLatin1("\\\""));
return str_;
}
@@ -50,7 +50,7 @@ bool AlexandriaExporter::exec() {
return false;
}
- const TQString alexDirName = TQString::tqfromLatin1(".alexandria");
+ const TQString alexDirName = TQString::fromLatin1(".alexandria");
// create if necessary
TQDir libraryDir = TQDir::home();
@@ -97,13 +97,13 @@ bool AlexandriaExporter::exec() {
// everything is put between quotes except for the rating, just to be sure it's interpreted as a string
bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_) {
// the filename is the isbn without dashes, followed by .yaml
- TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::fromLatin1("isbn"));
if(isbn.isEmpty()) {
return false; // can't write it since Alexandria uses isbn as name of file
}
isbn.remove('-'); // remove dashes
- TQFile file(dir_.absPath() + TQDir::separator() + isbn + TQString::tqfromLatin1(".yaml"));
+ TQFile file(dir_.absPath() + TQDir::separator() + isbn + TQString::fromLatin1(".yaml"));
if(!file.open(IO_WriteOnly)) {
return false;
}
@@ -116,7 +116,7 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_
ts.setEncoding(TQTextStream::UnicodeUTF8);
ts << "--- !ruby/object:Alexandria::Book\n";
ts << "authors:\n";
- TQStringList authors = entry_->fields(TQString::tqfromLatin1("author"), format);
+ TQStringList authors = entry_->fields(TQString::fromLatin1("author"), format);
for(TQStringList::Iterator it = authors.begin(); it != authors.end(); ++it) {
ts << " - " << escapeText(*it) << "\n";
}
@@ -125,30 +125,30 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_
ts << " - n/a\n";
}
- TQString tmp = entry_->field(TQString::tqfromLatin1("title"), format);
+ TQString tmp = entry_->field(TQString::fromLatin1("title"), format);
ts << "title: \"" << escapeText(tmp) << "\"\n";
// Alexandria refers to the binding as the edition
- tmp = entry_->field(TQString::tqfromLatin1("binding"), format);
+ tmp = entry_->field(TQString::fromLatin1("binding"), format);
ts << "edition: \"" << escapeText(tmp) << "\"\n";
// sometimes Alexandria interprets the isbn as a number instead of a string
// I have no idea how to debug ruby, so err on safe side and add quotes
ts << "isbn: \"" << isbn << "\"\n";
- tmp = entry_->field(TQString::tqfromLatin1("comments"), format);
+ tmp = entry_->field(TQString::fromLatin1("comments"), format);
ts << "notes: \"" << escapeText(tmp) << "\"\n";
- tmp = entry_->field(TQString::tqfromLatin1("publisher"), format);
+ tmp = entry_->field(TQString::fromLatin1("publisher"), format);
// publisher uses n/a when empty
- ts << "publisher: \"" << (tmp.isEmpty() ? TQString::tqfromLatin1("n/a") : escapeText(tmp)) << "\"\n";
+ ts << "publisher: \"" << (tmp.isEmpty() ? TQString::fromLatin1("n/a") : escapeText(tmp)) << "\"\n";
- tmp = entry_->field(TQString::tqfromLatin1("pub_year"), format);
+ tmp = entry_->field(TQString::fromLatin1("pub_year"), format);
if(!tmp.isEmpty()) {
ts << "publishing_year: \"" << escapeText(tmp) << "\"\n";
}
- tmp = entry_->field(TQString::tqfromLatin1("rating"));
+ tmp = entry_->field(TQString::fromLatin1("rating"));
bool ok;
int rating = Tellico::toUInt(tmp, &ok);
if(ok) {
@@ -157,7 +157,7 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_
file.close();
- TQString cover = entry_->field(TQString::tqfromLatin1("cover"));
+ TQString cover = entry_->field(TQString::fromLatin1("cover"));
if(cover.isEmpty() || !(options() & Export::ExportImages)) {
return true; // all done
}
@@ -173,8 +173,8 @@ bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_
} else {
img2 = img1.smoothScale(ALEXANDRIA_MAX_SIZE_MEDIUM, ALEXANDRIA_MAX_SIZE_MEDIUM, TQ_ScaleMin); // scale up
}
- if(!img1.save(filename + TQString::tqfromLatin1("_medium.jpg"), "JPEG")
- || !img2.save(filename + TQString::tqfromLatin1("_small.jpg"), "JPEG")) {
+ if(!img1.save(filename + TQString::fromLatin1("_medium.jpg"), "JPEG")
+ || !img2.save(filename + TQString::fromLatin1("_small.jpg"), "JPEG")) {
return false;
}
return true;