diff options
Diffstat (limited to 'src/translators/alexandriaexporter.cpp')
-rw-r--r-- | src/translators/alexandriaexporter.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/translators/alexandriaexporter.cpp b/src/translators/alexandriaexporter.cpp index f59cefe..51e6390 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(); @@ -66,7 +66,7 @@ bool AlexandriaExporter::exec() { int ret = KMessageBox::warningContinueCancel(Kernel::self()->widget(), i18n("<qt>An Alexandria library called <i>%1</i> already exists. " "Any existing books in that library could be overwritten.</qt>") - .tqarg(coll->title())); + .arg(coll->title())); if(ret == KMessageBox::Cancel) { return false; } @@ -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; |