diff options
Diffstat (limited to 'src/translators/alexandriaimporter.cpp')
-rw-r--r-- | src/translators/alexandriaimporter.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/translators/alexandriaimporter.cpp b/src/translators/alexandriaimporter.cpp index c3a9db1..9feffec 100644 --- a/src/translators/alexandriaimporter.cpp +++ b/src/translators/alexandriaimporter.cpp @@ -25,7 +25,7 @@ #include <kapplication.h> #include <kstringhandler.h> -#include <tqlayout.h> +#include <layout.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::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"); + 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"); // start with yaml files - dataDir.setNameFilter(TQString::tqfromLatin1("*.yaml")); + dataDir.setNameFilter(TQString::fromLatin1("*.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::tqfromLatin1(".cover") - << TQString::tqfromLatin1("_medium.jpg") - << TQString::tqfromLatin1("_small.jpg"); + covers << TQString::fromLatin1(".cover") + << TQString::fromLatin1("_medium.jpg") + << TQString::fromLatin1("_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::tqfromLatin1("---"))) { + if(line.isEmpty() || line.startsWith(TQString::fromLatin1("---"))) { 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::tqfromLatin1("^\\s*-\\s+")); + TQRegExp begin(TQString::fromLatin1("^\\s*-\\s+")); while(!line.isNull() && line.find(begin) > -1) { line.remove(begin); authors += clean(line); line = ts.readLine(); } - entry->setField(author, authors.join(TQString::tqfromLatin1("; "))); + entry->setField(author, authors.join(TQString::fromLatin1("; "))); // 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::tqfromLatin1(".alexandria"))) { + if(m_libraryDir.cd(TQString::fromLatin1(".alexandria"))) { TQStringList dirs = m_libraryDir.entryList(); - dirs.remove(TQString::tqfromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work - dirs.remove(TQString::tqfromLatin1("..")); + dirs.remove(TQString::fromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work + dirs.remove(TQString::fromLatin1("..")); 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::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")); + 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")); // 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::tqfromLatin1("\\\\\"")); // equals \" + const TQRegExp quote(TQString::fromLatin1("\\\\\"")); // 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::tqfromLatin1("^![^\\s]*\\s+"))); + str_.remove(TQRegExp(TQString::fromLatin1("^![^\\s]*\\s+"))); return str_.replace(quote, TQChar('"')); } |