diff options
author | Timothy Pearson <[email protected]> | 2011-12-16 09:57:51 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-12-16 09:57:51 -0600 |
commit | 2781e27b871150395a5a82e221684108641002b2 (patch) | |
tree | 57f4d7c01a48faef1a840fbe0de8f4ec1e5f606f /src/translators | |
parent | 031454e56009d576589c28757f6c6fcf4884095e (diff) | |
download | tellico-2781e27b871150395a5a82e221684108641002b2.tar.gz tellico-2781e27b871150395a5a82e221684108641002b2.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 031454e56009d576589c28757f6c6fcf4884095e.
Diffstat (limited to 'src/translators')
36 files changed, 724 insertions, 724 deletions
diff --git a/src/translators/alexandriaexporter.cpp b/src/translators/alexandriaexporter.cpp index 51e6390..f59cefe 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::fromLatin1("\\\"")); + str_.replace('"', TQString::tqfromLatin1("\\\"")); return str_; } @@ -50,7 +50,7 @@ bool AlexandriaExporter::exec() { return false; } - const TQString alexDirName = TQString::fromLatin1(".alexandria"); + const TQString alexDirName = TQString::tqfromLatin1(".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>") - .arg(coll->title())); + .tqarg(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::fromLatin1("isbn")); + TQString isbn = entry_->field(TQString::tqfromLatin1("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::fromLatin1(".yaml")); + TQFile file(dir_.absPath() + TQDir::separator() + isbn + TQString::tqfromLatin1(".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::fromLatin1("author"), format); + TQStringList authors = entry_->fields(TQString::tqfromLatin1("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::fromLatin1("title"), format); + TQString tmp = entry_->field(TQString::tqfromLatin1("title"), format); ts << "title: \"" << escapeText(tmp) << "\"\n"; // Alexandria refers to the binding as the edition - tmp = entry_->field(TQString::fromLatin1("binding"), format); + tmp = entry_->field(TQString::tqfromLatin1("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::fromLatin1("comments"), format); + tmp = entry_->field(TQString::tqfromLatin1("comments"), format); ts << "notes: \"" << escapeText(tmp) << "\"\n"; - tmp = entry_->field(TQString::fromLatin1("publisher"), format); + tmp = entry_->field(TQString::tqfromLatin1("publisher"), format); // publisher uses n/a when empty - ts << "publisher: \"" << (tmp.isEmpty() ? TQString::fromLatin1("n/a") : escapeText(tmp)) << "\"\n"; + ts << "publisher: \"" << (tmp.isEmpty() ? TQString::tqfromLatin1("n/a") : escapeText(tmp)) << "\"\n"; - tmp = entry_->field(TQString::fromLatin1("pub_year"), format); + tmp = entry_->field(TQString::tqfromLatin1("pub_year"), format); if(!tmp.isEmpty()) { ts << "publishing_year: \"" << escapeText(tmp) << "\"\n"; } - tmp = entry_->field(TQString::fromLatin1("rating")); + tmp = entry_->field(TQString::tqfromLatin1("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::fromLatin1("cover")); + TQString cover = entry_->field(TQString::tqfromLatin1("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::fromLatin1("_medium.jpg"), "JPEG") - || !img2.save(filename + TQString::fromLatin1("_small.jpg"), "JPEG")) { + if(!img1.save(filename + TQString::tqfromLatin1("_medium.jpg"), "JPEG") + || !img2.save(filename + TQString::tqfromLatin1("_small.jpg"), "JPEG")) { return false; } return true; diff --git a/src/translators/alexandriaimporter.cpp b/src/translators/alexandriaimporter.cpp index 9feffec..c3a9db1 100644 --- a/src/translators/alexandriaimporter.cpp +++ b/src/translators/alexandriaimporter.cpp @@ -25,7 +25,7 @@ #include <kapplication.h> #include <kstringhandler.h> -#include <layout.h> +#include <tqlayout.h> #include <tqlabel.h> #include <tqgroupbox.h> @@ -46,18 +46,18 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { dataDir.cd(m_library->currentText()); dataDir.setFilter(TQDir::Files | TQDir::Readable | TQDir::NoSymLinks); - const TQString title = TQString::fromLatin1("title"); - const TQString author = TQString::fromLatin1("author"); - const TQString year = TQString::fromLatin1("pub_year"); - const TQString binding = TQString::fromLatin1("binding"); - const TQString isbn = TQString::fromLatin1("isbn"); - const TQString pub = TQString::fromLatin1("publisher"); - const TQString rating = TQString::fromLatin1("rating"); - const TQString cover = TQString::fromLatin1("cover"); - const TQString comments = TQString::fromLatin1("comments"); + const TQString title = TQString::tqfromLatin1("title"); + const TQString author = TQString::tqfromLatin1("author"); + const TQString year = TQString::tqfromLatin1("pub_year"); + const TQString binding = TQString::tqfromLatin1("binding"); + const TQString isbn = TQString::tqfromLatin1("isbn"); + const TQString pub = TQString::tqfromLatin1("publisher"); + const TQString rating = TQString::tqfromLatin1("rating"); + const TQString cover = TQString::tqfromLatin1("cover"); + const TQString comments = TQString::tqfromLatin1("comments"); // start with yaml files - dataDir.setNameFilter(TQString::fromLatin1("*.yaml")); + dataDir.setNameFilter(TQString::tqfromLatin1("*.yaml")); const TQStringList files = dataDir.entryList(); const uint numFiles = files.count(); const uint stepSize = TQMAX(s_stepSize, numFiles/100); @@ -69,9 +69,9 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { ProgressItem::Done done(this); TQStringList covers; - covers << TQString::fromLatin1(".cover") - << TQString::fromLatin1("_medium.jpg") - << TQString::fromLatin1("_small.jpg"); + covers << TQString::tqfromLatin1(".cover") + << TQString::tqfromLatin1("_medium.jpg") + << TQString::tqfromLatin1("_small.jpg"); TQTextStream ts; ts.setEncoding(TQTextStream::UnicodeUTF8); // YAML is always utf8? @@ -95,7 +95,7 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { readNextLine = true; } // skip the line that starts with --- - if(line.isEmpty() || line.startsWith(TQString::fromLatin1("---"))) { + if(line.isEmpty() || line.startsWith(TQString::tqfromLatin1("---"))) { continue; } if(line.endsWith(TQChar('\\'))) { @@ -117,13 +117,13 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() { if(alexField == Latin1Literal("authors")) { TQStringList authors; line = ts.readLine(); - TQRegExp begin(TQString::fromLatin1("^\\s*-\\s+")); + TQRegExp begin(TQString::tqfromLatin1("^\\s*-\\s+")); while(!line.isNull() && line.find(begin) > -1) { line.remove(begin); authors += clean(line); line = ts.readLine(); } - entry->setField(author, authors.join(TQString::fromLatin1("; "))); + entry->setField(author, authors.join(TQString::tqfromLatin1("; "))); // the next line has already been read readNextLine = false; @@ -196,10 +196,10 @@ TQWidget* AlexandriaImporter::widget(TQWidget* parent_, const char* name_/*=0*/) label->setBuddy(m_library); // .alexandria might not exist - if(m_libraryDir.cd(TQString::fromLatin1(".alexandria"))) { + if(m_libraryDir.cd(TQString::tqfromLatin1(".alexandria"))) { TQStringList dirs = m_libraryDir.entryList(); - dirs.remove(TQString::fromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work - dirs.remove(TQString::fromLatin1("..")); + dirs.remove(TQString::tqfromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work + dirs.remove(TQString::tqfromLatin1("..")); m_library->insertStringList(dirs); } @@ -209,10 +209,10 @@ TQWidget* AlexandriaImporter::widget(TQWidget* parent_, const char* name_/*=0*/) } TQString& AlexandriaImporter::cleanLine(TQString& str_) { - static TQRegExp escRx(TQString::fromLatin1("\\\\x(\\w\\w)"), false); - str_.remove(TQString::fromLatin1("\\r")); - str_.replace(TQString::fromLatin1("\\n"), TQString::fromLatin1("\n")); - str_.replace(TQString::fromLatin1("\\t"), TQString::fromLatin1("\t")); + static TQRegExp escRx(TQString::tqfromLatin1("\\\\x(\\w\\w)"), false); + str_.remove(TQString::tqfromLatin1("\\r")); + str_.replace(TQString::tqfromLatin1("\\n"), TQString::tqfromLatin1("\n")); + str_.replace(TQString::tqfromLatin1("\\t"), TQString::tqfromLatin1("\t")); // YAML uses escape sequences like \xC3 int pos = escRx.search(str_); @@ -236,7 +236,7 @@ TQString& AlexandriaImporter::cleanLine(TQString& str_) { } TQString AlexandriaImporter::clean(TQString& str_) { - const TQRegExp quote(TQString::fromLatin1("\\\\\"")); // equals \" + const TQRegExp quote(TQString::tqfromLatin1("\\\\\"")); // equals \" if(str_.startsWith(TQChar('\'')) || str_.startsWith(TQChar('"'))) { str_.remove(0, 1); } @@ -244,7 +244,7 @@ TQString AlexandriaImporter::clean(TQString& str_) { str_.truncate(str_.length()-1); } // we ignore YAML tags, this is not actually a good parser, but will do for now - str_.remove(TQRegExp(TQString::fromLatin1("^![^\\s]*\\s+"))); + str_.remove(TQRegExp(TQString::tqfromLatin1("^![^\\s]*\\s+"))); return str_.replace(quote, TQChar('"')); } diff --git a/src/translators/amcimporter.cpp b/src/translators/amcimporter.cpp index 185b8fc..0209ddc 100644 --- a/src/translators/amcimporter.cpp +++ b/src/translators/amcimporter.cpp @@ -64,7 +64,7 @@ Tellico::Data::CollPtr AMCImporter::collection() { TQMemArray<char> buffer(l+1); m_ds.readRawBytes(buffer.data(), l); TQString version = TQString::fromLocal8Bit(buffer, l); - TQRegExp versionRx(TQString::fromLatin1(".+AMC_(\\d+)\\.(\\d+).+")); + TQRegExp versionRx(TQString::tqfromLatin1(".+AMC_(\\d+)\\.(\\d+).+")); if(version.find(versionRx) == -1) { myDebug() << "AMCImporter::collection() - no file id match" << endl; return 0; @@ -145,11 +145,11 @@ TQString AMCImporter::readImage(const TQString& format_) { myDebug() << "AMCImporter::readImage() - null image" << endl; return TQString(); } - TQString format = TQString::fromLatin1("PNG"); + TQString format = TQString::tqfromLatin1("PNG"); if(format_ == Latin1Literal(".jpg")) { - format = TQString::fromLatin1("JPEG"); + format = TQString::tqfromLatin1("JPEG"); } else if(format_ == Latin1Literal(".gif")) { - format = TQString::fromLatin1("GIF"); + format = TQString::tqfromLatin1("GIF"); } return ImageFactory::addImage(img, format); } @@ -167,14 +167,14 @@ void AMCImporter::readEntry() { if(m_majVersion >= 3 && m_minVersion >= 5) { rating /= 10; } - e->setField(TQString::fromLatin1("rating"), TQString::number(rating)); + e->setField(TQString::tqfromLatin1("rating"), TQString::number(rating)); int year = readInt(); if(year > 0) { - e->setField(TQString::fromLatin1("year"), TQString::number(year)); + e->setField(TQString::tqfromLatin1("year"), TQString::number(year)); } int time = readInt(); if(time > 0) { - e->setField(TQString::fromLatin1("running-time"), TQString::number(time)); + e->setField(TQString::tqfromLatin1("running-time"), TQString::number(time)); } readInt(); // video bitrate @@ -182,55 +182,55 @@ void AMCImporter::readEntry() { readInt(); // number of files readBool(); // checked readString(); // media label - e->setField(TQString::fromLatin1("medium"), readString()); + e->setField(TQString::tqfromLatin1("medium"), readString()); readString(); // source readString(); // borrower TQString s = readString(); // title if(!s.isEmpty()) { - e->setField(TQString::fromLatin1("title"), s); + e->setField(TQString::tqfromLatin1("title"), s); } TQString s2 = readString(); // translated title if(s.isEmpty()) { - e->setField(TQString::fromLatin1("title"), s2); + e->setField(TQString::tqfromLatin1("title"), s2); } - e->setField(TQString::fromLatin1("director"), readString()); + e->setField(TQString::tqfromLatin1("director"), readString()); s = readString(); - TQRegExp roleRx(TQString::fromLatin1("(.+) \\(([^(]+)\\)")); + TQRegExp roleRx(TQString::tqfromLatin1("(.+) \\(([^(]+)\\)")); roleRx.setMinimal(true); if(s.find(roleRx) > -1) { TQString role = roleRx.cap(2).lower(); if(role == Latin1Literal("story") || role == Latin1Literal("written by")) { - e->setField(TQString::fromLatin1("writer"), roleRx.cap(1)); + e->setField(TQString::tqfromLatin1("writer"), roleRx.cap(1)); } else { - e->setField(TQString::fromLatin1("producer"), s); + e->setField(TQString::tqfromLatin1("producer"), s); } } else { - e->setField(TQString::fromLatin1("producer"), s); + e->setField(TQString::tqfromLatin1("producer"), s); } - e->setField(TQString::fromLatin1("nationality"), readString()); - e->setField(TQString::fromLatin1("genre"), readString().replace(TQString::fromLatin1(", "), TQString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("nationality"), readString()); + e->setField(TQString::tqfromLatin1("genre"), readString().replace(TQString::tqfromLatin1(", "), TQString::tqfromLatin1("; "))); - e->setField(TQString::fromLatin1("cast"), parseCast(readString()).join(TQString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("cast"), parseCast(readString()).join(TQString::tqfromLatin1("; "))); readString(); // url - e->setField(TQString::fromLatin1("plot"), readString()); - e->setField(TQString::fromLatin1("comments"), readString()); + e->setField(TQString::tqfromLatin1("plot"), readString()); + e->setField(TQString::tqfromLatin1("comments"), readString()); s = readString(); // video format - TQRegExp regionRx(TQString::fromLatin1("Region \\d")); + TQRegExp regionRx(TQString::tqfromLatin1("Region \\d")); if(s.find(regionRx) > -1) { - e->setField(TQString::fromLatin1("region"), regionRx.cap(0)); + e->setField(TQString::tqfromLatin1("region"), regionRx.cap(0)); } - e->setField(TQString::fromLatin1("audio-track"), readString()); // audio format + e->setField(TQString::tqfromLatin1("audio-track"), readString()); // audio format readString(); // resolution readString(); // frame rate - e->setField(TQString::fromLatin1("language"), readString()); // audio language - e->setField(TQString::fromLatin1("subtitle"), readString()); // subtitle + e->setField(TQString::tqfromLatin1("language"), readString()); // audio language + e->setField(TQString::tqfromLatin1("subtitle"), readString()); // subtitle readString(); // file size s = readString(); // picture extension s = readImage(s); // picture if(!s.isEmpty()) { - e->setField(TQString::fromLatin1("cover"), s); + e->setField(TQString::tqfromLatin1("cover"), s); } m_coll->addEntries(e); @@ -239,7 +239,7 @@ void AMCImporter::readEntry() { TQStringList AMCImporter::parseCast(const TQString& text_) { TQStringList cast; int nPar = 0; - TQRegExp castRx(TQString::fromLatin1("[,()]")); + TQRegExp castRx(TQString::tqfromLatin1("[,()]")); TQString person, role; int oldPos = 0; for(int pos = text_.find(castRx); pos > -1; pos = text_.find(castRx, pos+1)) { @@ -248,7 +248,7 @@ TQStringList AMCImporter::parseCast(const TQString& text_) { person += text_.mid(oldPos, pos-oldPos).stripWhiteSpace(); TQString all = person; if(!role.isEmpty()) { - if(role.startsWith(TQString::fromLatin1("as "))) { + if(role.startsWith(TQString::tqfromLatin1("as "))) { role = role.mid(3); } all += "::" + role; @@ -277,7 +277,7 @@ TQStringList AMCImporter::parseCast(const TQString& text_) { person += text_.mid(oldPos, pos-oldPos).stripWhiteSpace(); TQString all = person; if(!role.isEmpty()) { - if(role.startsWith(TQString::fromLatin1("as "))) { + if(role.startsWith(TQString::tqfromLatin1("as "))) { role = role.mid(3); } all += "::" + role; diff --git a/src/translators/audiofileimporter.cpp b/src/translators/audiofileimporter.cpp index 2e8054a..e962b18 100644 --- a/src/translators/audiofileimporter.cpp +++ b/src/translators/audiofileimporter.cpp @@ -38,7 +38,7 @@ #include <kapplication.h> #include <tqlabel.h> -#include <layout.h> +#include <tqlayout.h> #include <tqvgroupbox.h> #include <tqcheckbox.h> #include <tqdir.h> @@ -102,13 +102,13 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { } item.setTotalSteps(files.count()); - const TQString title = TQString::fromLatin1("title"); - const TQString artist = TQString::fromLatin1("artist"); - const TQString year = TQString::fromLatin1("year"); - const TQString genre = TQString::fromLatin1("genre"); - const TQString track = TQString::fromLatin1("track"); - const TQString comments = TQString::fromLatin1("comments"); - const TQString file = TQString::fromLatin1("file"); + const TQString title = TQString::tqfromLatin1("title"); + const TQString artist = TQString::tqfromLatin1("artist"); + const TQString year = TQString::tqfromLatin1("year"); + const TQString genre = TQString::tqfromLatin1("genre"); + const TQString track = TQString::tqfromLatin1("track"); + const TQString comments = TQString::tqfromLatin1("comments"); + const TQString file = TQString::tqfromLatin1("file"); m_coll = new Data::MusicCollection(true); @@ -122,12 +122,12 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { f = new Data::Field(file, i18n("Files"), Data::Field::Table); m_coll->addField(f); } - f->setProperty(TQString::fromLatin1("column1"), i18n("Files")); + f->setProperty(TQString::tqfromLatin1("column1"), i18n("Files")); if(addBitrate) { - f->setProperty(TQString::fromLatin1("columns"), TQChar('2')); - f->setProperty(TQString::fromLatin1("column2"), i18n("Bitrate")); + f->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); + f->setProperty(TQString::tqfromLatin1("column2"), i18n("Bitrate")); } else { - f->setProperty(TQString::fromLatin1("columns"), TQChar('1')); + f->setProperty(TQString::tqfromLatin1("columns"), TQChar('1')); } } @@ -141,7 +141,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { for(TQStringList::ConstIterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++j) { TagLib::FileRef f(TQFile::encodeName(*it)); if(f.isNull() || !f.tag()) { - if((*it).endsWith(TQString::fromLatin1("/.directory"))) { + if((*it).endsWith(TQString::tqfromLatin1("/.directory"))) { directoryFiles += *it; } continue; @@ -155,19 +155,19 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { continue; } int disc = discNumber(f); - if(disc > 1 && !m_coll->hasField(TQString::fromLatin1("track%1").arg(disc))) { - Data::FieldPtr f2 = new Data::Field(TQString::fromLatin1("track%1").arg(disc), - i18n("Tracks (Disc %1)").arg(disc), + if(disc > 1 && !m_coll->hasField(TQString::tqfromLatin1("track%1").tqarg(disc))) { + Data::FieldPtr f2 = new Data::Field(TQString::tqfromLatin1("track%1").tqarg(disc), + i18n("Tracks (Disc %1)").tqarg(disc), Data::Field::Table); f2->setFormatFlag(Data::Field::FormatTitle); - f2->setProperty(TQString::fromLatin1("columns"), TQChar('3')); - f2->setProperty(TQString::fromLatin1("column1"), i18n("Title")); - f2->setProperty(TQString::fromLatin1("column2"), i18n("Artist")); - f2->setProperty(TQString::fromLatin1("column3"), i18n("Length")); + f2->setProperty(TQString::tqfromLatin1("columns"), TQChar('3')); + f2->setProperty(TQString::tqfromLatin1("column1"), i18n("Title")); + f2->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist")); + f2->setProperty(TQString::tqfromLatin1("column3"), i18n("Length")); m_coll->addField(f2); if(changeTrackTitle) { Data::FieldPtr newTrack = new Data::Field(*m_coll->fieldByName(track)); - newTrack->setTitle(i18n("Tracks (Disc %1)").arg(1)); + newTrack->setTitle(i18n("Tracks (Disc %1)").tqarg(1)); m_coll->modifyField(newTrack); changeTrackTitle = false; } @@ -252,10 +252,10 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { if(!tag->comment().stripWhiteSpace().isEmpty()) { TQString c = entry->field(comments); if(!c.isEmpty()) { - c += TQString::fromLatin1("<br/>"); + c += TQString::tqfromLatin1("<br/>"); } if(!tag->title().isEmpty()) { - c += TQString::fromLatin1("<em>") + TQString(TStringToQString(tag->title())).stripWhiteSpace() + TQString::fromLatin1("</em> - "); + c += TQString::tqfromLatin1("<em>") + TQString(TStringToQString(tag->title())).stripWhiteSpace() + TQString::tqfromLatin1("</em> - "); } c += TQString(TStringToQString(tag->comment().stripWhiteSpace())).stripWhiteSpace(); entry->setField(comments, c); @@ -286,7 +286,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { } TQTextStream ts; - TQRegExp iconRx(TQString::fromLatin1("Icon\\s*=\\s*(.*)")); + TQRegExp iconRx(TQString::tqfromLatin1("Icon\\s*=\\s*(.*)")); for(TQStringList::ConstIterator it = directoryFiles.begin(); !m_cancelled && it != directoryFiles.end(); ++it, ++j) { TQFile file(*it); if(!file.open(IO_ReadOnly)) { @@ -309,7 +309,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() { u.setPath(fi.absFilePath()); TQString id = ImageFactory::addImage(u, true); if(!id.isEmpty()) { - entry->setField(TQString::fromLatin1("cover"), id); + entry->setField(TQString::tqfromLatin1("cover"), id); } break; } @@ -371,7 +371,7 @@ TQString AudioFileImporter::insertValue(const TQString& str_, const TQString& va myDebug() << "*** New value: " << value_ << endl; } list[pos_-1] = value_; - return list.join(TQString::fromLatin1("; ")); + return list.join(TQString::tqfromLatin1("; ")); } void AudioFileImporter::slotCancel() { diff --git a/src/translators/bibtexexporter.cpp b/src/translators/bibtexexporter.cpp index f79f79e..2135c67 100644 --- a/src/translators/bibtexexporter.cpp +++ b/src/translators/bibtexexporter.cpp @@ -30,7 +30,7 @@ #include <tqregexp.h> #include <tqcheckbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqgroupbox.h> #include <tqwhatsthis.h> #include <tqlabel.h> @@ -69,7 +69,7 @@ bool BibtexExporter::exec() { TQString crossRefField; bool hasCrossRefs = false; - const TQString bibtex = TQString::fromLatin1("bibtex"); + const TQString bibtex = TQString::tqfromLatin1("bibtex"); // keep a list of all the 'ordinary' fields to iterate through later Data::FieldVec fields; Data::FieldVec vec = coll->fields(); @@ -98,12 +98,12 @@ bool BibtexExporter::exec() { return false; } - TQString text = TQString::fromLatin1("@comment{Generated by Tellico ") - + TQString::fromLatin1(VERSION) - + TQString::fromLatin1("}\n\n"); + TQString text = TQString::tqfromLatin1("@comment{Generated by Tellico ") + + TQString::tqfromLatin1(VERSION) + + TQString::tqfromLatin1("}\n\n"); if(!coll->preamble().isEmpty()) { - text += TQString::fromLatin1("@preamble{") + coll->preamble() + TQString::fromLatin1("}\n\n"); + text += TQString::tqfromLatin1("@preamble{") + coll->preamble() + TQString::tqfromLatin1("}\n\n"); } const TQStringList macros = coll->macroList().keys(); @@ -111,11 +111,11 @@ bool BibtexExporter::exec() { TQMap<TQString, TQString>::ConstIterator macroIt; for(macroIt = coll->macroList().constBegin(); macroIt != coll->macroList().constEnd(); ++macroIt) { if(!macroIt.data().isEmpty()) { - text += TQString::fromLatin1("@string{") + text += TQString::tqfromLatin1("@string{") + macroIt.key() - + TQString::fromLatin1("=") + + TQString::tqfromLatin1("=") + BibtexHandler::exportText(macroIt.data(), macros) - + TQString::fromLatin1("}\n\n"); + + TQString::tqfromLatin1("}\n\n"); } } } @@ -236,7 +236,7 @@ TQWidget* BibtexExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void BibtexExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_expandMacros = group.readBoolEntry("Expand Macros", m_expandMacros); m_packageURL = group.readBoolEntry("URL Package", m_packageURL); m_skipEmptyKeys = group.readBoolEntry("Skip Empty Keys", m_skipEmptyKeys); @@ -249,7 +249,7 @@ void BibtexExporter::readOptions(KConfig* config_) { } void BibtexExporter::saveOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_expandMacros = m_checkExpandMacros->isChecked(); group.writeEntry("Expand Macros", m_expandMacros); m_packageURL = m_checkPackageURL->isChecked(); @@ -269,8 +269,8 @@ void BibtexExporter::saveOptions(KConfig* config_) { void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& fields_, const Data::Entry& entry_, const TQString& type_, const TQString& key_) { const TQStringList macros = static_cast<const Data::BibtexCollection*>(Data::Document::self()->collection().data())->macroList().keys(); - const TQString bibtex = TQString::fromLatin1("bibtex"); - const TQString bibtexSep = TQString::fromLatin1("bibtex-separator"); + const TQString bibtex = TQString::tqfromLatin1("bibtex"); + const TQString bibtexSep = TQString::tqfromLatin1("bibtex-separator"); text_ += '@' + type_ + '{' + key_; @@ -287,7 +287,7 @@ void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& field // insert "and" in between them (e.g. author and editor) if(fIt->formatFlag() == Data::Field::FormatName && fIt->flags() & Data::Field::AllowMultiple) { - value.replace(Data::Field::delimiter(), TQString::fromLatin1(" and ")); + value.replace(Data::Field::delimiter(), TQString::tqfromLatin1(" and ")); } else if(fIt->flags() & Data::Field::AllowMultiple) { TQString bibsep = fIt->property(bibtexSep); if(!bibsep.isEmpty()) { @@ -295,11 +295,11 @@ void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& field } } else if(fIt->type() == Data::Field::Para) { // strip HTML from bibtex export - TQRegExp stripHTML(TQString::fromLatin1("<.*>"), true); + TQRegExp stripHTML(TQString::tqfromLatin1("<.*>"), true); stripHTML.setMinimal(true); value.remove(stripHTML); } else if(fIt->property(bibtex) == Latin1Literal("pages")) { - TQRegExp rx(TQString::fromLatin1("(\\d)-(\\d)")); + TQRegExp rx(TQString::tqfromLatin1("(\\d)-(\\d)")); for(int pos = rx.search(value); pos > -1; pos = rx.search(value, pos+2)) { value.replace(pos, 3, rx.cap(1)+"--"+rx.cap(2)); } @@ -308,19 +308,19 @@ void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& field if(m_packageURL && fIt->type() == Data::Field::URL) { bool b = BibtexHandler::s_quoteStyle == BibtexHandler::BRACES; value = (b ? TQChar('{') : TQChar('"')) - + TQString::fromLatin1("\\url{") + BibtexHandler::exportText(value, macros) + TQChar('}') + + TQString::tqfromLatin1("\\url{") + BibtexHandler::exportText(value, macros) + TQChar('}') + (b ? TQChar('}') : TQChar('"')); } else if(fIt->type() != Data::Field::Number) { // numbers aren't escaped, nor will they have macros // if m_expandMacros is true, then macros is empty, so this is ok even then value = BibtexHandler::exportText(value, macros); } - text_ += TQString::fromLatin1(",\n ") + text_ += TQString::tqfromLatin1(",\n ") + fIt->property(bibtex) - + TQString::fromLatin1(" = ") + + TQString::tqfromLatin1(" = ") + value; } - text_ += TQString::fromLatin1("\n}\n\n"); + text_ += TQString::tqfromLatin1("\n}\n\n"); } #include "bibtexexporter.moc" diff --git a/src/translators/bibtexhandler.cpp b/src/translators/bibtexhandler.cpp index 1896f95..873dc27 100644 --- a/src/translators/bibtexhandler.cpp +++ b/src/translators/bibtexhandler.cpp @@ -38,7 +38,7 @@ using Tellico::BibtexHandler; BibtexHandler::StringListMap* BibtexHandler::s_utf8LatexMap = 0; BibtexHandler::QuoteStyle BibtexHandler::s_quoteStyle = BibtexHandler::BRACES; -const TQRegExp BibtexHandler::s_badKeyChars(TQString::fromLatin1("[^0-9a-zA-Z-]")); +const TQRegExp BibtexHandler::s_badKeyChars(TQString::tqfromLatin1("[^0-9a-zA-Z-]")); TQStringList BibtexHandler::bibtexKeys(const Data::EntryVec& entries_) { TQStringList keys; @@ -57,7 +57,7 @@ TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) { } const Data::BibtexCollection* c = static_cast<const Data::BibtexCollection*>(entry_->collection().data()); - Data::FieldPtr f = c->fieldByBibtexName(TQString::fromLatin1("key")); + Data::FieldPtr f = c->fieldByBibtexName(TQString::tqfromLatin1("key")); if(f) { TQString key = entry_->field(f->name()); if(!key.isEmpty()) { @@ -66,7 +66,7 @@ TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) { } TQString author; - Data::FieldPtr authorField = c->fieldByBibtexName(TQString::fromLatin1("author")); + Data::FieldPtr authorField = c->fieldByBibtexName(TQString::tqfromLatin1("author")); if(authorField) { if(authorField->flags() & Data::Field::AllowMultiple) { // grab first author only; @@ -77,21 +77,21 @@ TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) { } } - Data::FieldPtr titleField = c->fieldByBibtexName(TQString::fromLatin1("title")); + Data::FieldPtr titleField = c->fieldByBibtexName(TQString::tqfromLatin1("title")); TQString title; if(titleField) { title = entry_->field(titleField->name()); } - Data::FieldPtr yearField = c->fieldByBibtexName(TQString::fromLatin1("year")); + Data::FieldPtr yearField = c->fieldByBibtexName(TQString::tqfromLatin1("year")); TQString year; if(yearField) { year = entry_->field(yearField->name()); } if(year.isEmpty()) { - year = entry_->field(TQString::fromLatin1("pub_year")); + year = entry_->field(TQString::tqfromLatin1("pub_year")); if(year.isEmpty()) { - year = entry_->field(TQString::fromLatin1("cr_year")); + year = entry_->field(TQString::tqfromLatin1("cr_year")); } } year = year.section(';', 0, 0); @@ -120,7 +120,7 @@ TQString BibtexHandler::bibtexKey(const TQString& author_, const TQString& title } void BibtexHandler::loadTranslationMaps() { - TQString mapfile = locate("appdata", TQString::fromLatin1("bibtex-translation.xml")); + TQString mapfile = locate("appdata", TQString::tqfromLatin1("bibtex-translation.xml")); if(mapfile.isEmpty()) { return; } @@ -132,13 +132,13 @@ void BibtexHandler::loadTranslationMaps() { // no namespace processing TQDomDocument dom = FileHandler::readXMLFile(u, false); - TQDomNodeList keyList = dom.elementsByTagName(TQString::fromLatin1("key")); + TQDomNodeList keyList = dom.elementsByTagName(TQString::tqfromLatin1("key")); for(unsigned i = 0; i < keyList.count(); ++i) { - TQDomNodeList strList = keyList.item(i).toElement().elementsByTagName(TQString::fromLatin1("string")); + TQDomNodeList strList = keyList.item(i).toElement().elementsByTagName(TQString::tqfromLatin1("string")); // the strList might have more than one node since there are multiple ways // to represent a character in LaTex. - TQString s = keyList.item(i).toElement().attribute(TQString::fromLatin1("char")); + TQString s = keyList.item(i).toElement().attribute(TQString::tqfromLatin1("char")); for(unsigned j = 0; j < strList.count(); ++j) { (*s_utf8LatexMap)[s].append(strList.item(j).toElement().text()); // kdDebug() << "BibtexHandler::loadTranslationMaps - " @@ -164,9 +164,9 @@ TQString BibtexHandler::importText(char* text_) { // we need to lower-case any capitalized text after the first letter that is // NOT contained in braces - TQRegExp rx(TQString::fromLatin1("\\{([A-Z]+)\\}")); + TQRegExp rx(TQString::tqfromLatin1("\\{([A-Z]+)\\}")); rx.setMinimal(true); - str.replace(rx, TQString::fromLatin1("\\1")); + str.replace(rx, TQString::tqfromLatin1("\\1")); return str; } @@ -245,10 +245,10 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexF // special case, try to detect URLs // In qt 3.1, TQString::startsWith() is always case-sensitive if(bibtexField_ == Latin1Literal("url") - || vlower.startsWith(TQString::fromLatin1("http")) // may also be https - || vlower.startsWith(TQString::fromLatin1("ftp:/")) - || vlower.startsWith(TQString::fromLatin1("file:/")) - || vlower.startsWith(TQString::fromLatin1("/"))) { // assume this indicates a local path + || vlower.startsWith(TQString::tqfromLatin1("http")) // may also be https + || vlower.startsWith(TQString::tqfromLatin1("ftp:/")) + || vlower.startsWith(TQString::tqfromLatin1("file:/")) + || vlower.startsWith(TQString::tqfromLatin1("/"))) { // assume this indicates a local path myDebug() << "BibtexHandler::setFieldValue() - creating a URL field for " << bibtexField_ << endl; field = new Data::Field(bibtexField_, KStringHandler::capwords(bibtexField_), Data::Field::URL); } else { @@ -258,12 +258,12 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexF } else { field = new Data::Field(bibtexField_, KStringHandler::capwords(bibtexField_), Data::Field::Para); } - field->setProperty(TQString::fromLatin1("bibtex"), bibtexField_); + field->setProperty(TQString::tqfromLatin1("bibtex"), bibtexField_); c->addField(field); } // special case keywords, replace commas with semi-colons so they get separated TQString value = value_; - if(field->property(TQString::fromLatin1("bibtex")).startsWith(TQString::fromLatin1("keyword"))) { + if(field->property(TQString::tqfromLatin1("bibtex")).startsWith(TQString::tqfromLatin1("keyword"))) { value.replace(',', ';'); // special case refbase bibtex export, with multiple keywords fields TQString oValue = entry_->field(field); @@ -276,11 +276,11 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexF TQString& BibtexHandler::cleanText(TQString& text_) { // FIXME: need to improve this for removing all Latex entities -// TQRegExp rx(TQString::fromLatin1("(?=[^\\\\])\\\\.+\\{")); - TQRegExp rx(TQString::fromLatin1("\\\\.+\\{")); +// TQRegExp rx(TQString::tqfromLatin1("(?=[^\\\\])\\\\.+\\{")); + TQRegExp rx(TQString::tqfromLatin1("\\\\.+\\{")); rx.setMinimal(true); text_.replace(rx, TQString()); - text_.replace(TQRegExp(TQString::fromLatin1("[{}]")), TQString()); + text_.replace(TQRegExp(TQString::tqfromLatin1("[{}]")), TQString()); text_.replace('~', ' '); return text_; } diff --git a/src/translators/bibteximporter.cpp b/src/translators/bibteximporter.cpp index 5b639f4..0b4775b 100644 --- a/src/translators/bibteximporter.cpp +++ b/src/translators/bibteximporter.cpp @@ -25,11 +25,11 @@ #include <tqptrlist.h> #include <tqregexp.h> -#include <layout.h> +#include <tqlayout.h> #include <tqvbuttongroup.h> #include <tqradiobutton.h> #include <tqwhatsthis.h> -#include <textcodec.h> +#include <tqtextcodec.h> using Tellico::Import::BibtexImporter; @@ -95,7 +95,7 @@ Tellico::Data::CollPtr BibtexImporter::collection() { } Data::CollPtr coll = readCollection(text, count); if(!coll || coll->entryCount() == 0) { - setStatusMessage(i18n("No valid bibtex entries were found in file - %1").arg(url().fileName())); + setStatusMessage(i18n("No valid bibtex entries were found in file - %1").tqarg(url().fileName())); continue; } m_coll->addEntries(coll->entries()); @@ -160,17 +160,17 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const TQString& text, int str = TQString::fromUtf8(bt_entry_type(it.current())); // kdDebug() << "entry type: " << str << endl; // text is automatically put into lower-case by btparse - BibtexHandler::setFieldValue(entry, TQString::fromLatin1("entry-type"), str); + BibtexHandler::setFieldValue(entry, TQString::tqfromLatin1("entry-type"), str); str = TQString::fromUtf8(bt_entry_key(it.current())); // kdDebug() << "entry key: " << str << endl; - BibtexHandler::setFieldValue(entry, TQString::fromLatin1("key"), str); + BibtexHandler::setFieldValue(entry, TQString::tqfromLatin1("key"), str); char* name; AST* field = 0; while((field = bt_next_field(it.current(), field, &name))) { // kdDebug() << "\tfound: " << name << endl; -// str = TQString::fromLatin1(bt_get_text(field)); +// str = TQString::tqfromLatin1(bt_get_text(field)); str.truncate(0); AST* value = 0; bt_nodetype type; @@ -197,7 +197,7 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const TQString& text, int } TQString fieldName = TQString::fromUtf8(name); if(fieldName == Latin1Literal("author") || fieldName == Latin1Literal("editor")) { - str.replace(TQRegExp(TQString::fromLatin1("\\sand\\s")), TQString::fromLatin1("; ")); + str.replace(TQRegExp(TQString::tqfromLatin1("\\sand\\s")), TQString::tqfromLatin1("; ")); } BibtexHandler::setFieldValue(entry, fieldName, str); } @@ -235,8 +235,8 @@ void BibtexImporter::parseText(const TQString& text) { // bt_set_stringopts(BTE_PREAMBLE, BTO_CONVERT | BTO_EXPAND); TQString entry; - TQRegExp rx(TQString::fromLatin1("[{}]")); - TQRegExp macroName(TQString::fromLatin1("@string\\s*\\{\\s*(.*)="), false /*case sensitive*/); + TQRegExp rx(TQString::tqfromLatin1("[{}]")); + TQRegExp macroName(TQString::tqfromLatin1("@string\\s*\\{\\s*(.*)="), false /*case sensitive*/); macroName.setMinimal(true); bool needsCleanup = false; @@ -289,8 +289,8 @@ TQWidget* BibtexImporter::widget(TQWidget* parent_, const char* name_/*=0*/) { TQButtonGroup* box = new TQVButtonGroup(i18n("Bibtex Options"), m_widget); m_readUTF8 = new TQRadioButton(i18n("Use Unicode (UTF-8) encoding"), box); TQWhatsThis::add(m_readUTF8, i18n("Read the imported file in Unicode (UTF-8).")); - TQString localStr = i18n("Use user locale (%1) encoding").arg( - TQString::fromLatin1(TQTextCodec::codecForLocale()->name())); + TQString localStr = i18n("Use user locale (%1) encoding").tqarg( + TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name())); m_readLocale = new TQRadioButton(localStr, box); m_readLocale->setChecked(true); TQWhatsThis::add(m_readLocale, i18n("Read the imported file in the local encoding.")); diff --git a/src/translators/bibtexmlexporter.cpp b/src/translators/bibtexmlexporter.cpp index 23f84f9..85934b2 100644 --- a/src/translators/bibtexmlexporter.cpp +++ b/src/translators/bibtexmlexporter.cpp @@ -28,7 +28,7 @@ #include <tqvbox.h> #include <tqdom.h> #include <tqregexp.h> -#include <textcodec.h> +#include <tqtextcodec.h> using Tellico::Export::BibtexmlExporter; @@ -53,7 +53,7 @@ bool BibtexmlExporter::exec() { // the key specifies the cite-key TQString keyField; - const TQString bibtex = TQString::fromLatin1("bibtex"); + const TQString bibtex = TQString::tqfromLatin1("bibtex"); // keep a list of all the 'ordinary' fields to iterate through later Data::FieldVec fields; Data::FieldVec vec = coll->fields(); @@ -69,28 +69,28 @@ bool BibtexmlExporter::exec() { } TQDomImplementation impl; - TQDomDocumentType doctype = impl.createDocumentType(TQString::fromLatin1("file"), + TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("file"), TQString(), XML::dtdBibtexml); //default namespace const TQString& ns = XML::nsBibtexml; - TQDomDocument dom = impl.createDocument(ns, TQString::fromLatin1("file"), doctype); + TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("file"), doctype); // root element TQDomElement root = dom.documentElement(); - TQString encodeStr = TQString::fromLatin1("version=\"1.0\" encoding=\""); + TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\""); if(options() & Export::ExportUTF8) { - encodeStr += TQString::fromLatin1("UTF-8"); + encodeStr += TQString::tqfromLatin1("UTF-8"); } else { - encodeStr += TQString::fromLatin1(TQTextCodec::codecForLocale()->mimeName()); + encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName()); } encodeStr += '"'; // createDocument creates a root node, insert the processing instruction before it - dom.insertBefore(dom.createProcessingInstruction(TQString::fromLatin1("xml"), encodeStr), root); - TQString comment = TQString::fromLatin1("Generated by Tellico ") + TQString::fromLatin1(VERSION); + dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root); + TQString comment = TQString::tqfromLatin1("Generated by Tellico ") + TQString::tqfromLatin1(VERSION); dom.insertBefore(dom.createComment(comment), root); Data::ConstFieldPtr field; @@ -115,8 +115,8 @@ bool BibtexmlExporter::exec() { key = newKey; usedKeys.add(key); - btElem = dom.createElement(TQString::fromLatin1("entry")); - btElem.setAttribute(TQString::fromLatin1("id"), key); + btElem = dom.createElement(TQString::tqfromLatin1("entry")); + btElem.setAttribute(TQString::tqfromLatin1("id"), key); root.appendChild(btElem); type = entryIt->field(typeField); @@ -149,12 +149,12 @@ bool BibtexmlExporter::exec() { elemName == Latin1Literal("editor") || elemName == Latin1Literal("keywords")) { if(elemName == Latin1Literal("author")) { - parElemName = TQString::fromLatin1("authorlist"); + parElemName = TQString::tqfromLatin1("authorlist"); } else if(elemName == Latin1Literal("editor")) { - parElemName = TQString::fromLatin1("editorlist"); + parElemName = TQString::tqfromLatin1("editorlist"); } else { // keywords - parElemName = TQString::fromLatin1("keywords"); - elemName = TQString::fromLatin1("keyword"); + parElemName = TQString::tqfromLatin1("keywords"); + elemName = TQString::tqfromLatin1("keyword"); } parentElem = dom.createElement(parElemName); diff --git a/src/translators/bibtexmlimporter.cpp b/src/translators/bibtexmlimporter.cpp index bf33c02..9131320 100644 --- a/src/translators/bibtexmlimporter.cpp +++ b/src/translators/bibtexmlimporter.cpp @@ -40,14 +40,14 @@ Tellico::Data::CollPtr BibtexmlImporter::collection() { void BibtexmlImporter::loadDomDocument() { TQDomElement root = domDocument().documentElement(); if(root.isNull() || root.localName() != Latin1Literal("file")) { - setStatusMessage(i18n(errorLoad).arg(url().fileName())); + setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); return; } const TQString& ns = XML::nsBibtexml; m_coll = new Data::BibtexCollection(true); - TQDomNodeList entryelems = root.elementsByTagNameNS(ns, TQString::fromLatin1("entry")); + TQDomNodeList entryelems = root.elementsByTagNameNS(ns, TQString::tqfromLatin1("entry")); // kdDebug() << "BibtexmlImporter::loadDomDocument - found " << entryelems.count() << " entries" << endl; const uint count = entryelems.count(); @@ -83,9 +83,9 @@ void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) { <publisher>...</publisher> */ TQString type = node.firstChild().toElement().tagName(); - entry->setField(TQString::fromLatin1("entry-type"), type); - TQString id = node.toElement().attribute(TQString::fromLatin1("id")); - entry->setField(TQString::fromLatin1("bibtex-key"), id); + entry->setField(TQString::tqfromLatin1("entry-type"), type); + TQString id = node.toElement().attribute(TQString::tqfromLatin1("id")); + entry->setField(TQString::tqfromLatin1("bibtex-key"), id); TQString name, value; // field values are first child of first child of entry node @@ -112,23 +112,23 @@ void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) { } else { name = n.firstChild().toElement().tagName(); if(name == Latin1Literal("keyword")) { - name = TQString::fromLatin1("keywords"); + name = TQString::tqfromLatin1("keywords"); } value.truncate(0); for(TQDomNode n2 = n.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) { // n2 could have first, middle, lastname elements... if(name == Latin1Literal("person")) { TQStringList names; - names << TQString::fromLatin1("initials") << TQString::fromLatin1("first") - << TQString::fromLatin1("middle") << TQString::fromLatin1("prelast") - << TQString::fromLatin1("last") << TQString::fromLatin1("lineage"); + names << TQString::tqfromLatin1("initials") << TQString::tqfromLatin1("first") + << TQString::tqfromLatin1("middle") << TQString::tqfromLatin1("prelast") + << TQString::tqfromLatin1("last") << TQString::tqfromLatin1("lineage"); for(TQStringList::ConstIterator it = names.begin(); it != names.end(); ++it) { TQDomNodeList list = n2.toElement().elementsByTagName(*it); if(list.count() > 1) { value += list.item(0).toElement().text(); } if(*it != names.last()) { - value += TQString::fromLatin1(" "); + value += TQString::tqfromLatin1(" "); } } } @@ -139,11 +139,11 @@ void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) { value += n3.toText().data(); } if(n3 != n2.lastChild()) { - value += TQString::fromLatin1(" "); + value += TQString::tqfromLatin1(" "); } } if(n2 != n.lastChild()) { - value += TQString::fromLatin1("; "); + value += TQString::tqfromLatin1("; "); } } } diff --git a/src/translators/btparse/ast.c b/src/translators/btparse/ast.c index d433f79..e3479b7 100644 --- a/src/translators/btparse/ast.c +++ b/src/translators/btparse/ast.c @@ -144,7 +144,7 @@ zzfree_ast(AST *tree) } /* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the children siblings and return ptr + * If root is NULL, simply make the tqchildren siblings and return ptr * to 1st sibling (child1). If root is not single node, return NULL. * * Siblings that are actually siblins lists themselves are handled diff --git a/src/translators/btparse/postprocess.c b/src/translators/btparse/postprocess.c index 7f7bfd4..692e084 100644 --- a/src/translators/btparse/postprocess.c +++ b/src/translators/btparse/postprocess.c @@ -464,7 +464,7 @@ bt_postprocess_entry (AST * top, ushort options) "invalid node type (not entry root)"); strlwr (top->text); /* downcase entry type */ - if (top->down == NULL) return; /* no children at all */ + if (top->down == NULL) return; /* no tqchildren at all */ cur = top->down; if (cur->nodetype == BTAST_KEY) diff --git a/src/translators/csvexporter.cpp b/src/translators/csvexporter.cpp index 2befed1..d4831b3 100644 --- a/src/translators/csvexporter.cpp +++ b/src/translators/csvexporter.cpp @@ -23,7 +23,7 @@ #include <tqgroupbox.h> #include <tqcheckbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqbuttongroup.h> #include <tqradiobutton.h> #include <tqwhatsthis.h> @@ -49,7 +49,7 @@ TQString& CSVExporter::escapeText(TQString& text_) { if(text_.find('"') != -1) { quotes = true; // quotation marks will be escaped by using a double pair - text_.replace('"', TQString::fromLatin1("\"\"")); + text_.replace('"', TQString::tqfromLatin1("\"\"")); } // if the text contains quotes or the delimiter, it needs to be surrounded by quotes if(quotes || text_.find(m_delimiter) != -1) { @@ -115,8 +115,8 @@ TQWidget* CSVExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { "field titles.")); TQButtonGroup* delimiterGroup = new TQButtonGroup(0, Qt::Vertical, i18n("Delimiter"), box); - TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(delimiterGroup->layout()); - m_delimiterGroupLayout->setAlignment(TQt::AlignTop); + TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(delimiterGroup->tqlayout()); + m_delimiterGroupLayout->tqsetAlignment(TQt::AlignTop); TQWhatsThis::add(delimiterGroup, i18n("In addition to a comma, other characters may be used as " "a delimiter, separating each value in the file.")); @@ -165,7 +165,7 @@ TQWidget* CSVExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void CSVExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_includeTitles = group.readBoolEntry("Include Titles", m_includeTitles); m_delimiter = group.readEntry("Delimiter", m_delimiter); } @@ -182,7 +182,7 @@ void CSVExporter::saveOptions(KConfig* config_) { m_delimiter = m_editOther->text(); } - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); group.writeEntry("Include Titles", m_includeTitles); group.writeEntry("Delimiter", m_delimiter); } diff --git a/src/translators/csvimporter.cpp b/src/translators/csvimporter.cpp index 4b60540..cf233bd 100644 --- a/src/translators/csvimporter.cpp +++ b/src/translators/csvimporter.cpp @@ -37,7 +37,7 @@ extern "C" { #include <kmessagebox.h> #include <tqgroupbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqhbox.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -99,7 +99,7 @@ CSVImporter::CSVImporter(const KURL& url_) : Tellico::Import::TextImporter(url_) m_coll(0), m_existingCollection(0), m_firstRowHeader(false), - m_delimiter(TQString::fromLatin1(",")), + m_delimiter(TQString::tqfromLatin1(",")), m_cancelled(false), m_widget(0), m_table(0), @@ -202,7 +202,7 @@ Tellico::Data::CollPtr CSVImporter::collection() { } { - KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - CSV")); + KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - CSV")); config.writeEntry("Delimiter", m_delimiter); config.writeEntry("First Row Titles", m_firstRowHeader); } @@ -238,8 +238,8 @@ TQWidget* CSVImporter::widget(TQWidget* parent_, const char* name_) { TQHBox* hbox2 = new TQHBox(group); m_delimiterGroup = new TQButtonGroup(0, Qt::Vertical, i18n("Delimiter"), hbox2); - TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(m_delimiterGroup->layout(), 3, 3); - m_delimiterGroupLayout->setAlignment(TQt::AlignTop); + TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(m_delimiterGroup->tqlayout(), 3, 3); + m_delimiterGroupLayout->tqsetAlignment(TQt::AlignTop); TQWhatsThis::add(m_delimiterGroup, i18n("In addition to a comma, other characters may be used as " "a delimiter, separating each value in the file.")); connect(m_delimiterGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotDelimiter())); @@ -314,13 +314,13 @@ TQWidget* CSVImporter::widget(TQWidget* parent_, const char* name_) { m_setColumnBtn = new KPushButton(i18n("&Assign Field"), hbox); hlay->addWidget(m_setColumnBtn); - m_setColumnBtn->setIconSet(SmallIconSet(TQString::fromLatin1("apply"))); + m_setColumnBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("apply"))); connect(m_setColumnBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetColumnTitle())); hlay->addStretch(10); l->addStretch(1); - KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - CSV")); + KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - CSV")); m_delimiter = config.readEntry("Delimiter", m_delimiter); m_firstRowHeader = config.readBoolEntry("First Row Titles", m_firstRowHeader); diff --git a/src/translators/dcimporter.cpp b/src/translators/dcimporter.cpp index 19b8829..5839255 100644 --- a/src/translators/dcimporter.cpp +++ b/src/translators/dcimporter.cpp @@ -35,17 +35,17 @@ Tellico::Data::CollPtr DCImporter::collection() { TQDomDocument doc = domDocument(); - TQRegExp authorDateRX(TQString::fromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$")); - TQRegExp dateRX(TQString::fromLatin1("\\d{4}")); + TQRegExp authorDateRX(TQString::tqfromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$")); + TQRegExp dateRX(TQString::tqfromLatin1("\\d{4}")); - TQDomNodeList recordList = doc.elementsByTagNameNS(zing, TQString::fromLatin1("recordData")); + TQDomNodeList recordList = doc.elementsByTagNameNS(zing, TQString::tqfromLatin1("recordData")); myDebug() << "DCImporter::collection() - number of records: " << recordList.count() << endl; enum { UnknownNS, UseNS, NoNS } useNS = UnknownNS; #define GETELEMENTS(s) (useNS == NoNS) \ - ? elem.elementsByTagName(TQString::fromLatin1(s)) \ - : elem.elementsByTagNameNS(dc, TQString::fromLatin1(s)) + ? elem.elementsByTagName(TQString::tqfromLatin1(s)) \ + : elem.elementsByTagNameNS(dc, TQString::tqfromLatin1(s)) for(uint i = 0; i < recordList.count(); ++i) { Data::EntryPtr e = new Data::Entry(c); @@ -55,7 +55,7 @@ Tellico::Data::CollPtr DCImporter::collection() { TQDomNodeList nodeList = GETELEMENTS("title"); if(nodeList.count() == 0) { // no title, skip if(useNS == UnknownNS) { - nodeList = elem.elementsByTagName(TQString::fromLatin1("title")); + nodeList = elem.elementsByTagName(TQString::tqfromLatin1("title")); if(nodeList.count() > 0) { useNS = NoNS; } else { @@ -72,7 +72,7 @@ Tellico::Data::CollPtr DCImporter::collection() { TQString s = nodeList.item(0).toElement().text(); s.replace('\n', ' '); s = s.simplifyWhiteSpace(); - e->setField(TQString::fromLatin1("title"), s); + e->setField(TQString::tqfromLatin1("title"), s); nodeList = GETELEMENTS("creator"); TQStringList creators; @@ -91,33 +91,33 @@ Tellico::Data::CollPtr DCImporter::collection() { creators << s; } } - e->setField(TQString::fromLatin1("author"), creators.join(TQString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("author"), creators.join(TQString::tqfromLatin1("; "))); nodeList = GETELEMENTS("publisher"); TQStringList publishers; for(uint j = 0; j < nodeList.count(); ++j) { publishers << nodeList.item(j).toElement().text(); } - e->setField(TQString::fromLatin1("publisher"), publishers.join(TQString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("publisher"), publishers.join(TQString::tqfromLatin1("; "))); nodeList = GETELEMENTS("subject"); TQStringList keywords; for(uint j = 0; j < nodeList.count(); ++j) { keywords << nodeList.item(j).toElement().text(); } - e->setField(TQString::fromLatin1("keyword"), keywords.join(TQString::fromLatin1("; "))); + e->setField(TQString::tqfromLatin1("keyword"), keywords.join(TQString::tqfromLatin1("; "))); nodeList = GETELEMENTS("date"); if(nodeList.count() > 0) { TQString s = nodeList.item(0).toElement().text(); if(dateRX.search(s) > -1) { - e->setField(TQString::fromLatin1("pub_year"), dateRX.cap()); + e->setField(TQString::tqfromLatin1("pub_year"), dateRX.cap()); } } nodeList = GETELEMENTS("description"); if(nodeList.count() > 0) { // no title, skip - e->setField(TQString::fromLatin1("comments"), nodeList.item(0).toElement().text()); + e->setField(TQString::tqfromLatin1("comments"), nodeList.item(0).toElement().text()); } c->addEntries(e); diff --git a/src/translators/deliciousimporter.cpp b/src/translators/deliciousimporter.cpp index a82c006..78c128d 100644 --- a/src/translators/deliciousimporter.cpp +++ b/src/translators/deliciousimporter.cpp @@ -24,7 +24,7 @@ using Tellico::Import::DeliciousImporter; DeliciousImporter::DeliciousImporter(const KURL& url_) : XSLTImporter(url_) { - TQString xsltFile = locate("appdata", TQString::fromLatin1("delicious2tellico.xsl")); + TQString xsltFile = locate("appdata", TQString::tqfromLatin1("delicious2tellico.xsl")); if(!xsltFile.isEmpty()) { KURL u; u.setPath(xsltFile); @@ -47,13 +47,13 @@ Tellico::Data::CollPtr DeliciousImporter::collection() { KURL libraryDir = url(); libraryDir.setPath(url().directory() + "Images/"); const TQStringList imageDirs = TQStringList() - << TQString::fromLatin1("Large Covers/") - << TQString::fromLatin1("Medium Covers/") - << TQString::fromLatin1("Small Covers/") - << TQString::fromLatin1("Plain Covers/"); - const TQString commField = TQString::fromLatin1("comments"); - const TQString uuidField = TQString::fromLatin1("uuid"); - const TQString coverField = TQString::fromLatin1("cover"); + << TQString::tqfromLatin1("Large Covers/") + << TQString::tqfromLatin1("Medium Covers/") + << TQString::tqfromLatin1("Small Covers/") + << TQString::tqfromLatin1("Plain Covers/"); + const TQString commField = TQString::tqfromLatin1("comments"); + const TQString uuidField = TQString::tqfromLatin1("uuid"); + const TQString coverField = TQString::tqfromLatin1("cover"); const bool isLocal = url().isLocalFile(); Data::EntryVec entries = coll->entries(); diff --git a/src/translators/filelistingimporter.cpp b/src/translators/filelistingimporter.cpp index f59cc8b..8f3afe1 100644 --- a/src/translators/filelistingimporter.cpp +++ b/src/translators/filelistingimporter.cpp @@ -30,7 +30,7 @@ #include <tqcheckbox.h> #include <tqvgroupbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqwhatsthis.h> #include <tqfile.h> #include <tqfileinfo.h> @@ -80,20 +80,20 @@ Tellico::Data::CollPtr FileListingImporter::collection() { const bool usePreview = m_filePreview->isChecked(); - const TQString title = TQString::fromLatin1("title"); - const TQString url = TQString::fromLatin1("url"); - const TQString desc = TQString::fromLatin1("description"); - const TQString vol = TQString::fromLatin1("volume"); - const TQString folder = TQString::fromLatin1("folder"); - const TQString type = TQString::fromLatin1("mimetype"); - const TQString size = TQString::fromLatin1("size"); - const TQString perm = TQString::fromLatin1("permissions"); - const TQString owner = TQString::fromLatin1("owner"); - const TQString group = TQString::fromLatin1("group"); - const TQString created = TQString::fromLatin1("created"); - const TQString modified = TQString::fromLatin1("modified"); - const TQString metainfo = TQString::fromLatin1("metainfo"); - const TQString icon = TQString::fromLatin1("icon"); + const TQString title = TQString::tqfromLatin1("title"); + const TQString url = TQString::tqfromLatin1("url"); + const TQString desc = TQString::tqfromLatin1("description"); + const TQString vol = TQString::tqfromLatin1("volume"); + const TQString folder = TQString::tqfromLatin1("folder"); + const TQString type = TQString::tqfromLatin1("mimetype"); + const TQString size = TQString::tqfromLatin1("size"); + const TQString perm = TQString::tqfromLatin1("permissions"); + const TQString owner = TQString::tqfromLatin1("owner"); + const TQString group = TQString::tqfromLatin1("group"); + const TQString created = TQString::tqfromLatin1("created"); + const TQString modified = TQString::tqfromLatin1("modified"); + const TQString metainfo = TQString::tqfromLatin1("metainfo"); + const TQString icon = TQString::tqfromLatin1("icon"); m_coll = new Data::FileCatalog(true); TQString tmp; @@ -144,7 +144,7 @@ Tellico::Data::CollPtr FileListingImporter::collection() { } } } - entry->setField(metainfo, strings.join(TQString::fromLatin1("; "))); + entry->setField(metainfo, strings.join(TQString::tqfromLatin1("; "))); } if(!m_cancelled && usePreview) { @@ -158,7 +158,7 @@ Tellico::Data::CollPtr FileListingImporter::collection() { if(!m_pixmap.isNull()) { // is png best option? - TQString id = ImageFactory::addImage(m_pixmap, TQString::fromLatin1("PNG")); + TQString id = ImageFactory::addImage(m_pixmap, TQString::tqfromLatin1("PNG")); if(!id.isEmpty()) { entry->setField(icon, id); } @@ -248,7 +248,7 @@ TQString FileListingImporter::volumeName() const { char buf[VOLUME_NAME_SIZE]; int ret = fread(buf, 1, VOLUME_NAME_SIZE, dev); if(ret == VOLUME_NAME_SIZE) { - volume = TQString::fromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace(); + volume = TQString::tqfromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace(); } } else { myDebug() << "FileListingImporter::volumeName() - can't seek " << devName << endl; diff --git a/src/translators/freedbimporter.cpp b/src/translators/freedbimporter.cpp index 8f08e45..8a13ed3 100644 --- a/src/translators/freedbimporter.cpp +++ b/src/translators/freedbimporter.cpp @@ -43,7 +43,7 @@ #include <tqfile.h> #include <tqdir.h> #include <tqlabel.h> -#include <layout.h> +#include <tqlayout.h> #include <tqgroupbox.h> #include <tqwhatsthis.h> #include <tqradiobutton.h> @@ -81,7 +81,7 @@ void FreeDBImporter::readCDROM() { #ifdef HAVE_KCDDB TQString drivePath = m_driveCombo->currentText(); if(drivePath.isEmpty()) { - setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").arg(drivePath)); + setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").tqarg(drivePath)); myDebug() << "FreeDBImporter::readCDROM() - no drive!" << endl; return; } @@ -96,7 +96,7 @@ void FreeDBImporter::readCDROM() { } { - KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - FreeDB")); + KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB")); config.writeEntry("CD-ROM Devices", drives); config.writeEntry("Last Device", drivePath); config.writeEntry("Cache Files Only", false); @@ -167,7 +167,7 @@ void FreeDBImporter::readCDROM() { #endif if(list.isEmpty()) { - setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").arg(drivePath)); + setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").tqarg(drivePath)); return; } // myDebug() << KCDDB::CDDB::trackOffsetListToId(list) << endl; @@ -185,9 +185,9 @@ void FreeDBImporter::readCDROM() { TQStringList list; KCDDB::CDInfoList infoList = client.lookupResponse(); for(KCDDB::CDInfoList::iterator it = infoList.begin(); it != infoList.end(); ++it) { - list.append(TQString::fromLatin1("%1, %2, %3").arg((*it).artist) - .arg((*it).title) - .arg((*it).genre)); + list.append(TQString::tqfromLatin1("%1, %2, %3").tqarg((*it).artist) + .tqarg((*it).title) + .tqarg((*it).genre)); } // switch back to pointer cursor @@ -254,23 +254,23 @@ void FreeDBImporter::readCDROM() { Data::EntryPtr entry = new Data::Entry(m_coll); // obviously a CD - entry->setField(TQString::fromLatin1("medium"), i18n("Compact Disc")); - entry->setField(TQString::fromLatin1("title"), info.title); - entry->setField(TQString::fromLatin1("artist"), info.artist); - entry->setField(TQString::fromLatin1("genre"), info.genre); + entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc")); + entry->setField(TQString::tqfromLatin1("title"), info.title); + entry->setField(TQString::tqfromLatin1("artist"), info.artist); + entry->setField(TQString::tqfromLatin1("genre"), info.genre); if(info.year > 0) { - entry->setField(TQString::fromLatin1("year"), TQString::number(info.year)); + entry->setField(TQString::tqfromLatin1("year"), TQString::number(info.year)); } - entry->setField(TQString::fromLatin1("keyword"), info.category); + entry->setField(TQString::tqfromLatin1("keyword"), info.category); TQString extd = info.extd; - extd.replace('\n', TQString::fromLatin1("<br/>")); - entry->setField(TQString::fromLatin1("comments"), extd); + extd.replace('\n', TQString::tqfromLatin1("<br/>")); + entry->setField(TQString::tqfromLatin1("comments"), extd); TQStringList trackList; KCDDB::TrackInfoList t = info.trackInfoList; for(uint i = 0; i < t.count(); ++i) { #if KDE_IS_VERSION(3,4,90) - TQString s = t[i].get(TQString::fromLatin1("title")).toString() + "::" + info.artist; + TQString s = t[i].get(TQString::tqfromLatin1("title")).toString() + "::" + info.artist; #else TQString s = t[i].title + "::" + info.artist; #endif @@ -280,7 +280,7 @@ void FreeDBImporter::readCDROM() { trackList << s; // TODO: KDE4 will probably have track length too } - entry->setField(TQString::fromLatin1("track"), trackList.join(TQString::fromLatin1("; "))); + entry->setField(TQString::tqfromLatin1("track"), trackList.join(TQString::tqfromLatin1("; "))); m_coll->addEntries(entry); readCDText(drive); @@ -291,7 +291,7 @@ void FreeDBImporter::readCache() { #ifdef HAVE_KCDDB { // remember the import options - KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - FreeDB")); + KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB")); config.writeEntry("Cache Files Only", true); } @@ -320,12 +320,12 @@ void FreeDBImporter::readCache() { // kapp->processEvents(); // really needed ? } - const TQString title = TQString::fromLatin1("title"); - const TQString artist = TQString::fromLatin1("artist"); - const TQString year = TQString::fromLatin1("year"); - const TQString genre = TQString::fromLatin1("genre"); - const TQString track = TQString::fromLatin1("track"); - const TQString comments = TQString::fromLatin1("comments"); + const TQString title = TQString::tqfromLatin1("title"); + const TQString artist = TQString::tqfromLatin1("artist"); + const TQString year = TQString::tqfromLatin1("year"); + const TQString genre = TQString::tqfromLatin1("genre"); + const TQString track = TQString::tqfromLatin1("track"); + const TQString comments = TQString::tqfromLatin1("comments"); uint numFiles = files.count(); if(numFiles == 0) { @@ -372,39 +372,39 @@ void FreeDBImporter::readCache() { // create a new entry and set fields Data::EntryPtr entry = new Data::Entry(m_coll); // obviously a CD - entry->setField(TQString::fromLatin1("medium"), i18n("Compact Disc")); + entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc")); entry->setField(title, info.title); entry->setField(artist, info.artist); entry->setField(genre, info.genre); if(info.year > 0) { - entry->setField(TQString::fromLatin1("year"), TQString::number(info.year)); + entry->setField(TQString::tqfromLatin1("year"), TQString::number(info.year)); } - entry->setField(TQString::fromLatin1("keyword"), info.category); + entry->setField(TQString::tqfromLatin1("keyword"), info.category); TQString extd = info.extd; - extd.replace('\n', TQString::fromLatin1("<br/>")); - entry->setField(TQString::fromLatin1("comments"), extd); + extd.replace('\n', TQString::tqfromLatin1("<br/>")); + entry->setField(TQString::tqfromLatin1("comments"), extd); // step through trackList TQStringList trackList; KCDDB::TrackInfoList t = info.trackInfoList; for(uint i = 0; i < t.count(); ++i) { #if KDE_IS_VERSION(3,4,90) - trackList << t[i].get(TQString::fromLatin1("title")).toString(); + trackList << t[i].get(TQString::tqfromLatin1("title")).toString(); #else trackList << t[i].title; #endif } - entry->setField(track, trackList.join(TQString::fromLatin1("; "))); + entry->setField(track, trackList.join(TQString::tqfromLatin1("; "))); #if 0 // add CDDB info - const TQString br = TQString::fromLatin1("<br/>"); + const TQString br = TQString::tqfromLatin1("<br/>"); TQString comment; if(!info.extd.isEmpty()) { comment.append(info.extd + br); } if(!info.id.isEmpty()) { - comment.append(TQString::fromLatin1("CDDB-ID: ") + info.id + br); + comment.append(TQString::tqfromLatin1("CDDB-ID: ") + info.id + br); } if(info.length > 0) { comment.append("Length: " + TQString::number(info.length) + br); @@ -427,8 +427,8 @@ void FreeDBImporter::readCache() { } #define SETFIELD(name,value) \ - if(entry->field(TQString::fromLatin1(name)).isEmpty()) { \ - entry->setField(TQString::fromLatin1(name), value); \ + if(entry->field(TQString::tqfromLatin1(name)).isEmpty()) { \ + entry->setField(TQString::tqfromLatin1(name), value); \ } void FreeDBImporter::readCDText(const TQCString& drive_) { @@ -443,7 +443,7 @@ void FreeDBImporter::readCDText(const TQCString& drive_) { } if(!entry) { entry = new Data::Entry(m_coll); - entry->setField(TQString::fromLatin1("medium"), i18n("Compact Disc")); + entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc")); m_coll->addEntries(entry); } @@ -470,7 +470,7 @@ void FreeDBImporter::readCDText(const TQCString& drive_) { artist = i18n("Various"); } } - SETFIELD("track", tracks.join(TQString::fromLatin1("; "))); + SETFIELD("track", tracks.join(TQString::tqfromLatin1("; "))); // something special for compilations and such SETFIELD("title", i18n(Data::Collection::s_emptyGroupTitle)); @@ -515,14 +515,14 @@ TQWidget* FreeDBImporter::widget(TQWidget* parent_, const char* name_/*=0*/) { l->addStretch(1); // now read config options - KConfigGroup config(KGlobal::config(), TQString::fromLatin1("ImportOptions - FreeDB")); + KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB")); TQStringList devices = config.readListEntry("CD-ROM Devices"); if(devices.isEmpty()) { #if defined(__OpenBSD__) - devices += TQString::fromLatin1("/dev/rcd0c"); + devices += TQString::tqfromLatin1("/dev/rcd0c"); #endif - devices += TQString::fromLatin1("/dev/cdrom"); - devices += TQString::fromLatin1("/dev/dvd"); + devices += TQString::tqfromLatin1("/dev/cdrom"); + devices += TQString::tqfromLatin1("/dev/dvd"); } m_driveCombo->insertStringList(devices); TQString device = config.readEntry("Last Device"); diff --git a/src/translators/gcfilmsexporter.cpp b/src/translators/gcfilmsexporter.cpp index 91a4d8e..279a3ab 100644 --- a/src/translators/gcfilmsexporter.cpp +++ b/src/translators/gcfilmsexporter.cpp @@ -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(TQString::fromLatin1("url")) - && coll->fieldByName(TQString::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(TQString::fromLatin1("rating")); + Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("rating")); if(f) { bool ok; - uint n = Tellico::toUInt(f->property(TQString::fromLatin1("minimum")), &ok); + uint n = Tellico::toUInt(f->property(TQString::tqfromLatin1("minimum")), &ok); if(ok) { minRating = n; } - n = Tellico::toUInt(f->property(TQString::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(TQString::fromLatin1("..")); - imageDir.addPath(url().fileName().section('.', 0, 0) + TQString::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) { @@ -103,7 +103,7 @@ bool GCfilmsExporter::exec() { push(ts, "nationality", entry, format); push(ts, "genre", entry, format); // do image - TQString tmp = entry->field(TQString::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 TQStringList cast = entry->fields(TQString::fromLatin1("cast"), false); + const TQStringList cast = entry->fields(TQString::tqfromLatin1("cast"), false); for(TQStringList::ConstIterator it = cast.begin(); it != cast.end(); ++it) { - ts << (*it).section(TQString::fromLatin1("::"), 0, 0); + 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(TQString::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(TQString::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(TQString::fromLatin1("certification"), format); + tmp = entry->field(TQString::tqfromLatin1("certification"), format); int age = 0; if(tmp == Latin1Literal("U (USA)")) { age = 1; @@ -218,14 +218,14 @@ bool GCfilmsExporter::exec() { } void GCfilmsExporter::push(TQTextOStream& ts_, TQCString fieldName_, Data::EntryVec::ConstIterator entry_, bool format_) { - Data::FieldPtr f = collection()->fieldByName(TQString::fromLatin1(fieldName_)); + 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; } - TQString s = entry_->field(TQString::fromLatin1(fieldName_), format_); + TQString s = entry_->field(TQString::tqfromLatin1(fieldName_), format_); if(f->flags() & Data::Field::AllowMultiple) { - ts_ << s.replace(TQString::fromLatin1("; "), TQChar(',')); + ts_ << s.replace(TQString::tqfromLatin1("; "), TQChar(',')); } else { ts_ << s; } 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() { diff --git a/src/translators/griffithimporter.cpp b/src/translators/griffithimporter.cpp index ea4da5e..953a159 100644 --- a/src/translators/griffithimporter.cpp +++ b/src/translators/griffithimporter.cpp @@ -34,19 +34,19 @@ GriffithImporter::~GriffithImporter() { } Tellico::Data::CollPtr GriffithImporter::collection() { - TQString filename = TQDir::homeDirPath() + TQString::fromLatin1("/.griffith/griffith.db"); + TQString filename = TQDir::homeDirPath() + TQString::tqfromLatin1("/.griffith/griffith.db"); if(!TQFile::exists(filename)) { myWarning() << "GriffithImporter::collection() - database not found: " << filename << endl; return 0; } - TQString python = KStandardDirs::findExe(TQString::fromLatin1("python")); + TQString python = KStandardDirs::findExe(TQString::tqfromLatin1("python")); if(python.isEmpty()) { myWarning() << "GriffithImporter::collection() - python not found!" << endl; return 0; } - TQString griffith = KGlobal::dirs()->findResource("appdata", TQString::fromLatin1("griffith2tellico.py")); + TQString griffith = KGlobal::dirs()->findResource("appdata", TQString::tqfromLatin1("griffith2tellico.py")); if(griffith.isEmpty()) { myWarning() << "GriffithImporter::collection() - griffith2tellico.py not found!" << endl; return 0; diff --git a/src/translators/grs1importer.cpp b/src/translators/grs1importer.cpp index f987720..30c9a69 100644 --- a/src/translators/grs1importer.cpp +++ b/src/translators/grs1importer.cpp @@ -26,20 +26,20 @@ void GRS1Importer::initTagMap() { if(!s_tagMap) { s_tagMap = new TagMap(); // BT is special and is handled separately - s_tagMap->insert(TagPair(2, 1), TQString::fromLatin1("title")); - s_tagMap->insert(TagPair(2, 2), TQString::fromLatin1("author")); - s_tagMap->insert(TagPair(2, 4), TQString::fromLatin1("year")); - s_tagMap->insert(TagPair(2, 7), TQString::fromLatin1("publisher")); - s_tagMap->insert(TagPair(2, 31), TQString::fromLatin1("publisher")); - s_tagMap->insert(TagPair(2, 20), TQString::fromLatin1("language")); - s_tagMap->insert(TagPair(2, 21), TQString::fromLatin1("keyword")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("isbn/issn")), TQString::fromLatin1("isbn")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("isbn")), TQString::fromLatin1("isbn")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("notes")), TQString::fromLatin1("note")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("note")), TQString::fromLatin1("note")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("series")), TQString::fromLatin1("series")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("physical description")), TQString::fromLatin1("note")); - s_tagMap->insert(TagPair(3, TQString::fromLatin1("subtitle")), TQString::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")); } } @@ -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(TQString::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(TQString::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,10 +68,10 @@ Tellico::Data::CollPtr GRS1Importer::collection() { bool empty = true; // in format "(tag, tag) value" - TQRegExp rx(TQString::fromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*")); + TQRegExp rx(TQString::tqfromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*")); // rx.setMinimal(true); - TQRegExp dateRx(TQString::fromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors - TQRegExp pubRx(TQString::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; @@ -109,14 +109,14 @@ Tellico::Data::CollPtr GRS1Importer::collection() { } else if(field == Latin1Literal("publisher")) { int pos = val.find(pubRx); if(pos > -1) { - e->setField(TQString::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 += TQString::fromLatin1("; "); + tmp += TQString::tqfromLatin1("; "); } e->setField(field, tmp + val); } diff --git a/src/translators/htmlexporter.cpp b/src/translators/htmlexporter.cpp index 31701d4..333ebfd 100644 --- a/src/translators/htmlexporter.cpp +++ b/src/translators/htmlexporter.cpp @@ -34,7 +34,7 @@ #include <tqdom.h> #include <tqgroupbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqcheckbox.h> #include <tqwhatsthis.h> #include <tqfile.h> @@ -59,7 +59,7 @@ HTMLExporter::HTMLExporter() : Tellico::Export::Exporter(), m_imageWidth(0), m_imageHeight(0), m_widget(0), - m_xsltFile(TQString::fromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) { } HTMLExporter::HTMLExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll_), @@ -73,7 +73,7 @@ HTMLExporter::HTMLExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll m_imageWidth(0), m_imageHeight(0), m_widget(0), - m_xsltFile(TQString::fromLatin1("tellico2html.xsl")) { + m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) { } HTMLExporter::~HTMLExporter() { @@ -201,7 +201,7 @@ bool HTMLExporter::loadXSLTFile() { } if(!m_collectionURL.isEmpty()) { - TQString s = TQString::fromLatin1("../") + m_collectionURL.fileName(); + TQString s = TQString::tqfromLatin1("../") + m_collectionURL.fileName(); m_handler->addStringParam("collection-file", s.utf8()); } @@ -209,7 +209,7 @@ bool HTMLExporter::loadXSLTFile() { // if parseDOM, that means we want the locations to be the actual location // otherwise, we assume it'll be relative if(m_parseDOM && m_dataDir.isEmpty()) { - m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")); + m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")); } else if(!m_parseDOM) { m_dataDir.truncate(0); } @@ -250,7 +250,7 @@ TQString HTMLExporter::text() { exporter.setOptions(options() | Export::ExportUTF8 | Export::ExportImages); TQDomDocument output = exporter.exportXML(); #if 0 - TQFile f(TQString::fromLatin1("/tmp/test.xml")); + TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t << output.toString(); @@ -260,7 +260,7 @@ TQString HTMLExporter::text() { TQString text = m_handler->applyStylesheet(output.toString()); #if 0 - TQFile f2(TQString::fromLatin1("/tmp/test.html")); + TQFile f2(TQString::tqfromLatin1("/tmp/test.html")); if(f2.open(IO_WriteOnly)) { TQTextStream t(&f2); t << text; @@ -279,7 +279,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { if(file != i18n("Untitled")) { m_handler->addStringParam("filename", TQFile::encodeName(file)); } - m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(TQDate::currentDate()).utf8()); + m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(TQDate::tqcurrentDate()).utf8()); m_handler->addParam("show-headers", m_printHeaders ? "true()" : "false()"); m_handler->addParam("group-entries", m_printGrouped ? "true()" : "false()"); @@ -317,7 +317,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { } else { s = coll->fieldTitleByName(m_groupBy[0]); } - sortString = i18n("(grouped by %1)").arg(s); + sortString = i18n("(grouped by %1)").tqarg(s); TQString groupFields; for(TQStringList::ConstIterator it = m_groupBy.begin(); it != m_groupBy.end(); ++it) { @@ -326,20 +326,20 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) { continue; } if(f->flags() & Data::Field::AllowMultiple) { - groupFields += TQString::fromLatin1("tc:") + *it + TQString::fromLatin1("s/tc:") + *it; + groupFields += TQString::tqfromLatin1("tc:") + *it + TQString::tqfromLatin1("s/tc:") + *it; } else { - groupFields += TQString::fromLatin1("tc:") + *it; + groupFields += TQString::tqfromLatin1("tc:") + *it; } int ncols = 0; if(f->type() == Data::Field::Table) { bool ok; - ncols = Tellico::toUInt(f->property(TQString::fromLatin1("columns")), &ok); + ncols = Tellico::toUInt(f->property(TQString::tqfromLatin1("columns")), &ok); if(!ok) { ncols = 1; } } if(ncols > 1) { - groupFields += TQString::fromLatin1("/tc:column[1]"); + groupFields += TQString::tqfromLatin1("/tc:column[1]"); } if(*it != m_groupBy.last()) { groupFields += '|'; @@ -484,19 +484,19 @@ TQWidget* HTMLExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void HTMLExporter::readOptions(KConfig* config_) { - KConfigGroup exportConfig(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup exportConfig(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_printHeaders = exportConfig.readBoolEntry("Print Field Headers", m_printHeaders); m_printGrouped = exportConfig.readBoolEntry("Print Grouped", m_printGrouped); m_exportEntryFiles = exportConfig.readBoolEntry("Export Entry Files", m_exportEntryFiles); // read current entry export template m_entryXSLTFile = Config::templateName(collection()->type()); - m_entryXSLTFile = locate("appdata", TQString::fromLatin1("entry-templates/") - + m_entryXSLTFile + TQString::fromLatin1(".xsl")); + m_entryXSLTFile = locate("appdata", TQString::tqfromLatin1("entry-templates/") + + m_entryXSLTFile + TQString::tqfromLatin1(".xsl")); } void HTMLExporter::saveOptions(KConfig* config_) { - KConfigGroup cfg(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup cfg(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_printHeaders = m_checkPrintHeaders->isChecked(); cfg.writeEntry("Print Field Headers", m_printHeaders); m_printGrouped = m_checkPrintGrouped->isChecked(); @@ -521,16 +521,16 @@ KURL HTMLExporter::fileDir() const { } KURL fileDir = url(); // cd to directory of target URL - fileDir.cd(TQString::fromLatin1("..")); + fileDir.cd(TQString::tqfromLatin1("..")); fileDir.addPath(fileDirName()); return fileDir; } TQString HTMLExporter::fileDirName() const { if(!m_collectionURL.isEmpty()) { - return TQString::fromLatin1("/"); + return TQString::tqfromLatin1("/"); } - return url().fileName().section('.', 0, 0) + TQString::fromLatin1("_files/"); + return url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/"); } // how ugly is this? @@ -569,10 +569,10 @@ TQString HTMLExporter::handleLink(const TQString& link_) { // if we're exporting entry files, we want pics/ to // go in pics/ - const bool isPic = link_.startsWith(m_dataDir + TQString::fromLatin1("pics/")); + const bool isPic = link_.startsWith(m_dataDir + TQString::tqfromLatin1("pics/")); TQString midDir; if(m_exportEntryFiles && isPic) { - midDir = TQString::fromLatin1("pics/"); + midDir = TQString::tqfromLatin1("pics/"); } // pictures are special since they might not exist when the HTML is exported, since they might get copied later // on the other hand, don't change the file location if it doesn't exist @@ -592,7 +592,7 @@ TQString HTMLExporter::analyzeInternalCSS(const TQString& str_) { TQString str = str_; int start = 0; int end = 0; - const TQString url = TQString::fromLatin1("url("); + const TQString url = TQString::tqfromLatin1("url("); for(int pos = str.find(url); pos >= 0; pos = str.find(url, pos+1)) { pos += 4; // url( if(str[pos] == '"' || str[pos] == '\'') { @@ -678,7 +678,7 @@ bool HTMLExporter::writeEntryFiles() { // I can't reliable encode a string as a URI, so I'm punting, and I'll just replace everything but // a-zA-Z0-9 with an underscore. This MUST match the filename template in tellico2html.xsl // the id is used so uniqueness is guaranteed - const TQRegExp badChars(TQString::fromLatin1("[^-a-zA-Z0-9]")); + const TQRegExp badChars(TQString::tqfromLatin1("[^-a-zA-Z0-9]")); bool formatted = options() & Export::ExportFormatted; KURL outputFile = fileDir(); @@ -693,8 +693,8 @@ bool HTMLExporter::writeEntryFiles() { exporter.setCollectionURL(url()); bool parseDOM = true; - const TQString title = TQString::fromLatin1("title"); - const TQString html = TQString::fromLatin1(".html"); + const TQString title = TQString::tqfromLatin1("title"); + const TQString html = TQString::tqfromLatin1(".html"); bool multipleTitles = collection()->fieldByName(title)->flags() & Data::Field::AllowMultiple; Data::EntryVec entries = this->entries(); // not const since the pointer has to be copied for(Data::EntryVecIt entryIt = entries.begin(); entryIt != entries.end() && !m_cancelled; ++entryIt, ++j) { @@ -733,14 +733,14 @@ bool HTMLExporter::writeEntryFiles() { // the images in "pics/" are special data images, copy them always // since the entry files may refer to them, but we don't know that TQStringList dataImages; - dataImages << TQString::fromLatin1("checkmark.png"); + dataImages << TQString::tqfromLatin1("checkmark.png"); for(uint i = 1; i <= 10; ++i) { - dataImages << TQString::fromLatin1("stars%1.png").arg(i); + dataImages << TQString::tqfromLatin1("stars%1.png").tqarg(i); } KURL dataDir; - dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::fromLatin1("pics/tellico.png")) + "pics/"); + dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")) + "pics/"); KURL target = fileDir(); - target.addPath(TQString::fromLatin1("pics/")); + target.addPath(TQString::tqfromLatin1("pics/")); KIO::NetAccess::mkdir(target, m_widget); for(TQStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) { dataDir.setFileName(*it); diff --git a/src/translators/importer.h b/src/translators/importer.h index 08fe3f1..d10e027 100644 --- a/src/translators/importer.h +++ b/src/translators/importer.h @@ -98,7 +98,7 @@ public: * Returns a string useful for the ProgressManager */ TQString progressLabel() const { - if(url().isEmpty()) return i18n("Loading data..."); else return i18n("Loading %1...").arg(url().fileName()); + if(url().isEmpty()) return i18n("Loading data..."); else return i18n("Loading %1...").tqarg(url().fileName()); } public slots: diff --git a/src/translators/onixexporter.cpp b/src/translators/onixexporter.cpp index bca59fd..65b85ee 100644 --- a/src/translators/onixexporter.cpp +++ b/src/translators/onixexporter.cpp @@ -33,7 +33,7 @@ #include <tqfile.h> #include <tqdatetime.h> #include <tqbuffer.h> -#include <layout.h> +#include <tqlayout.h> #include <tqwhatsthis.h> #include <tqcheckbox.h> #include <tqgroupbox.h> @@ -42,14 +42,14 @@ using Tellico::Export::ONIXExporter; ONIXExporter::ONIXExporter() : Tellico::Export::Exporter(), m_handler(0), - m_xsltFile(TQString::fromLatin1("tellico2onix.xsl")), + m_xsltFile(TQString::tqfromLatin1("tellico2onix.xsl")), m_includeImages(true), m_widget(0) { } ONIXExporter::ONIXExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll_), m_handler(0), - m_xsltFile(TQString::fromLatin1("tellico2onix.xsl")), + m_xsltFile(TQString::tqfromLatin1("tellico2onix.xsl")), m_includeImages(true), m_widget(0) { } @@ -80,18 +80,18 @@ bool ONIXExporter::exec() { KZip zip(TQT_TQIODEVICE(&buf)); zip.open(IO_WriteOnly); - zip.writeFile(TQString::fromLatin1("onix.xml"), TQString(), TQString(), xml.length(), xml); + zip.writeFile(TQString::tqfromLatin1("onix.xml"), TQString(), TQString(), xml.length(), xml); // use a dict for fast random access to keep track of which images were written to the file if(m_includeImages) { // for now, we're ignoring (options() & Export::ExportImages) - const TQString cover = TQString::fromLatin1("cover"); + const TQString cover = TQString::tqfromLatin1("cover"); StringSet imageSet; for(Data::EntryVec::ConstIterator it = entries().begin(); it != entries().end(); ++it) { const Data::Image& img = ImageFactory::imageById(it->field(cover)); if(!img.isNull() && !imageSet.has(img.id()) && (img.format() == "JPEG" || img.format() == "JPG" || img.format() == "GIF")) { /// onix only understands jpeg and gif TQByteArray ba = img.byteArray(); - zip.writeFile(TQString::fromLatin1("images/") + it->field(cover), + zip.writeFile(TQString::tqfromLatin1("images/") + it->field(cover), TQString(), TQString(), ba.size(), ba); imageSet.add(img.id()); } @@ -140,8 +140,8 @@ TQString ONIXExporter::text() { delete m_handler; m_handler = new XSLTHandler(dom, TQFile::encodeName(xsltfile)); - TQDateTime now = TQDateTime::currentDateTime(); - m_handler->addStringParam("sentDate", now.toString(TQString::fromLatin1("yyyyMMddhhmm")).utf8()); + TQDateTime now = TQDateTime::tqcurrentDateTime(); + m_handler->addStringParam("sentDate", now.toString(TQString::tqfromLatin1("yyyyMMddhhmm")).utf8()); m_handler->addStringParam("version", VERSION); @@ -155,7 +155,7 @@ TQString ONIXExporter::text() { exporter.setOptions(options() | Export::ExportUTF8); TQDomDocument output = exporter.exportXML(); #if 0 - TQFile f(TQString::fromLatin1("/tmp/test.xml")); + TQFile f(TQString::tqfromLatin1("/tmp/test.xml")); if(f.open(IO_WriteOnly)) { TQTextStream t(&f); t << output.toString(); @@ -185,14 +185,14 @@ TQWidget* ONIXExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void ONIXExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_includeImages = group.readBoolEntry("Include Images", m_includeImages); } void ONIXExporter::saveOptions(KConfig* config_) { m_includeImages = m_checkIncludeImages->isChecked(); - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); group.writeEntry("Include Images", m_includeImages); } diff --git a/src/translators/pdfimporter.cpp b/src/translators/pdfimporter.cpp index a258995..09df294 100644 --- a/src/translators/pdfimporter.cpp +++ b/src/translators/pdfimporter.cpp @@ -48,7 +48,7 @@ bool PDFImporter::canImport(int type_) const { } Tellico::Data::CollPtr PDFImporter::collection() { - TQString xsltfile = ::locate("appdata", TQString::fromLatin1("xmp2tellico.xsl")); + TQString xsltfile = ::locate("appdata", TQString::tqfromLatin1("xmp2tellico.xsl")); if(xsltfile.isEmpty()) { kdWarning() << "DropHandler::handleURL() - can not locate xmp2tellico.xsl" << endl; return 0; @@ -100,7 +100,7 @@ Tellico::Data::CollPtr PDFImporter::collection() { setStatusMessage(i18n("Tellico was unable to read any metadata from the PDF file.")); } else { entry = newColl->entries().front(); - hasDOI |= !entry->field(TQString::fromLatin1("doi")).isEmpty(); + hasDOI |= !entry->field(TQString::tqfromLatin1("doi")).isEmpty(); } } @@ -119,21 +119,21 @@ Tellico::Data::CollPtr PDFImporter::collection() { if(doc && !doc->isLocked()) { // now the question is, do we overwrite XMP data with Poppler data? // for now, let's say yes conditionally - TQString s = doc->getInfo(TQString::fromLatin1("Title")).simplifyWhiteSpace(); + TQString s = doc->getInfo(TQString::tqfromLatin1("Title")).simplifyWhiteSpace(); if(!s.isEmpty()) { - entry->setField(TQString::fromLatin1("title"), s); + entry->setField(TQString::tqfromLatin1("title"), s); } // author could be separated by commas, "and" or whatever // we're not going to overwrite it - if(entry->field(TQString::fromLatin1("author")).isEmpty()) { - TQRegExp rx(TQString::fromLatin1("\\s*(and|,|;)\\s*")); - TQStringList authors = TQStringList::split(rx, doc->getInfo(TQString::fromLatin1("Author")).simplifyWhiteSpace()); - entry->setField(TQString::fromLatin1("author"), authors.join(TQString::fromLatin1("; "))); + if(entry->field(TQString::tqfromLatin1("author")).isEmpty()) { + TQRegExp rx(TQString::tqfromLatin1("\\s*(and|,|;)\\s*")); + TQStringList authors = TQStringList::split(rx, doc->getInfo(TQString::tqfromLatin1("Author")).simplifyWhiteSpace()); + entry->setField(TQString::tqfromLatin1("author"), authors.join(TQString::tqfromLatin1("; "))); } - s = doc->getInfo(TQString::fromLatin1("Keywords")).simplifyWhiteSpace(); + s = doc->getInfo(TQString::tqfromLatin1("Keywords")).simplifyWhiteSpace(); if(!s.isEmpty()) { // keywords are also separated by semi-colons in poppler - entry->setField(TQString::fromLatin1("keyword"), s); + entry->setField(TQString::tqfromLatin1("keyword"), s); } // now parse the first page text and try to guess @@ -142,7 +142,7 @@ Tellico::Data::CollPtr PDFImporter::collection() { // a null rectangle means get all text on page TQString text = page->getText(Poppler::Rectangle()); // borrowed from Referencer - TQRegExp rx(TQString::fromLatin1("(?:" + TQRegExp rx(TQString::tqfromLatin1("(?:" "(?:[Dd][Oo][Ii]:? *)" "|" "(?:[Dd]igital *[Oo]bject *[Ii]dentifier:? *)" @@ -157,10 +157,10 @@ Tellico::Data::CollPtr PDFImporter::collection() { if(rx.search(text) > -1) { TQString doi = rx.cap(1); myDebug() << "PDFImporter::collection() - in PDF file, found DOI: " << doi << endl; - entry->setField(TQString::fromLatin1("doi"), doi); + entry->setField(TQString::tqfromLatin1("doi"), doi); hasDOI = true; } - rx = TQRegExp(TQString::fromLatin1("arXiv:" + rx = TQRegExp(TQString::tqfromLatin1("arXiv:" "(" "[^\\/\\s]+" "[\\/\\.]" @@ -169,12 +169,12 @@ Tellico::Data::CollPtr PDFImporter::collection() { if(rx.search(text) > -1) { TQString arxiv = rx.cap(1); myDebug() << "PDFImporter::collection() - in PDF file, found arxiv: " << arxiv << endl; - if(entry->collection()->fieldByName(TQString::fromLatin1("arxiv")) == 0) { - Data::FieldPtr field = new Data::Field(TQString::fromLatin1("arxiv"), i18n("arXiv ID")); + if(entry->collection()->fieldByName(TQString::tqfromLatin1("arxiv")) == 0) { + Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("arxiv"), i18n("arXiv ID")); field->setCategory(i18n("Publishing")); entry->collection()->addField(field); } - entry->setField(TQString::fromLatin1("arxiv"), arxiv); + entry->setField(TQString::tqfromLatin1("arxiv"), arxiv); hasArxiv = true; } @@ -186,22 +186,22 @@ Tellico::Data::CollPtr PDFImporter::collection() { delete doc; #endif - entry->setField(TQString::fromLatin1("url"), (*it).url()); + entry->setField(TQString::tqfromLatin1("url"), (*it).url()); // always an article? - entry->setField(TQString::fromLatin1("entry-type"), TQString::fromLatin1("article")); + entry->setField(TQString::tqfromLatin1("entry-type"), TQString::tqfromLatin1("article")); TQPixmap pix = NetAccess::filePreview(ref->fileName(), PDF_FILE_PREVIEW_SIZE); delete ref; // removes temp file if(!pix.isNull()) { // is png best option? - TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG")); + TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG")); if(!id.isEmpty()) { - Data::FieldPtr field = newColl->fieldByName(TQString::fromLatin1("cover")); + Data::FieldPtr field = newColl->fieldByName(TQString::tqfromLatin1("cover")); if(!field && !newColl->imageFields().isEmpty()) { field = newColl->imageFields().front(); } else if(!field) { - field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); + field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); newColl->addField(field); } entry->setField(field, id); @@ -233,7 +233,7 @@ Tellico::Data::CollPtr PDFImporter::collection() { "CrossRef.org. However, you must create an CrossRef account and add a new " "data source with your account information."), TQString(), - TQString::fromLatin1("CrossRefSourceNeeded")); + TQString::tqfromLatin1("CrossRefSourceNeeded")); } else { Data::EntryVec entries = coll->entries(); for(Fetch::FetcherVec::Iterator fetcher = vec.begin(); fetcher != vec.end(); ++fetcher) { @@ -263,8 +263,8 @@ Tellico::Data::CollPtr PDFImporter::collection() { for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) { if(entry->title().isEmpty()) { // use file name - KURL u = entry->field(TQString::fromLatin1("url")); - entry->setField(TQString::fromLatin1("title"), u.fileName()); + KURL u = entry->field(TQString::tqfromLatin1("url")); + entry->setField(TQString::tqfromLatin1("title"), u.fileName()); } } diff --git a/src/translators/pilotdbexporter.cpp b/src/translators/pilotdbexporter.cpp index 1b3a89a..a4f2e72 100644 --- a/src/translators/pilotdbexporter.cpp +++ b/src/translators/pilotdbexporter.cpp @@ -24,11 +24,11 @@ #include <kglobal.h> #include <kcharsets.h> -#include <layout.h> +#include <tqlayout.h> #include <tqgroupbox.h> #include <tqcheckbox.h> #include <tqwhatsthis.h> -#include <textcodec.h> +#include <tqtextcodec.h> #include <tqdatetime.h> using Tellico::Export::PilotDBExporter; @@ -58,7 +58,7 @@ bool PilotDBExporter::exec() { TQTextCodec* codec = 0; { // Latin1 is default - KConfigGroup group(KGlobal::config(), TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(KGlobal::config(), TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); codec = KGlobal::charsets()->codecForName(group.readEntry("Charset")); } if(!codec) { @@ -153,8 +153,8 @@ bool PilotDBExporter::exec() { Data::FieldVec::ConstIterator fIt, end = outputFields.constEnd(); bool format = options() & Export::ExportFormatted; - TQRegExp br(TQString::fromLatin1("<br/?>"), false /*case-sensitive*/); - TQRegExp tags(TQString::fromLatin1("<.*>")); + TQRegExp br(TQString::tqfromLatin1("<br/?>"), false /*case-sensitive*/); + TQRegExp tags(TQString::tqfromLatin1("<.*>")); tags.setMinimal(true); TQString value; @@ -167,9 +167,9 @@ bool PilotDBExporter::exec() { if(fIt->type() == Data::Field::Date) { TQStringList s = TQStringList::split('-', value, true); bool ok = true; - int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::currentDate().year(); + int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::tqcurrentDate().year(); if(!ok) { - y = TQDate::currentDate().year(); + y = TQDate::tqcurrentDate().year(); } int m = s.count() > 1 ? s[1].toInt(&ok) : 1; if(!ok) { @@ -180,7 +180,7 @@ bool PilotDBExporter::exec() { d = 1; } TQDate date(y, m, d); - value = date.toString(TQString::fromLatin1("yyyy/MM/dd")); + value = date.toString(TQString::tqfromLatin1("yyyy/MM/dd")); } else if(fIt->type() == Data::Field::Para) { value.replace(br, TQChar('\n')); value.replace(tags, TQString()); @@ -219,12 +219,12 @@ TQWidget* PilotDBExporter::widget(TQWidget* parent_, const char* name_/*=0*/) { } void PilotDBExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_backup = group.readBoolEntry("Backup", m_backup); } void PilotDBExporter::saveOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_backup = m_checkBackup->isChecked(); group.writeEntry("Backup", m_backup); } diff --git a/src/translators/referencerimporter.cpp b/src/translators/referencerimporter.cpp index e3cb72c..332bf8c 100644 --- a/src/translators/referencerimporter.cpp +++ b/src/translators/referencerimporter.cpp @@ -21,7 +21,7 @@ using Tellico::Import::ReferencerImporter; ReferencerImporter::ReferencerImporter(const KURL& url_) : XSLTImporter(url_) { - TQString xsltFile = locate("appdata", TQString::fromLatin1("referencer2tellico.xsl")); + TQString xsltFile = locate("appdata", TQString::tqfromLatin1("referencer2tellico.xsl")); if(!xsltFile.isEmpty()) { KURL u; u.setPath(xsltFile); @@ -41,17 +41,17 @@ Tellico::Data::CollPtr ReferencerImporter::collection() { return 0; } - Data::FieldPtr field = coll->fieldByName(TQString::fromLatin1("cover")); + Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover")); if(!field && !coll->imageFields().isEmpty()) { field = coll->imageFields().front(); } else if(!field) { - field = new Data::Field(TQString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); + field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image); coll->addField(field); } Data::EntryVec entries = coll->entries(); for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) { - TQString url = entry->field(TQString::fromLatin1("url")); + TQString url = entry->field(TQString::tqfromLatin1("url")); if(url.isEmpty()) { continue; } @@ -59,7 +59,7 @@ Tellico::Data::CollPtr ReferencerImporter::collection() { if(pix.isNull()) { continue; } - TQString id = ImageFactory::addImage(pix, TQString::fromLatin1("PNG")); + TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG")); if(id.isEmpty()) { continue; } diff --git a/src/translators/risimporter.cpp b/src/translators/risimporter.cpp index 087397e..bcf4db5 100644 --- a/src/translators/risimporter.cpp +++ b/src/translators/risimporter.cpp @@ -37,33 +37,33 @@ void RISImporter::initTagMap() { if(!s_tagMap) { s_tagMap = new TQMap<TQString, TQString>(); // BT is special and is handled separately - s_tagMap->insert(TQString::fromLatin1("TY"), TQString::fromLatin1("entry-type")); - s_tagMap->insert(TQString::fromLatin1("ID"), TQString::fromLatin1("bibtex-key")); - s_tagMap->insert(TQString::fromLatin1("T1"), TQString::fromLatin1("title")); - s_tagMap->insert(TQString::fromLatin1("TI"), TQString::fromLatin1("title")); - s_tagMap->insert(TQString::fromLatin1("T2"), TQString::fromLatin1("booktitle")); - s_tagMap->insert(TQString::fromLatin1("A1"), TQString::fromLatin1("author")); - s_tagMap->insert(TQString::fromLatin1("AU"), TQString::fromLatin1("author")); - s_tagMap->insert(TQString::fromLatin1("ED"), TQString::fromLatin1("editor")); - s_tagMap->insert(TQString::fromLatin1("YR"), TQString::fromLatin1("year")); - s_tagMap->insert(TQString::fromLatin1("PY"), TQString::fromLatin1("year")); - s_tagMap->insert(TQString::fromLatin1("N1"), TQString::fromLatin1("note")); - s_tagMap->insert(TQString::fromLatin1("AB"), TQString::fromLatin1("abstract")); // should be note? - s_tagMap->insert(TQString::fromLatin1("N2"), TQString::fromLatin1("abstract")); - s_tagMap->insert(TQString::fromLatin1("KW"), TQString::fromLatin1("keyword")); - s_tagMap->insert(TQString::fromLatin1("JF"), TQString::fromLatin1("journal")); - s_tagMap->insert(TQString::fromLatin1("JO"), TQString::fromLatin1("journal")); - s_tagMap->insert(TQString::fromLatin1("JA"), TQString::fromLatin1("journal")); - s_tagMap->insert(TQString::fromLatin1("VL"), TQString::fromLatin1("volume")); - s_tagMap->insert(TQString::fromLatin1("IS"), TQString::fromLatin1("number")); - s_tagMap->insert(TQString::fromLatin1("PB"), TQString::fromLatin1("publisher")); - s_tagMap->insert(TQString::fromLatin1("SN"), TQString::fromLatin1("isbn")); - s_tagMap->insert(TQString::fromLatin1("AD"), TQString::fromLatin1("address")); - s_tagMap->insert(TQString::fromLatin1("CY"), TQString::fromLatin1("address")); - s_tagMap->insert(TQString::fromLatin1("UR"), TQString::fromLatin1("url")); - s_tagMap->insert(TQString::fromLatin1("L1"), TQString::fromLatin1("pdf")); - s_tagMap->insert(TQString::fromLatin1("T3"), TQString::fromLatin1("series")); - s_tagMap->insert(TQString::fromLatin1("EP"), TQString::fromLatin1("pages")); + s_tagMap->insert(TQString::tqfromLatin1("TY"), TQString::tqfromLatin1("entry-type")); + s_tagMap->insert(TQString::tqfromLatin1("ID"), TQString::tqfromLatin1("bibtex-key")); + s_tagMap->insert(TQString::tqfromLatin1("T1"), TQString::tqfromLatin1("title")); + s_tagMap->insert(TQString::tqfromLatin1("TI"), TQString::tqfromLatin1("title")); + s_tagMap->insert(TQString::tqfromLatin1("T2"), TQString::tqfromLatin1("booktitle")); + s_tagMap->insert(TQString::tqfromLatin1("A1"), TQString::tqfromLatin1("author")); + s_tagMap->insert(TQString::tqfromLatin1("AU"), TQString::tqfromLatin1("author")); + s_tagMap->insert(TQString::tqfromLatin1("ED"), TQString::tqfromLatin1("editor")); + s_tagMap->insert(TQString::tqfromLatin1("YR"), TQString::tqfromLatin1("year")); + s_tagMap->insert(TQString::tqfromLatin1("PY"), TQString::tqfromLatin1("year")); + s_tagMap->insert(TQString::tqfromLatin1("N1"), TQString::tqfromLatin1("note")); + s_tagMap->insert(TQString::tqfromLatin1("AB"), TQString::tqfromLatin1("abstract")); // should be note? + s_tagMap->insert(TQString::tqfromLatin1("N2"), TQString::tqfromLatin1("abstract")); + s_tagMap->insert(TQString::tqfromLatin1("KW"), TQString::tqfromLatin1("keyword")); + s_tagMap->insert(TQString::tqfromLatin1("JF"), TQString::tqfromLatin1("journal")); + s_tagMap->insert(TQString::tqfromLatin1("JO"), TQString::tqfromLatin1("journal")); + s_tagMap->insert(TQString::tqfromLatin1("JA"), TQString::tqfromLatin1("journal")); + s_tagMap->insert(TQString::tqfromLatin1("VL"), TQString::tqfromLatin1("volume")); + s_tagMap->insert(TQString::tqfromLatin1("IS"), TQString::tqfromLatin1("number")); + s_tagMap->insert(TQString::tqfromLatin1("PB"), TQString::tqfromLatin1("publisher")); + s_tagMap->insert(TQString::tqfromLatin1("SN"), TQString::tqfromLatin1("isbn")); + s_tagMap->insert(TQString::tqfromLatin1("AD"), TQString::tqfromLatin1("address")); + s_tagMap->insert(TQString::tqfromLatin1("CY"), TQString::tqfromLatin1("address")); + s_tagMap->insert(TQString::tqfromLatin1("UR"), TQString::tqfromLatin1("url")); + s_tagMap->insert(TQString::tqfromLatin1("L1"), TQString::tqfromLatin1("pdf")); + s_tagMap->insert(TQString::tqfromLatin1("T3"), TQString::tqfromLatin1("series")); + s_tagMap->insert(TQString::tqfromLatin1("EP"), TQString::tqfromLatin1("pages")); } } @@ -72,41 +72,41 @@ void RISImporter::initTypeMap() { if(!s_typeMap) { s_typeMap = new TQMap<TQString, TQString>(); // leave capitalized, except for bibtex types - s_typeMap->insert(TQString::fromLatin1("ABST"), TQString::fromLatin1("Abstract")); - s_typeMap->insert(TQString::fromLatin1("ADVS"), TQString::fromLatin1("Audiovisual material")); - s_typeMap->insert(TQString::fromLatin1("ART"), TQString::fromLatin1("Art Work")); - s_typeMap->insert(TQString::fromLatin1("BILL"), TQString::fromLatin1("Bill/Resolution")); - s_typeMap->insert(TQString::fromLatin1("BOOK"), TQString::fromLatin1("book")); // bibtex - s_typeMap->insert(TQString::fromLatin1("CASE"), TQString::fromLatin1("Case")); - s_typeMap->insert(TQString::fromLatin1("CHAP"), TQString::fromLatin1("inbook")); // == "inbook" ? - s_typeMap->insert(TQString::fromLatin1("COMP"), TQString::fromLatin1("Computer program")); - s_typeMap->insert(TQString::fromLatin1("CONF"), TQString::fromLatin1("inproceedings")); // == "conference" ? - s_typeMap->insert(TQString::fromLatin1("CTLG"), TQString::fromLatin1("Catalog")); - s_typeMap->insert(TQString::fromLatin1("DATA"), TQString::fromLatin1("Data file")); - s_typeMap->insert(TQString::fromLatin1("ELEC"), TQString::fromLatin1("Electronic Citation")); - s_typeMap->insert(TQString::fromLatin1("GEN"), TQString::fromLatin1("Generic")); - s_typeMap->insert(TQString::fromLatin1("HEAR"), TQString::fromLatin1("Hearing")); - s_typeMap->insert(TQString::fromLatin1("ICOMM"), TQString::fromLatin1("Internet Communication")); - s_typeMap->insert(TQString::fromLatin1("INPR"), TQString::fromLatin1("In Press")); - s_typeMap->insert(TQString::fromLatin1("JFULL"), TQString::fromLatin1("Journal (full)")); // = "periodical" ? - s_typeMap->insert(TQString::fromLatin1("JOUR"), TQString::fromLatin1("article")); // "Journal" - s_typeMap->insert(TQString::fromLatin1("MAP"), TQString::fromLatin1("Map")); - s_typeMap->insert(TQString::fromLatin1("MGZN"), TQString::fromLatin1("article")); // bibtex - s_typeMap->insert(TQString::fromLatin1("MPCT"), TQString::fromLatin1("Motion picture")); - s_typeMap->insert(TQString::fromLatin1("MUSIC"), TQString::fromLatin1("Music score")); - s_typeMap->insert(TQString::fromLatin1("NEWS"), TQString::fromLatin1("Newspaper")); - s_typeMap->insert(TQString::fromLatin1("PAMP"), TQString::fromLatin1("Pamphlet")); // = "booklet" ? - s_typeMap->insert(TQString::fromLatin1("PAT"), TQString::fromLatin1("Patent")); - s_typeMap->insert(TQString::fromLatin1("PCOMM"), TQString::fromLatin1("Personal communication")); - s_typeMap->insert(TQString::fromLatin1("RPRT"), TQString::fromLatin1("Report")); // = "techreport" ? - s_typeMap->insert(TQString::fromLatin1("SER"), TQString::fromLatin1("Serial (BookMonograph)")); - s_typeMap->insert(TQString::fromLatin1("SLIDE"), TQString::fromLatin1("Slide")); - s_typeMap->insert(TQString::fromLatin1("SOUND"), TQString::fromLatin1("Sound recording")); - s_typeMap->insert(TQString::fromLatin1("STAT"), TQString::fromLatin1("Statute")); - s_typeMap->insert(TQString::fromLatin1("THES"), TQString::fromLatin1("phdthesis")); // "mastersthesis" ? - s_typeMap->insert(TQString::fromLatin1("UNBILL"), TQString::fromLatin1("Unenacted bill/resolution")); - s_typeMap->insert(TQString::fromLatin1("UNPB"), TQString::fromLatin1("unpublished")); // bibtex - s_typeMap->insert(TQString::fromLatin1("VIDEO"), TQString::fromLatin1("Video recording")); + s_typeMap->insert(TQString::tqfromLatin1("ABST"), TQString::tqfromLatin1("Abstract")); + s_typeMap->insert(TQString::tqfromLatin1("ADVS"), TQString::tqfromLatin1("Audiovisual material")); + s_typeMap->insert(TQString::tqfromLatin1("ART"), TQString::tqfromLatin1("Art Work")); + s_typeMap->insert(TQString::tqfromLatin1("BILL"), TQString::tqfromLatin1("Bill/Resolution")); + s_typeMap->insert(TQString::tqfromLatin1("BOOK"), TQString::tqfromLatin1("book")); // bibtex + s_typeMap->insert(TQString::tqfromLatin1("CASE"), TQString::tqfromLatin1("Case")); + s_typeMap->insert(TQString::tqfromLatin1("CHAP"), TQString::tqfromLatin1("inbook")); // == "inbook" ? + s_typeMap->insert(TQString::tqfromLatin1("COMP"), TQString::tqfromLatin1("Computer program")); + s_typeMap->insert(TQString::tqfromLatin1("CONF"), TQString::tqfromLatin1("inproceedings")); // == "conference" ? + s_typeMap->insert(TQString::tqfromLatin1("CTLG"), TQString::tqfromLatin1("Catalog")); + s_typeMap->insert(TQString::tqfromLatin1("DATA"), TQString::tqfromLatin1("Data file")); + s_typeMap->insert(TQString::tqfromLatin1("ELEC"), TQString::tqfromLatin1("Electronic Citation")); + s_typeMap->insert(TQString::tqfromLatin1("GEN"), TQString::tqfromLatin1("Generic")); + s_typeMap->insert(TQString::tqfromLatin1("HEAR"), TQString::tqfromLatin1("Hearing")); + s_typeMap->insert(TQString::tqfromLatin1("ICOMM"), TQString::tqfromLatin1("Internet Communication")); + s_typeMap->insert(TQString::tqfromLatin1("INPR"), TQString::tqfromLatin1("In Press")); + s_typeMap->insert(TQString::tqfromLatin1("JFULL"), TQString::tqfromLatin1("Journal (full)")); // = "periodical" ? + s_typeMap->insert(TQString::tqfromLatin1("JOUR"), TQString::tqfromLatin1("article")); // "Journal" + s_typeMap->insert(TQString::tqfromLatin1("MAP"), TQString::tqfromLatin1("Map")); + s_typeMap->insert(TQString::tqfromLatin1("MGZN"), TQString::tqfromLatin1("article")); // bibtex + s_typeMap->insert(TQString::tqfromLatin1("MPCT"), TQString::tqfromLatin1("Motion picture")); + s_typeMap->insert(TQString::tqfromLatin1("MUSIC"), TQString::tqfromLatin1("Music score")); + s_typeMap->insert(TQString::tqfromLatin1("NEWS"), TQString::tqfromLatin1("Newspaper")); + s_typeMap->insert(TQString::tqfromLatin1("PAMP"), TQString::tqfromLatin1("Pamphlet")); // = "booklet" ? + s_typeMap->insert(TQString::tqfromLatin1("PAT"), TQString::tqfromLatin1("Patent")); + s_typeMap->insert(TQString::tqfromLatin1("PCOMM"), TQString::tqfromLatin1("Personal communication")); + s_typeMap->insert(TQString::tqfromLatin1("RPRT"), TQString::tqfromLatin1("Report")); // = "techreport" ? + s_typeMap->insert(TQString::tqfromLatin1("SER"), TQString::tqfromLatin1("Serial (BookMonograph)")); + s_typeMap->insert(TQString::tqfromLatin1("SLIDE"), TQString::tqfromLatin1("Slide")); + s_typeMap->insert(TQString::tqfromLatin1("SOUND"), TQString::tqfromLatin1("Sound recording")); + s_typeMap->insert(TQString::tqfromLatin1("STAT"), TQString::tqfromLatin1("Statute")); + s_typeMap->insert(TQString::tqfromLatin1("THES"), TQString::tqfromLatin1("phdthesis")); // "mastersthesis" ? + s_typeMap->insert(TQString::tqfromLatin1("UNBILL"), TQString::tqfromLatin1("Unenacted bill/resolution")); + s_typeMap->insert(TQString::tqfromLatin1("UNPB"), TQString::tqfromLatin1("unpublished")); // bibtex + s_typeMap->insert(TQString::tqfromLatin1("VIDEO"), TQString::tqfromLatin1("Video recording")); } } @@ -134,7 +134,7 @@ Tellico::Data::CollPtr RISImporter::collection() { Data::FieldVec vec = currColl->fields(); for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) { // continue if property is empty - TQString ris = it->property(TQString::fromLatin1("ris")); + TQString ris = it->property(TQString::tqfromLatin1("ris")); if(ris.isEmpty()) { continue; } @@ -144,7 +144,7 @@ Tellico::Data::CollPtr RISImporter::collection() { f = new Data::Field(*it); m_coll->addField(f); } - f->setProperty(TQString::fromLatin1("ris"), ris); + f->setProperty(TQString::tqfromLatin1("ris"), ris); risFields.insert(ris, f); } @@ -189,7 +189,7 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri // however, at least one website (Springer) outputs RIS with no space after the final "ER -" // so just strip the white space later // also be gracious and allow only any amount of space before hyphen - TQRegExp rx(TQString::fromLatin1("^(\\w\\w)\\s+-(.*)$")); + TQRegExp rx(TQString::tqfromLatin1("^(\\w\\w)\\s+-(.*)$")); TQString currLine, nextLine; for(currLine = t.readLine(); !m_cancelled && !currLine.isNull(); currLine = nextLine, j += currLine.length()) { nextLine = t.readLine(); @@ -225,7 +225,7 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri sp = value; if(!ep.isEmpty()) { value = sp + '-' + ep; - tag = TQString::fromLatin1("EP"); + tag = TQString::tqfromLatin1("EP"); sp = TQString(); ep = TQString(); } else { @@ -253,10 +253,10 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri // special case for BT // primary title for books, secondary for everything else if(tag == Latin1Literal("BT")) { - if(entry->field(TQString::fromLatin1("entry-type")) == Latin1Literal("book")) { - f = m_coll->fieldByName(TQString::fromLatin1("title")); + if(entry->field(TQString::tqfromLatin1("entry-type")) == Latin1Literal("book")) { + f = m_coll->fieldByName(TQString::tqfromLatin1("title")); } else { - f = m_coll->fieldByName(TQString::fromLatin1("booktitle")); + f = m_coll->fieldByName(TQString::tqfromLatin1("booktitle")); } } else { f = fieldByTag(tag); @@ -272,7 +272,7 @@ void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& ri f->addAllowed(value); // if the field can have multiple values, append current values to new value if((f->flags() & Data::Field::AllowMultiple) && !entry->field(f->name()).isEmpty()) { - value.prepend(entry->field(f->name()) + TQString::fromLatin1("; ")); + value.prepend(entry->field(f->name()) + TQString::tqfromLatin1("; ")); } entry->setField(f, value); @@ -293,15 +293,15 @@ Tellico::Data::FieldPtr RISImporter::fieldByTag(const TQString& tag_) { if(!fieldTag.isEmpty()) { f = m_coll->fieldByName(fieldTag); if(f) { - f->setProperty(TQString::fromLatin1("ris"), tag_); + f->setProperty(TQString::tqfromLatin1("ris"), tag_); return f; } } // add non-default fields if not already there if(tag_== Latin1Literal("L1")) { - f = new Data::Field(TQString::fromLatin1("pdf"), i18n("PDF"), Data::Field::URL); - f->setProperty(TQString::fromLatin1("ris"), TQString::fromLatin1("L1")); + f = new Data::Field(TQString::tqfromLatin1("pdf"), i18n("PDF"), Data::Field::URL); + f->setProperty(TQString::tqfromLatin1("ris"), TQString::tqfromLatin1("L1")); f->setCategory(i18n("Miscellaneous")); } m_coll->addField(f); diff --git a/src/translators/tellico_xml.cpp b/src/translators/tellico_xml.cpp index bcfb412..d1ad3c1 100644 --- a/src/translators/tellico_xml.cpp +++ b/src/translators/tellico_xml.cpp @@ -19,9 +19,9 @@ #include <tqregexp.h> -const TQString Tellico::XML::nsXSL = TQString::fromLatin1("http://www.w3.org/1999/XSL/Transform"); -const TQString Tellico::XML::nsBibtexml = TQString::fromLatin1("http://bibtexml.sf.net/"); -const TQString Tellico::XML::dtdBibtexml = TQString::fromLatin1("bibtexml.dtd"); +const TQString Tellico::XML::nsXSL = TQString::tqfromLatin1("http://www.w3.org/1999/XSL/Transform"); +const TQString Tellico::XML::nsBibtexml = TQString::tqfromLatin1("http://bibtexml.sf.net/"); +const TQString Tellico::XML::dtdBibtexml = TQString::tqfromLatin1("bibtexml.dtd"); /* * VERSION 2 added namespaces, changed to multiple elements, @@ -48,19 +48,19 @@ const TQString Tellico::XML::dtdBibtexml = TQString::fromLatin1("bibtexml.dtd"); * VERSION 10 added the game board collection. */ const uint Tellico::XML::syntaxVersion = 10; -const TQString Tellico::XML::nsTellico = TQString::fromLatin1("http://periapsis.org/tellico/"); +const TQString Tellico::XML::nsTellico = TQString::tqfromLatin1("http://periapsis.org/tellico/"); -const TQString Tellico::XML::nsBookcase = TQString::fromLatin1("http://periapsis.org/bookcase/"); -const TQString Tellico::XML::nsDublinCore = TQString::fromLatin1("http://purl.org/dc/elements/1.1/"); -const TQString Tellico::XML::nsZing = TQString::fromLatin1("http://www.loc.gov/zing/srw/"); -const TQString Tellico::XML::nsZingDiag = TQString::fromLatin1("http://www.loc.gov/zing/srw/diagnostic/"); +const TQString Tellico::XML::nsBookcase = TQString::tqfromLatin1("http://periapsis.org/bookcase/"); +const TQString Tellico::XML::nsDublinCore = TQString::tqfromLatin1("http://purl.org/dc/elements/1.1/"); +const TQString Tellico::XML::nsZing = TQString::tqfromLatin1("http://www.loc.gov/zing/srw/"); +const TQString Tellico::XML::nsZingDiag = TQString::tqfromLatin1("http://www.loc.gov/zing/srw/diagnostic/"); TQString Tellico::XML::pubTellico(int version) { - return TQString::fromLatin1("-//Robby Stephenson/DTD Tellico V%1.0//EN").arg(version); + return TQString::tqfromLatin1("-//Robby Stephenson/DTD Tellico V%1.0//EN").tqarg(version); } TQString Tellico::XML::dtdTellico(int version) { - return TQString::fromLatin1("http://periapsis.org/tellico/dtd/v%1/tellico.dtd").arg(version); + return TQString::tqfromLatin1("http://periapsis.org/tellico/dtd/v%1/tellico.dtd").tqarg(version); } bool Tellico::XML::validXMLElementName(const TQString& name_) { @@ -70,14 +70,14 @@ bool Tellico::XML::validXMLElementName(const TQString& name_) { TQString Tellico::XML::elementName(const TQString& name_) { TQString name = name_; // change white space to dashes - name.replace(TQRegExp(TQString::fromLatin1("\\s+")), TQString::fromLatin1("-")); + name.replace(TQRegExp(TQString::tqfromLatin1("\\s+")), TQString::tqfromLatin1("-")); // first cut, if it passes, we're done if(XML::validXMLElementName(name)) { return name; } // next check first characters IS_DIGIT is defined in libxml/vali.d - for(uint i = 0; i < name.length() && (!IS_LETTER(name[i].unicode()) || name[i] == '_'); ++i) { + for(uint i = 0; i < name.length() && (!IS_LETTER(name[i].tqunicode()) || name[i] == '_'); ++i) { name = name.mid(1); } if(name.isEmpty() || XML::validXMLElementName(name)) { diff --git a/src/translators/tellicoimporter.cpp b/src/translators/tellicoimporter.cpp index 5dfc933..c7ac869 100644 --- a/src/translators/tellicoimporter.cpp +++ b/src/translators/tellicoimporter.cpp @@ -109,11 +109,11 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { TQString errorMsg; int errorLine, errorColumn; if(!dom.setContent(data_, true, &errorMsg, &errorLine, &errorColumn)) { - TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); - str += i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); - str += TQString::fromLatin1("\n"); + TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); + str += i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); + str += TQString::tqfromLatin1("\n"); str += i18n("The error message from TQt is:"); - str += TQString::fromLatin1("\n\t") + errorMsg; + str += TQString::tqfromLatin1("\n\t") + errorMsg; myDebug() << str << endl; setStatusMessage(str); m_format = Error; @@ -124,13 +124,13 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // the syntax version field name changed from "version" to "syntaxVersion" in version 3 uint syntaxVersion; - if(root.hasAttribute(TQString::fromLatin1("syntaxVersion"))) { - syntaxVersion = root.attribute(TQString::fromLatin1("syntaxVersion")).toInt(); - } else if (root.hasAttribute(TQString::fromLatin1("version"))) { - syntaxVersion = root.attribute(TQString::fromLatin1("version")).toInt(); + if(root.hasAttribute(TQString::tqfromLatin1("syntaxVersion"))) { + syntaxVersion = root.attribute(TQString::tqfromLatin1("syntaxVersion")).toInt(); + } else if (root.hasAttribute(TQString::tqfromLatin1("version"))) { + syntaxVersion = root.attribute(TQString::tqfromLatin1("version")).toInt(); } else { if(!url().isEmpty()) { - setStatusMessage(i18n(errorLoad).arg(url().fileName())); + setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); } m_format = Error; return; @@ -140,7 +140,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { if((syntaxVersion > 6 && root.tagName() != Latin1Literal("tellico")) || (syntaxVersion < 7 && root.tagName() != Latin1Literal("bookcase"))) { if(!url().isEmpty()) { - setStatusMessage(i18n(errorLoad).arg(url().fileName())); + setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); } m_format = Error; return; @@ -148,7 +148,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { if(syntaxVersion > XML::syntaxVersion) { if(!url().isEmpty()) { - TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); + TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); str += i18n("It is from a future version of Tellico."); myDebug() << str << endl; setStatusMessage(str); @@ -185,7 +185,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { return; } - TQString title = collelem.attribute(TQString::fromLatin1("title")); + TQString title = collelem.attribute(TQString::tqfromLatin1("title")); // be careful not to have element name collision // for fields, each true field element is a child of a fields element @@ -198,8 +198,8 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { if((syntaxVersion > 3 && n.localName() == Latin1Literal("fields")) || (syntaxVersion < 4 && n.localName() == Latin1Literal("attributes"))) { TQDomElement e = n.toElement(); - fieldelems = e.elementsByTagNameNS(m_namespace, (syntaxVersion > 3) ? TQString::fromLatin1("field") - : TQString::fromLatin1("attribute")); + fieldelems = e.elementsByTagNameNS(m_namespace, (syntaxVersion > 3) ? TQString::tqfromLatin1("field") + : TQString::tqfromLatin1("attribute")); break; } } @@ -209,9 +209,9 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // if there are no attributes or if the first one has the special name of _default bool addFields = (fieldelems.count() == 0); if(!addFields) { - TQString name = fieldelems.item(0).toElement().attribute(TQString::fromLatin1("name")); + TQString name = fieldelems.item(0).toElement().attribute(TQString::tqfromLatin1("name")); addFields = (name == Latin1Literal("_default")); - // removeChild only works for immediate children + // removeChild only works for immediate tqchildren // remove _default field if(addFields) { fieldelems.item(0).parentNode().removeChild(fieldelems.item(0)); @@ -223,12 +223,12 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // on the entryName of the collection. A type field was added to the collection element // to specify what type of collection it is. if(syntaxVersion > 3) { - entryName = TQString::fromLatin1("entry"); - TQString typeStr = collelem.attribute(TQString::fromLatin1("type")); + entryName = TQString::tqfromLatin1("entry"); + TQString typeStr = collelem.attribute(TQString::tqfromLatin1("type")); Data::Collection::Type type = static_cast<Data::Collection::Type>(typeStr.toInt()); m_coll = CollectionFactory::collection(type, addFields); } else { - entryName = collelem.attribute(TQString::fromLatin1("unit")); + entryName = collelem.attribute(TQString::tqfromLatin1("unit")); m_coll = CollectionFactory::collection(entryName, addFields); } @@ -248,14 +248,14 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { continue; } if(n.localName() == Latin1Literal("macros")) { - macroelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("macro")); + macroelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("macro")); break; } } // myDebug() << "TellicoImporter::loadXMLData() - found " << macroelems.count() << " macros" << endl; for(uint j = 0; c && j < macroelems.count(); ++j) { TQDomElement elem = macroelems.item(j).toElement(); - c->addMacro(elem.attribute(TQString::fromLatin1("name")), elem.text()); + c->addMacro(elem.attribute(TQString::tqfromLatin1("name")), elem.text()); } for(TQDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) { @@ -276,7 +276,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { // as a special case, for old book collections with a bibtex-id field, convert to Bibtex if(syntaxVersion < 4 && m_coll->type() == Data::Collection::Book - && m_coll->hasField(TQString::fromLatin1("bibtex-id"))) { + && m_coll->hasField(TQString::tqfromLatin1("bibtex-id"))) { m_coll = Data::BibtexCollection::convertBookCollection(m_coll); } @@ -295,7 +295,7 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { continue; } if(n.localName() == Latin1Literal("images")) { - imgelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("image")); + imgelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("image")); break; } } @@ -337,12 +337,12 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { continue; } if(n.localName() == Latin1Literal("borrowers")) { - TQDomNodeList borrowerElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("borrower")); + TQDomNodeList borrowerElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("borrower")); for(uint j = 0; j < borrowerElems.count(); ++j) { readBorrower(borrowerElems.item(j).toElement()); } } else if(n.localName() == Latin1Literal("filters")) { - TQDomNodeList filterElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("filter")); + TQDomNodeList filterElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("filter")); for(uint j = 0; j < filterElems.count(); ++j) { readFilter(filterElems.item(j).toElement()); } @@ -361,21 +361,21 @@ void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) { void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) { // special case: if the i18n attribute equals true, then translate the title, description, and category - bool isI18n = elem_.attribute(TQString::fromLatin1("i18n")) == Latin1Literal("true"); + bool isI18n = elem_.attribute(TQString::tqfromLatin1("i18n")) == Latin1Literal("true"); - TQString name = elem_.attribute(TQString::fromLatin1("name"), TQString::fromLatin1("unknown")); - TQString title = elem_.attribute(TQString::fromLatin1("title"), i18n("Unknown")); + TQString name = elem_.attribute(TQString::tqfromLatin1("name"), TQString::tqfromLatin1("unknown")); + TQString title = elem_.attribute(TQString::tqfromLatin1("title"), i18n("Unknown")); if(isI18n) { title = i18n(title.utf8()); } - TQString typeStr = elem_.attribute(TQString::fromLatin1("type"), TQString::number(Data::Field::Line)); + TQString typeStr = elem_.attribute(TQString::tqfromLatin1("type"), TQString::number(Data::Field::Line)); Data::Field::Type type = static_cast<Data::Field::Type>(typeStr.toInt()); Data::FieldPtr field; if(type == Data::Field::Choice) { - TQStringList allowed = TQStringList::split(TQString::fromLatin1(";"), - elem_.attribute(TQString::fromLatin1("allowed"))); + TQStringList allowed = TQStringList::split(TQString::tqfromLatin1(";"), + elem_.attribute(TQString::tqfromLatin1("allowed"))); if(isI18n) { for(TQStringList::Iterator it = allowed.begin(); it != allowed.end(); ++it) { (*it) = i18n((*it).utf8()); @@ -386,9 +386,9 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) field = new Data::Field(name, title, type); } - if(elem_.hasAttribute(TQString::fromLatin1("category"))) { + if(elem_.hasAttribute(TQString::tqfromLatin1("category"))) { // at one point, the categories had keyboard accels - TQString cat = elem_.attribute(TQString::fromLatin1("category")); + TQString cat = elem_.attribute(TQString::tqfromLatin1("category")); if(syntaxVersion_ < 9 && cat.find('&') > -1) { cat.remove('&'); } @@ -398,8 +398,8 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) field->setCategory(cat); } - if(elem_.hasAttribute(TQString::fromLatin1("flags"))) { - int flags = elem_.attribute(TQString::fromLatin1("flags")).toInt(); + if(elem_.hasAttribute(TQString::tqfromLatin1("flags"))) { + int flags = elem_.attribute(TQString::tqfromLatin1("flags")).toInt(); // I also changed the enum values for syntax 3, but the only custom field // would have been bibtex-id if(syntaxVersion_ < 3 && field->name() == Latin1Literal("bibtex-id")) { @@ -414,12 +414,12 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) field->setFlags(flags); } - TQString formatStr = elem_.attribute(TQString::fromLatin1("format"), TQString::number(Data::Field::FormatNone)); + TQString formatStr = elem_.attribute(TQString::tqfromLatin1("format"), TQString::number(Data::Field::FormatNone)); Data::Field::FormatFlag format = static_cast<Data::Field::FormatFlag>(formatStr.toInt()); field->setFormatFlag(format); - if(elem_.hasAttribute(TQString::fromLatin1("description"))) { - TQString desc = elem_.attribute(TQString::fromLatin1("description")); + if(elem_.hasAttribute(TQString::tqfromLatin1("description"))) { + TQString desc = elem_.attribute(TQString::tqfromLatin1("description")); if(isI18n) { desc = i18n(desc.utf8()); } @@ -427,42 +427,42 @@ void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) } if(syntaxVersion_ >= 5) { - TQDomNodeList props = elem_.elementsByTagNameNS(m_namespace, TQString::fromLatin1("prop")); + TQDomNodeList props = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("prop")); for(uint i = 0; i < props.count(); ++i) { TQDomElement e = props.item(i).toElement(); - field->setProperty(e.attribute(TQString::fromLatin1("name")), e.text()); + field->setProperty(e.attribute(TQString::tqfromLatin1("name")), e.text()); } // all track fields in music collections prior to version 9 get converted to three columns if(syntaxVersion_ < 9) { if(m_coll->type() == Data::Collection::Album && field->name() == Latin1Literal("track")) { - field->setProperty(TQString::fromLatin1("columns"), TQChar('3')); - field->setProperty(TQString::fromLatin1("column1"), i18n("Title")); - field->setProperty(TQString::fromLatin1("column2"), i18n("Artist")); - field->setProperty(TQString::fromLatin1("column3"), i18n("Length")); + field->setProperty(TQString::tqfromLatin1("columns"), TQChar('3')); + field->setProperty(TQString::tqfromLatin1("column1"), i18n("Title")); + field->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist")); + field->setProperty(TQString::tqfromLatin1("column3"), i18n("Length")); } else if(m_coll->type() == Data::Collection::Video && field->name() == Latin1Literal("cast")) { - field->setProperty(TQString::fromLatin1("column1"), i18n("Actor/Actress")); - field->setProperty(TQString::fromLatin1("column2"), i18n("Role")); + field->setProperty(TQString::tqfromLatin1("column1"), i18n("Actor/Actress")); + field->setProperty(TQString::tqfromLatin1("column2"), i18n("Role")); } } - } else if(elem_.hasAttribute(TQString::fromLatin1("bibtex-field"))) { - field->setProperty(TQString::fromLatin1("bibtex"), elem_.attribute(TQString::fromLatin1("bibtex-field"))); + } else if(elem_.hasAttribute(TQString::tqfromLatin1("bibtex-field"))) { + field->setProperty(TQString::tqfromLatin1("bibtex"), elem_.attribute(TQString::tqfromLatin1("bibtex-field"))); } // Table2 is deprecated if(field->type() == Data::Field::Table2) { field->setType(Data::Field::Table); - field->setProperty(TQString::fromLatin1("columns"), TQChar('2')); + field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2')); } // for syntax 8, rating fields got their own type if(syntaxVersion_ < 8) { Data::Field::convertOldRating(field); // does all its own checking } m_coll->addField(field); -// myDebug() << TQString(" Added field: %1, %2").arg(field->name()).arg(field->title()) << endl; +// myDebug() << TQString(" Added field: %1, %2").tqarg(field->name()).tqarg(field->title()) << endl; } void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryElem_) { - const int id = entryElem_.attribute(TQString::fromLatin1("id")).toInt(); + const int id = entryElem_.attribute(TQString::tqfromLatin1("id")).toInt(); Data::EntryPtr entry; if(id > 0) { entry = new Data::Entry(m_coll, id); @@ -472,20 +472,20 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl bool oldMusic = (syntaxVersion_ < 9 && m_coll->type() == Data::Collection::Album); - // iterate over all field value children + // iterate over all field value tqchildren for(TQDomNode node = entryElem_.firstChild(); !node.isNull(); node = node.nextSibling()) { TQDomElement elem = node.toElement(); if(elem.isNull()) { continue; } - bool isI18n = elem.attribute(TQString::fromLatin1("i18n")) == Latin1Literal("true"); + bool isI18n = elem.attribute(TQString::tqfromLatin1("i18n")) == Latin1Literal("true"); // Entry::setField checks to see if an field of 'name' is allowed // in version 3 and prior, checkbox attributes had no text(), set it to "true" now if(syntaxVersion_ < 4 && elem.text().isEmpty()) { // "true" means checked - entry->setField(elem.localName(), TQString::fromLatin1("true")); + entry->setField(elem.localName(), TQString::tqfromLatin1("true")); continue; } @@ -493,7 +493,7 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl Data::FieldPtr f = m_coll->fieldByName(name); // if the first child of the node is a text node, just set the attribute text - // otherwise, recurse over the node's children + // otherwise, recurse over the node's tqchildren // this is the case for <authors><author>..</author></authors> // but if there's nothing but white space, then it's a BaseNode for some reason // if(node.firstChild().nodeType() == TQDomNode::TextNode) { @@ -507,17 +507,17 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl if(f->type() == Data::Field::Date) { if(elem.hasChildNodes()) { TQString value; - TQDomNode yNode = elem.elementsByTagNameNS(m_namespace, TQString::fromLatin1("year")).item(0); + TQDomNode yNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("year")).item(0); if(!yNode.isNull()) { value += yNode.toElement().text(); } value += '-'; - TQDomNode mNode = elem.elementsByTagNameNS(m_namespace, TQString::fromLatin1("month")).item(0); + TQDomNode mNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("month")).item(0); if(!mNode.isNull()) { value += mNode.toElement().text(); } value += '-'; - TQDomNode dNode = elem.elementsByTagNameNS(m_namespace, TQString::fromLatin1("day")).item(0); + TQDomNode dNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("day")).item(0); if(!dNode.isNull()) { value += dNode.toElement().text(); } @@ -571,7 +571,7 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl } } else if(syntaxVersion_ < 2 && name == Latin1Literal("keywords")) { // in version 2, "keywords" changed to "keyword" - name = TQString::fromLatin1("keyword"); + name = TQString::tqfromLatin1("keyword"); } // special case: if the i18n attribute equals true, then translate the title, description, and category if(isI18n) { @@ -580,13 +580,13 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl // special case for isbn fields, go ahead and validate if(name == Latin1Literal("isbn")) { const ISBNValidator val(0); - if(elem.attribute(TQString::fromLatin1("validate")) != Latin1Literal("no")) { + if(elem.attribute(TQString::tqfromLatin1("validate")) != Latin1Literal("no")) { val.fixup(value); } } entry->setField(name, value); } - } else { // if no field by the tag name, then it has children, iterate through them + } else { // if no field by the tag name, then it has tqchildren, iterate through them // the field name has the final 's', so remove it name.truncate(name.length() - 1); f = m_coll->fieldByName(name); @@ -603,24 +603,24 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl for(TQDomNode childNode = node.firstChild(); !childNode.isNull(); childNode = childNode.nextSibling()) { TQString value; // don't worry about i18n here, Tables are never translated - TQDomNodeList cols = childNode.toElement().elementsByTagNameNS(m_namespace, TQString::fromLatin1("column")); + TQDomNodeList cols = childNode.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("column")); if(cols.count() > 0) { for(uint i = 0; i < cols.count(); ++i) { // special case for old tracks if(oldTracks && i == 1) { // if the second column holds the track length, bump it to next column - TQRegExp rx(TQString::fromLatin1("\\d+:\\d\\d")); + TQRegExp rx(TQString::tqfromLatin1("\\d+:\\d\\d")); if(rx.exactMatch(cols.item(i).toElement().text())) { - value += entry->field(TQString::fromLatin1("artist")); - value += TQString::fromLatin1("::"); + value += entry->field(TQString::tqfromLatin1("artist")); + value += TQString::tqfromLatin1("::"); } } value += cols.item(i).toElement().text().stripWhiteSpace(); if(i < cols.count()-1) { - value += TQString::fromLatin1("::"); + value += TQString::tqfromLatin1("::"); } else if(oldTracks && cols.count() == 1) { - value += TQString::fromLatin1("::"); - value += entry->field(TQString::fromLatin1("artist")); + value += TQString::tqfromLatin1("::"); + value += entry->field(TQString::tqfromLatin1("artist")); } } values += value; @@ -634,15 +634,15 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl value += s; } if(oldTracks) { - value += TQString::fromLatin1("::"); - value += entry->field(TQString::fromLatin1("artist")); + value += TQString::tqfromLatin1("::"); + value += entry->field(TQString::tqfromLatin1("artist")); } if(values.findIndex(value) == -1) { values += value; } } } - entry->setField(name, values.join(TQString::fromLatin1("; "))); + entry->setField(name, values.join(TQString::tqfromLatin1("; "))); } } // end field value loop @@ -650,10 +650,10 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryEl } void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) { - TQString format = elem_.attribute(TQString::fromLatin1("format")); - const bool link = elem_.attribute(TQString::fromLatin1("link")) == Latin1Literal("true"); - TQString id = shareString(link ? elem_.attribute(TQString::fromLatin1("id")) - : Data::Image::idClean(elem_.attribute(TQString::fromLatin1("id")))); + TQString format = elem_.attribute(TQString::tqfromLatin1("format")); + const bool link = elem_.attribute(TQString::tqfromLatin1("link")) == Latin1Literal("true"); + TQString id = shareString(link ? elem_.attribute(TQString::tqfromLatin1("id")) + : Data::Image::idClean(elem_.attribute(TQString::tqfromLatin1("id")))); bool readInfo = true; if(loadImage_) { @@ -670,8 +670,8 @@ void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) { } if(readInfo) { // a width or height of 0 is ok here - int width = elem_.attribute(TQString::fromLatin1("width")).toInt(); - int height = elem_.attribute(TQString::fromLatin1("height")).toInt(); + int width = elem_.attribute(TQString::tqfromLatin1("width")).toInt(); + int height = elem_.attribute(TQString::tqfromLatin1("height")).toInt(); Data::ImageInfo info(id, format.latin1(), width, height, link); ImageFactory::cacheImageInfo(info); } @@ -679,29 +679,29 @@ void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) { void TellicoImporter::readFilter(const TQDomElement& elem_) { FilterPtr f = new Filter(Filter::MatchAny); - f->setName(elem_.attribute(TQString::fromLatin1("name"))); + f->setName(elem_.attribute(TQString::tqfromLatin1("name"))); - TQString match = elem_.attribute(TQString::fromLatin1("match")); + TQString match = elem_.attribute(TQString::tqfromLatin1("match")); if(match == Latin1Literal("all")) { f->setMatch(Filter::MatchAll); } - TQDomNodeList rules = elem_.elementsByTagNameNS(m_namespace, TQString::fromLatin1("rule")); + TQDomNodeList rules = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("rule")); for(uint i = 0; i < rules.count(); ++i) { TQDomElement e = rules.item(i).toElement(); if(e.isNull()) { continue; } - TQString field = e.attribute(TQString::fromLatin1("field")); + TQString field = e.attribute(TQString::tqfromLatin1("field")); // empty field means match any of them - TQString pattern = e.attribute(TQString::fromLatin1("pattern")); + TQString pattern = e.attribute(TQString::tqfromLatin1("pattern")); // empty pattern is bad if(pattern.isEmpty()) { kdWarning() << "TellicoImporter::readFilter() - empty rule!" << endl; continue; } - TQString function = e.attribute(TQString::fromLatin1("function")).lower(); + TQString function = e.attribute(TQString::tqfromLatin1("function")).lower(); FilterRule::Function func; if(function == Latin1Literal("contains")) { func = FilterRule::FuncContains; @@ -728,36 +728,36 @@ void TellicoImporter::readFilter(const TQDomElement& elem_) { } void TellicoImporter::readBorrower(const TQDomElement& elem_) { - TQString name = elem_.attribute(TQString::fromLatin1("name")); - TQString uid = elem_.attribute(TQString::fromLatin1("uid")); + TQString name = elem_.attribute(TQString::tqfromLatin1("name")); + TQString uid = elem_.attribute(TQString::tqfromLatin1("uid")); Data::BorrowerPtr b = new Data::Borrower(name, uid); - TQDomNodeList loans = elem_.elementsByTagNameNS(m_namespace, TQString::fromLatin1("loan")); + TQDomNodeList loans = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("loan")); for(uint i = 0; i < loans.count(); ++i) { TQDomElement e = loans.item(i).toElement(); if(e.isNull()) { continue; } - long id = e.attribute(TQString::fromLatin1("entryRef")).toLong(); + long id = e.attribute(TQString::tqfromLatin1("entryRef")).toLong(); Data::EntryPtr entry = m_coll->entryById(id); if(!entry) { myDebug() << "TellicoImporter::readBorrower() - no entry with id = " << id << endl; continue; } - TQString uid = e.attribute(TQString::fromLatin1("uid")); + TQString uid = e.attribute(TQString::tqfromLatin1("uid")); TQDate loanDate, dueDate; - TQString s = e.attribute(TQString::fromLatin1("loanDate")); + TQString s = e.attribute(TQString::tqfromLatin1("loanDate")); if(!s.isEmpty()) { loanDate = TQDate::fromString(s, Qt::ISODate); } - s = e.attribute(TQString::fromLatin1("dueDate")); + s = e.attribute(TQString::tqfromLatin1("dueDate")); if(!s.isEmpty()) { dueDate = TQDate::fromString(s, Qt::ISODate); } Data::LoanPtr loan = new Data::Loan(entry, loanDate, dueDate, e.text()); loan->setUID(uid); b->addLoan(loan); - s = e.attribute(TQString::fromLatin1("calendar")); + s = e.attribute(TQString::tqfromLatin1("calendar")); loan->setInCalendar(s == Latin1Literal("true")); } if(!b->isEmpty()) { @@ -776,7 +776,7 @@ void TellicoImporter::loadZipData() { m_zip = new KZip(TQT_TQIODEVICE(m_buffer)); } if(!m_zip->open(IO_ReadOnly)) { - setStatusMessage(i18n(errorLoad).arg(url().fileName())); + setStatusMessage(i18n(errorLoad).tqarg(url().fileName())); m_format = Error; delete m_zip; m_zip = 0; @@ -787,7 +787,7 @@ void TellicoImporter::loadZipData() { const KArchiveDirectory* dir = m_zip->directory(); if(!dir) { - TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); + TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); str += i18n("The file is empty."); setStatusMessage(str); m_format = Error; @@ -800,12 +800,12 @@ void TellicoImporter::loadZipData() { } // main file was changed from bookcase.xml to tellico.xml as of version 0.13 - const KArchiveEntry* entry = dir->entry(TQString::fromLatin1("tellico.xml")); + const KArchiveEntry* entry = dir->entry(TQString::tqfromLatin1("tellico.xml")); if(!entry) { - entry = dir->entry(TQString::fromLatin1("bookcase.xml")); + entry = dir->entry(TQString::tqfromLatin1("bookcase.xml")); } if(!entry || !entry->isFile()) { - TQString str = i18n(errorLoad).arg(url().fileName()) + TQChar('\n'); + TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n'); str += i18n("The file contains no collection data."); setStatusMessage(str); m_format = Error; @@ -838,7 +838,7 @@ void TellicoImporter::loadZipData() { return; } - const KArchiveEntry* imgDirEntry = dir->entry(TQString::fromLatin1("images")); + const KArchiveEntry* imgDirEntry = dir->entry(TQString::tqfromLatin1("images")); if(!imgDirEntry || !imgDirEntry->isDirectory()) { m_zip->close(); delete m_zip; @@ -913,7 +913,7 @@ bool TellicoImporter::loadAllImages(const KURL& url_) { KZip zip(url_.path()); if(!zip.open(IO_ReadOnly)) { if(u != url_) { - Kernel::self()->sorry(i18n(errorImageLoad).arg(url_.fileName())); + Kernel::self()->sorry(i18n(errorImageLoad).tqarg(url_.fileName())); } u = url_; return false; @@ -922,14 +922,14 @@ bool TellicoImporter::loadAllImages(const KURL& url_) { const KArchiveDirectory* dir = zip.directory(); if(!dir) { if(u != url_) { - Kernel::self()->sorry(i18n(errorImageLoad).arg(url_.fileName())); + Kernel::self()->sorry(i18n(errorImageLoad).tqarg(url_.fileName())); } u = url_; zip.close(); return false; } - const KArchiveEntry* imgDirEntry = dir->entry(TQString::fromLatin1("images")); + const KArchiveEntry* imgDirEntry = dir->entry(TQString::tqfromLatin1("images")); if(!imgDirEntry || !imgDirEntry->isDirectory()) { zip.close(); return false; @@ -949,38 +949,38 @@ bool TellicoImporter::loadAllImages(const KURL& url_) { void TellicoImporter::addDefaultFilters() { switch(m_coll->type()) { case Data::Collection::Book: - if(m_coll->hasField(TQString::fromLatin1("read"))) { + if(m_coll->hasField(TQString::tqfromLatin1("read"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("Unread Books")); - f->append(new FilterRule(TQString::fromLatin1("read"), TQString::fromLatin1("true"), FilterRule::FuncNotContains)); + f->append(new FilterRule(TQString::tqfromLatin1("read"), TQString::tqfromLatin1("true"), FilterRule::FuncNotContains)); m_coll->addFilter(f); m_modified = true; } break; case Data::Collection::Video: - if(m_coll->hasField(TQString::fromLatin1("year"))) { + if(m_coll->hasField(TQString::tqfromLatin1("year"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("Old Movies")); // old movies from before 1960 - f->append(new FilterRule(TQString::fromLatin1("year"), TQString::fromLatin1("19[012345]\\d"), FilterRule::FuncRegExp)); + f->append(new FilterRule(TQString::tqfromLatin1("year"), TQString::tqfromLatin1("19[012345]\\d"), FilterRule::FuncRegExp)); m_coll->addFilter(f); m_modified = true; } - if(m_coll->hasField(TQString::fromLatin1("widescreen"))) { + if(m_coll->hasField(TQString::tqfromLatin1("widescreen"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("Widescreen")); - f->append(new FilterRule(TQString::fromLatin1("widescreen"), TQString::fromLatin1("true"), FilterRule::FuncContains)); + f->append(new FilterRule(TQString::tqfromLatin1("widescreen"), TQString::tqfromLatin1("true"), FilterRule::FuncContains)); m_coll->addFilter(f); m_modified = true; } break; case Data::Collection::Album: - if(m_coll->hasField(TQString::fromLatin1("year"))) { + if(m_coll->hasField(TQString::tqfromLatin1("year"))) { FilterPtr f = new Filter(Filter::MatchAny); f->setName(i18n("80's Music")); - f->append(new FilterRule(TQString::fromLatin1("year"), TQString::fromLatin1("198\\d"),FilterRule::FuncRegExp)); + f->append(new FilterRule(TQString::tqfromLatin1("year"), TQString::tqfromLatin1("198\\d"),FilterRule::FuncRegExp)); m_coll->addFilter(f); m_modified = true; } @@ -989,22 +989,22 @@ void TellicoImporter::addDefaultFilters() { default: break; } - if(m_coll->hasField(TQString::fromLatin1("rating"))) { + if(m_coll->hasField(TQString::tqfromLatin1("rating"))) { FilterPtr filter = new Filter(Filter::MatchAny); filter->setName(i18n("Favorites")); // check all the numbers, and use top 20% or so - Data::FieldPtr field = m_coll->fieldByName(TQString::fromLatin1("rating")); + Data::FieldPtr field = m_coll->fieldByName(TQString::tqfromLatin1("rating")); bool ok; - uint min = Tellico::toUInt(field->property(TQString::fromLatin1("minimum")), &ok); + uint min = Tellico::toUInt(field->property(TQString::tqfromLatin1("minimum")), &ok); if(!ok) { min = 1; } - uint max = Tellico::toUInt(field->property(TQString::fromLatin1("maximum")), &ok); + uint max = Tellico::toUInt(field->property(TQString::tqfromLatin1("maximum")), &ok); if(!ok) { min = 5; } for(uint i = TQMAX(min, static_cast<uint>(0.8*(max-min+1))); i <= max; ++i) { - filter->append(new FilterRule(TQString::fromLatin1("rating"), TQString::number(i), FilterRule::FuncContains)); + filter->append(new FilterRule(TQString::tqfromLatin1("rating"), TQString::number(i), FilterRule::FuncContains)); } if(!filter->isEmpty()) { m_coll->addFilter(filter); diff --git a/src/translators/tellicoxmlexporter.cpp b/src/translators/tellicoxmlexporter.cpp index 8f71140..221a11b 100644 --- a/src/translators/tellicoxmlexporter.cpp +++ b/src/translators/tellicoxmlexporter.cpp @@ -33,12 +33,12 @@ #include <kglobal.h> #include <kcalendarsystem.h> -#include <layout.h> +#include <tqlayout.h> #include <tqgroupbox.h> #include <tqcheckbox.h> #include <tqwhatsthis.h> #include <tqdom.h> -#include <textcodec.h> +#include <tqtextcodec.h> using Tellico::Export::TellicoXMLExporter; @@ -78,29 +78,29 @@ TQDomDocument TellicoXMLExporter::exportXML() const { : XML::syntaxVersion; TQDomImplementation impl; - TQDomDocumentType doctype = impl.createDocumentType(TQString::fromLatin1("tellico"), + TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("tellico"), XML::pubTellico(exportVersion), XML::dtdTellico(exportVersion)); //default namespace const TQString& ns = XML::nsTellico; - TQDomDocument dom = impl.createDocument(ns, TQString::fromLatin1("tellico"), doctype); + TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("tellico"), doctype); // root tellico element TQDomElement root = dom.documentElement(); - TQString encodeStr = TQString::fromLatin1("version=\"1.0\" encoding=\""); + TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\""); if(options() & Export::ExportUTF8) { - encodeStr += TQString::fromLatin1("UTF-8"); + encodeStr += TQString::tqfromLatin1("UTF-8"); } else { - encodeStr += TQString::fromLatin1(TQTextCodec::codecForLocale()->mimeName()); + encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName()); } encodeStr += TQChar('"'); // createDocument creates a root node, insert the processing instruction before it - dom.insertBefore(dom.createProcessingInstruction(TQString::fromLatin1("xml"), encodeStr), root); + dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root); - root.setAttribute(TQString::fromLatin1("syntaxVersion"), exportVersion); + root.setAttribute(TQString::tqfromLatin1("syntaxVersion"), exportVersion); exportCollectionXML(dom, root, options() & Export::ExportFormatted); @@ -121,11 +121,11 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& return; } - TQDomElement collElem = dom_.createElement(TQString::fromLatin1("collection")); - collElem.setAttribute(TQString::fromLatin1("type"), coll->type()); - collElem.setAttribute(TQString::fromLatin1("title"), coll->title()); + TQDomElement collElem = dom_.createElement(TQString::tqfromLatin1("collection")); + collElem.setAttribute(TQString::tqfromLatin1("type"), coll->type()); + collElem.setAttribute(TQString::tqfromLatin1("title"), coll->title()); - TQDomElement fieldsElem = dom_.createElement(TQString::fromLatin1("fields")); + TQDomElement fieldsElem = dom_.createElement(TQString::tqfromLatin1("fields")); collElem.appendChild(fieldsElem); Data::FieldVec fields = coll->fields(); @@ -136,16 +136,16 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& if(coll->type() == Data::Collection::Bibtex) { const Data::BibtexCollection* c = static_cast<const Data::BibtexCollection*>(coll.data()); if(!c->preamble().isEmpty()) { - TQDomElement preElem = dom_.createElement(TQString::fromLatin1("bibtex-preamble")); + TQDomElement preElem = dom_.createElement(TQString::tqfromLatin1("bibtex-preamble")); preElem.appendChild(dom_.createTextNode(c->preamble())); collElem.appendChild(preElem); } - TQDomElement macrosElem = dom_.createElement(TQString::fromLatin1("macros")); + TQDomElement macrosElem = dom_.createElement(TQString::tqfromLatin1("macros")); for(StringMap::ConstIterator macroIt = c->macroList().constBegin(); macroIt != c->macroList().constEnd(); ++macroIt) { if(!macroIt.data().isEmpty()) { - TQDomElement macroElem = dom_.createElement(TQString::fromLatin1("macro")); - macroElem.setAttribute(TQString::fromLatin1("name"), macroIt.key()); + TQDomElement macroElem = dom_.createElement(TQString::tqfromLatin1("macro")); + macroElem.setAttribute(TQString::tqfromLatin1("name"), macroIt.key()); macroElem.appendChild(dom_.createTextNode(macroIt.data())); macrosElem.appendChild(macroElem); } @@ -161,7 +161,7 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& } if(!m_images.isEmpty() && (options() & Export::ExportImages)) { - TQDomElement imgsElem = dom_.createElement(TQString::fromLatin1("images")); + TQDomElement imgsElem = dom_.createElement(TQString::tqfromLatin1("images")); collElem.appendChild(imgsElem); const TQStringList imageIds = m_images.toList(); for(TQStringList::ConstIterator it = imageIds.begin(); it != imageIds.end(); ++it) { @@ -177,7 +177,7 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& // the borrowers and filters are in the tellico object, not the collection if(options() & Export::ExportComplete) { - TQDomElement bElem = dom_.createElement(TQString::fromLatin1("borrowers")); + TQDomElement bElem = dom_.createElement(TQString::tqfromLatin1("borrowers")); Data::BorrowerVec borrowers = coll->borrowers(); for(Data::BorrowerVec::Iterator bIt = borrowers.begin(); bIt != borrowers.end(); ++bIt) { exportBorrowerXML(dom_, bElem, bIt); @@ -186,7 +186,7 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& parent_.appendChild(bElem); } - TQDomElement fElem = dom_.createElement(TQString::fromLatin1("filters")); + TQDomElement fElem = dom_.createElement(TQString::tqfromLatin1("filters")); FilterVec filters = coll->filters(); for(FilterVec::Iterator fIt = filters.begin(); fIt != filters.end(); ++fIt) { exportFilterXML(dom_, fElem, fIt); @@ -198,31 +198,31 @@ void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& } void TellicoXMLExporter::exportFieldXML(TQDomDocument& dom_, TQDomElement& parent_, Data::FieldPtr field_) const { - TQDomElement elem = dom_.createElement(TQString::fromLatin1("field")); + TQDomElement elem = dom_.createElement(TQString::tqfromLatin1("field")); - elem.setAttribute(TQString::fromLatin1("name"), field_->name()); - elem.setAttribute(TQString::fromLatin1("title"), field_->title()); - elem.setAttribute(TQString::fromLatin1("category"), field_->category()); - elem.setAttribute(TQString::fromLatin1("type"), field_->type()); - elem.setAttribute(TQString::fromLatin1("flags"), field_->flags()); - elem.setAttribute(TQString::fromLatin1("format"), field_->formatFlag()); + elem.setAttribute(TQString::tqfromLatin1("name"), field_->name()); + elem.setAttribute(TQString::tqfromLatin1("title"), field_->title()); + elem.setAttribute(TQString::tqfromLatin1("category"), field_->category()); + elem.setAttribute(TQString::tqfromLatin1("type"), field_->type()); + elem.setAttribute(TQString::tqfromLatin1("flags"), field_->flags()); + elem.setAttribute(TQString::tqfromLatin1("format"), field_->formatFlag()); if(field_->type() == Data::Field::Choice) { - elem.setAttribute(TQString::fromLatin1("allowed"), field_->allowed().join(TQString::fromLatin1(";"))); + elem.setAttribute(TQString::tqfromLatin1("allowed"), field_->allowed().join(TQString::tqfromLatin1(";"))); } // only save description if it's not equal to title, which is the default // title is never empty, so this indirectly checks for empty descriptions if(field_->description() != field_->title()) { - elem.setAttribute(TQString::fromLatin1("description"), field_->description()); + elem.setAttribute(TQString::tqfromLatin1("description"), field_->description()); } for(StringMap::ConstIterator it = field_->propertyList().begin(); it != field_->propertyList().end(); ++it) { if(it.data().isEmpty()) { continue; } - TQDomElement e = dom_.createElement(TQString::fromLatin1("prop")); - e.setAttribute(TQString::fromLatin1("name"), it.key()); + TQDomElement e = dom_.createElement(TQString::tqfromLatin1("prop")); + e.setAttribute(TQString::tqfromLatin1("name"), it.key()); e.appendChild(dom_.createTextNode(it.data())); elem.appendChild(e); } @@ -231,8 +231,8 @@ void TellicoXMLExporter::exportFieldXML(TQDomDocument& dom_, TQDomElement& paren } void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& parent_, Data::EntryPtr entry_, bool format_) const { - TQDomElement entryElem = dom_.createElement(TQString::fromLatin1("entry")); - entryElem.setAttribute(TQString::fromLatin1("id"), entry_->id()); + TQDomElement entryElem = dom_.createElement(TQString::tqfromLatin1("entry")); + entryElem.setAttribute(TQString::tqfromLatin1("id"), entry_->id()); // iterate through every field for the entry Data::FieldVec fields = entry_->collection()->fields(); @@ -268,7 +268,7 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren entryElem.appendChild(parElem); // the space after the semi-colon is enforced when the field is set for the entry - TQStringList fields = TQStringList::split(TQString::fromLatin1("; "), fieldValue, true); + TQStringList fields = TQStringList::split(TQString::tqfromLatin1("; "), fieldValue, true); for(TQStringList::ConstIterator it = fields.begin(); it != fields.end(); ++it) { // element for field value, child of either entryElem or ParentElem TQDomElement fieldElem = dom_.createElement(fieldName); @@ -276,7 +276,7 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren int ncols = 0; if(fIt->type() == Data::Field::Table) { bool ok; - ncols = Tellico::toUInt(fIt->property(TQString::fromLatin1("columns")), &ok); + ncols = Tellico::toUInt(fIt->property(TQString::tqfromLatin1("columns")), &ok); if(!ok) { ncols = 1; } @@ -284,8 +284,8 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren if(ncols > 1) { for(int col = 0; col < ncols; ++col) { TQDomElement elem; - elem = dom_.createElement(TQString::fromLatin1("column")); - elem.appendChild(dom_.createTextNode((*it).section(TQString::fromLatin1("::"), col, col))); + elem = dom_.createElement(TQString::tqfromLatin1("column")); + elem.appendChild(dom_.createTextNode((*it).section(TQString::tqfromLatin1("::"), col, col))); fieldElem.appendChild(elem); } } else { @@ -298,25 +298,25 @@ void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& paren entryElem.appendChild(fieldElem); // Date fields get special treatment if(fIt->type() == Data::Field::Date) { - fieldElem.setAttribute(TQString::fromLatin1("calendar"), KGlobal::locale()->calendar()->calendarName()); + fieldElem.setAttribute(TQString::tqfromLatin1("calendar"), KGlobal::locale()->calendar()->calendarName()); TQStringList s = TQStringList::split('-', fieldValue, true); if(s.count() > 0 && !s[0].isEmpty()) { - TQDomElement e = dom_.createElement(TQString::fromLatin1("year")); + TQDomElement e = dom_.createElement(TQString::tqfromLatin1("year")); fieldElem.appendChild(e); e.appendChild(dom_.createTextNode(s[0])); } if(s.count() > 1 && !s[1].isEmpty()) { - TQDomElement e = dom_.createElement(TQString::fromLatin1("month")); + TQDomElement e = dom_.createElement(TQString::tqfromLatin1("month")); fieldElem.appendChild(e); e.appendChild(dom_.createTextNode(s[1])); } if(s.count() > 2 && !s[2].isEmpty()) { - TQDomElement e = dom_.createElement(TQString::fromLatin1("day")); + TQDomElement e = dom_.createElement(TQString::tqfromLatin1("day")); fieldElem.appendChild(e); e.appendChild(dom_.createTextNode(s[2])); } } else if(fIt->type() == Data::Field::URL && - fIt->property(TQString::fromLatin1("relative")) == Latin1Literal("true") && + fIt->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true") && !url().isEmpty()) { // if a relative URL and url() is not empty, change the value! KURL old_url(Kernel::self()->URL(), fieldValue); @@ -343,35 +343,35 @@ void TellicoXMLExporter::exportImageXML(TQDomDocument& dom_, TQDomElement& paren } // myLog() << "TellicoXMLExporter::exportImageXML() - id = " << id_ << endl; - TQDomElement imgElem = dom_.createElement(TQString::fromLatin1("image")); + TQDomElement imgElem = dom_.createElement(TQString::tqfromLatin1("image")); if(m_includeImages) { const Data::Image& img = ImageFactory::imageById(id_); if(img.isNull()) { myDebug() << "TellicoXMLExporter::exportImageXML() - null image - " << id_ << endl; return; } - imgElem.setAttribute(TQString::fromLatin1("format"), img.format().data()); - imgElem.setAttribute(TQString::fromLatin1("id"), img.id()); - imgElem.setAttribute(TQString::fromLatin1("width"), img.width()); - imgElem.setAttribute(TQString::fromLatin1("height"), img.height()); + imgElem.setAttribute(TQString::tqfromLatin1("format"), img.format().data()); + imgElem.setAttribute(TQString::tqfromLatin1("id"), img.id()); + imgElem.setAttribute(TQString::tqfromLatin1("width"), img.width()); + imgElem.setAttribute(TQString::tqfromLatin1("height"), img.height()); if(img.linkOnly()) { - imgElem.setAttribute(TQString::fromLatin1("link"), TQString::fromLatin1("true")); + imgElem.setAttribute(TQString::tqfromLatin1("link"), TQString::tqfromLatin1("true")); } TQCString imgText = KCodecs::base64Encode(img.byteArray()); - imgElem.appendChild(dom_.createTextNode(TQString::fromLatin1(imgText))); + imgElem.appendChild(dom_.createTextNode(TQString::tqfromLatin1(imgText))); } else { const Data::ImageInfo& info = ImageFactory::imageInfo(id_); if(info.isNull()) { return; } - imgElem.setAttribute(TQString::fromLatin1("format"), info.format.data()); - imgElem.setAttribute(TQString::fromLatin1("id"), info.id); + imgElem.setAttribute(TQString::tqfromLatin1("format"), info.format.data()); + imgElem.setAttribute(TQString::tqfromLatin1("id"), info.id); // only load the images to read the size if necessary const bool loadImageIfNecessary = options() & Export::ExportImageSize; - imgElem.setAttribute(TQString::fromLatin1("width"), info.width(loadImageIfNecessary)); - imgElem.setAttribute(TQString::fromLatin1("height"), info.height(loadImageIfNecessary)); + imgElem.setAttribute(TQString::tqfromLatin1("width"), info.width(loadImageIfNecessary)); + imgElem.setAttribute(TQString::tqfromLatin1("height"), info.height(loadImageIfNecessary)); if(info.linkOnly) { - imgElem.setAttribute(TQString::fromLatin1("link"), TQString::fromLatin1("true")); + imgElem.setAttribute(TQString::tqfromLatin1("link"), TQString::tqfromLatin1("true")); } } parent_.appendChild(imgElem); @@ -380,21 +380,21 @@ void TellicoXMLExporter::exportImageXML(TQDomDocument& dom_, TQDomElement& paren void TellicoXMLExporter::exportGroupXML(TQDomDocument& dom_, TQDomElement& parent_) const { Data::EntryVec vec = entries(); // need a copy for ::contains(); bool exportAll = collection()->entries().count() == vec.count(); - // iterate over each group, which are the first children + // iterate over each group, which are the first tqchildren for(GroupIterator gIt = Controller::self()->groupIterator(); gIt.group(); ++gIt) { if(gIt.group()->isEmpty()) { continue; } - TQDomElement groupElem = dom_.createElement(TQString::fromLatin1("group")); - groupElem.setAttribute(TQString::fromLatin1("title"), gIt.group()->groupName()); + TQDomElement groupElem = dom_.createElement(TQString::tqfromLatin1("group")); + groupElem.setAttribute(TQString::tqfromLatin1("title"), gIt.group()->groupName()); // now iterate over all entry items in the group Data::EntryVec sorted = Data::Document::self()->sortEntries(*gIt.group()); for(Data::EntryVec::Iterator eIt = sorted.begin(); eIt != sorted.end(); ++eIt) { if(!exportAll && !vec.contains(eIt)) { continue; } - TQDomElement entryRefElem = dom_.createElement(TQString::fromLatin1("entryRef")); - entryRefElem.setAttribute(TQString::fromLatin1("id"), eIt->id()); + TQDomElement entryRefElem = dom_.createElement(TQString::tqfromLatin1("entryRef")); + entryRefElem.setAttribute(TQString::tqfromLatin1("id"), eIt->id()); groupElem.appendChild(entryRefElem); } if(groupElem.hasChildNodes()) { @@ -404,34 +404,34 @@ void TellicoXMLExporter::exportGroupXML(TQDomDocument& dom_, TQDomElement& paren } void TellicoXMLExporter::exportFilterXML(TQDomDocument& dom_, TQDomElement& parent_, FilterPtr filter_) const { - TQDomElement filterElem = dom_.createElement(TQString::fromLatin1("filter")); - filterElem.setAttribute(TQString::fromLatin1("name"), filter_->name()); + TQDomElement filterElem = dom_.createElement(TQString::tqfromLatin1("filter")); + filterElem.setAttribute(TQString::tqfromLatin1("name"), filter_->name()); - TQString match = (filter_->op() == Filter::MatchAll) ? TQString::fromLatin1("all") : TQString::fromLatin1("any"); - filterElem.setAttribute(TQString::fromLatin1("match"), match); + TQString match = (filter_->op() == Filter::MatchAll) ? TQString::tqfromLatin1("all") : TQString::tqfromLatin1("any"); + filterElem.setAttribute(TQString::tqfromLatin1("match"), match); for(TQPtrListIterator<FilterRule> it(*filter_); it.current(); ++it) { - TQDomElement ruleElem = dom_.createElement(TQString::fromLatin1("rule")); - ruleElem.setAttribute(TQString::fromLatin1("field"), it.current()->fieldName()); - ruleElem.setAttribute(TQString::fromLatin1("pattern"), it.current()->pattern()); + TQDomElement ruleElem = dom_.createElement(TQString::tqfromLatin1("rule")); + ruleElem.setAttribute(TQString::tqfromLatin1("field"), it.current()->fieldName()); + ruleElem.setAttribute(TQString::tqfromLatin1("pattern"), it.current()->pattern()); switch(it.current()->function()) { case FilterRule::FuncContains: - ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("contains")); + ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("contains")); break; case FilterRule::FuncNotContains: - ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("notcontains")); + ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notcontains")); break; case FilterRule::FuncEquals: - ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("equals")); + ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("equals")); break; case FilterRule::FuncNotEquals: - ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("notequals")); + ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notequals")); break; case FilterRule::FuncRegExp: - ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("regexp")); + ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("regexp")); break; case FilterRule::FuncNotRegExp: - ruleElem.setAttribute(TQString::fromLatin1("function"), TQString::fromLatin1("notregexp")); + ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notregexp")); break; default: kdWarning() << "TellicoXMLExporter::exportFilterXML() - no matching rule function!" << endl; @@ -448,23 +448,23 @@ void TellicoXMLExporter::exportBorrowerXML(TQDomDocument& dom_, TQDomElement& pa return; } - TQDomElement bElem = dom_.createElement(TQString::fromLatin1("borrower")); + TQDomElement bElem = dom_.createElement(TQString::tqfromLatin1("borrower")); parent_.appendChild(bElem); - bElem.setAttribute(TQString::fromLatin1("name"), borrower_->name()); - bElem.setAttribute(TQString::fromLatin1("uid"), borrower_->uid()); + bElem.setAttribute(TQString::tqfromLatin1("name"), borrower_->name()); + bElem.setAttribute(TQString::tqfromLatin1("uid"), borrower_->uid()); const Data::LoanVec& loans = borrower_->loans(); for(Data::LoanVec::ConstIterator it = loans.constBegin(); it != loans.constEnd(); ++it) { - TQDomElement lElem = dom_.createElement(TQString::fromLatin1("loan")); + TQDomElement lElem = dom_.createElement(TQString::tqfromLatin1("loan")); bElem.appendChild(lElem); - lElem.setAttribute(TQString::fromLatin1("uid"), it->uid()); - lElem.setAttribute(TQString::fromLatin1("entryRef"), it->entry()->id()); - lElem.setAttribute(TQString::fromLatin1("loanDate"), it->loanDate().toString(Qt::ISODate)); - lElem.setAttribute(TQString::fromLatin1("dueDate"), it->dueDate().toString(Qt::ISODate)); + lElem.setAttribute(TQString::tqfromLatin1("uid"), it->uid()); + lElem.setAttribute(TQString::tqfromLatin1("entryRef"), it->entry()->id()); + lElem.setAttribute(TQString::tqfromLatin1("loanDate"), it->loanDate().toString(Qt::ISODate)); + lElem.setAttribute(TQString::tqfromLatin1("dueDate"), it->dueDate().toString(Qt::ISODate)); if(it->inCalendar()) { - lElem.setAttribute(TQString::fromLatin1("calendar"), TQString::fromLatin1("true")); + lElem.setAttribute(TQString::tqfromLatin1("calendar"), TQString::tqfromLatin1("true")); } lElem.appendChild(dom_.createTextNode(it->note())); @@ -491,14 +491,14 @@ TQWidget* TellicoXMLExporter::widget(TQWidget* parent_, const char* name_/*=0*/) } void TellicoXMLExporter::readOptions(KConfig* config_) { - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); m_includeImages = group.readBoolEntry("Include Images", m_includeImages); } void TellicoXMLExporter::saveOptions(KConfig* config_) { m_includeImages = m_checkIncludeImages->isChecked(); - KConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString())); + KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString())); group.writeEntry("Include Images", m_includeImages); } diff --git a/src/translators/tellicozipexporter.cpp b/src/translators/tellicozipexporter.cpp index 629a998..582003f 100644 --- a/src/translators/tellicozipexporter.cpp +++ b/src/translators/tellicozipexporter.cpp @@ -73,14 +73,14 @@ bool TellicoZipExporter::exec() { KZip zip(TQT_TQIODEVICE(&buf)); zip.open(IO_WriteOnly); - zip.writeFile(TQString::fromLatin1("tellico.xml"), TQString(), TQString(), xml.length(), xml); + zip.writeFile(TQString::tqfromLatin1("tellico.xml"), TQString(), TQString(), xml.length(), xml); if(m_includeImages) { ProgressManager::self()->setProgress(this, 10); // gonna be lazy and just increment progress every 3 images // it might be less, might be more uint j = 0; - const TQString imagesDir = TQString::fromLatin1("images/"); + const TQString imagesDir = TQString::tqfromLatin1("images/"); StringSet imageSet; Data::FieldVec imageFields = coll->imageFields(); // already took 10%, only 90% left diff --git a/src/translators/xmlimporter.cpp b/src/translators/xmlimporter.cpp index d3a522f..99cf002 100644 --- a/src/translators/xmlimporter.cpp +++ b/src/translators/xmlimporter.cpp @@ -40,10 +40,10 @@ XMLImporter::XMLImporter(const TQByteArray& data_) : Import::Importer(KURL()) { TQString errorMsg; int errorLine, errorColumn; if(!m_dom.setContent(data_, true, &errorMsg, &errorLine, &errorColumn)) { - TQString str = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); - str += TQString::fromLatin1("\n"); + TQString str = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); + str += TQString::tqfromLatin1("\n"); str += i18n("The error message from TQt is:"); - str += TQString::fromLatin1("\n\t") + errorMsg; + str += TQString::tqfromLatin1("\n\t") + errorMsg; setStatusMessage(str); return; } @@ -57,10 +57,10 @@ void XMLImporter::setText(const TQString& text_) { TQString errorMsg; int errorLine, errorColumn; if(!m_dom.setContent(text_, true, &errorMsg, &errorLine, &errorColumn)) { - TQString str = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn); - str += TQString::fromLatin1("\n"); + TQString str = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn); + str += TQString::tqfromLatin1("\n"); str += i18n("The error message from TQt is:"); - str += TQString::fromLatin1("\n\t") + errorMsg; + str += TQString::tqfromLatin1("\n\t") + errorMsg; setStatusMessage(str); } } diff --git a/src/translators/xsltexporter.cpp b/src/translators/xsltexporter.cpp index 727eec3..f7151fd 100644 --- a/src/translators/xsltexporter.cpp +++ b/src/translators/xsltexporter.cpp @@ -21,7 +21,7 @@ #include <tqlabel.h> #include <tqgroupbox.h> -#include <layout.h> +#include <tqlayout.h> #include <tqhbox.h> #include <tqdom.h> #include <tqwhatsthis.h> diff --git a/src/translators/xslthandler.cpp b/src/translators/xslthandler.cpp index b7acb1f..853f6a6 100644 --- a/src/translators/xslthandler.cpp +++ b/src/translators/xslthandler.cpp @@ -17,7 +17,7 @@ #include "../tellico_utils.h" #include <tqdom.h> -#include <textcodec.h> +#include <tqtextcodec.h> #include <kurl.h> @@ -43,7 +43,7 @@ static int writeToTQString(void* context, const char* buffer, int len) { static void closeTQString(void* context) { TQString* t = static_cast<TQString*>(context); - *t += TQString::fromLatin1("\n"); + *t += TQString::tqfromLatin1("\n"); } using Tellico::XSLTHandler; @@ -151,8 +151,8 @@ void XSLTHandler::setXSLTDoc(const TQDomDocument& dom_, const TQCString& xsltFil for(uint j = 0; j < childs.count(); ++j) { if(childs.item(j).isProcessingInstruction()) { TQDomProcessingInstruction pi = childs.item(j).toProcessingInstruction(); - if(pi.data().lower().contains(TQString::fromLatin1("encoding"))) { - if(!pi.data().lower().contains(TQString::fromLatin1("utf-8"))) { + if(pi.data().lower().contains(TQString::tqfromLatin1("encoding"))) { + if(!pi.data().lower().contains(TQString::tqfromLatin1("utf-8"))) { utf8 = false; // } else { // myDebug() << "XSLTHandler::setXSLTDoc() - PI = " << pi.data() << endl; @@ -258,8 +258,8 @@ TQDomDocument& XSLTHandler::setLocaleEncoding(TQDomDocument& dom_) { for(unsigned j = 0; j < childs.count(); ++j) { if(childs.item(j).isElement() && childs.item(j).nodeName() == Latin1Literal("xsl:output")) { TQDomElement e = childs.item(j).toElement(); - const TQString encoding = TQString::fromLatin1(TQTextCodec::codecForLocale()->name()); - e.setAttribute(TQString::fromLatin1("encoding"), encoding); + const TQString encoding = TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name()); + e.setAttribute(TQString::tqfromLatin1("encoding"), encoding); break; } } diff --git a/src/translators/xsltimporter.cpp b/src/translators/xsltimporter.cpp index bdcb5fd..3edbcf6 100644 --- a/src/translators/xsltimporter.cpp +++ b/src/translators/xsltimporter.cpp @@ -22,7 +22,7 @@ #include <tqhbox.h> #include <tqlabel.h> -#include <layout.h> +#include <tqlayout.h> #include <tqgroupbox.h> #include <memory> @@ -41,7 +41,7 @@ static bool isUTF8(const KURL& url_) { ref->open(); TQTextStream stream(ref->file()); TQString line = stream.readLine().lower(); - return line.find(TQString::fromLatin1("utf-8")) > 0; + return line.find(TQString::tqfromLatin1("utf-8")) > 0; } } |