From 2781e27b871150395a5a82e221684108641002b2 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 16 Dec 2011 09:57:51 -0600 Subject: Revert "Rename a number of old tq methods that are no longer tq specific" This reverts commit 031454e56009d576589c28757f6c6fcf4884095e. --- src/fetch/imdbfetcher.cpp | 236 +++++++++++++++++++++++----------------------- 1 file changed, 118 insertions(+), 118 deletions(-) (limited to 'src/fetch/imdbfetcher.cpp') diff --git a/src/fetch/imdbfetcher.cpp b/src/fetch/imdbfetcher.cpp index 2ddbc10..682ae1f 100644 --- a/src/fetch/imdbfetcher.cpp +++ b/src/fetch/imdbfetcher.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -45,7 +45,7 @@ namespace { static const char* IMDB_SERVER = "akas.imdb.com"; static const uint IMDB_MAX_RESULTS = 20; - static const TQString sep = TQString::fromLatin1("; "); + static const TQString sep = TQString::tqfromLatin1("; "); } using Tellico::Fetch::IMDBFetcher; @@ -58,24 +58,24 @@ TQRegExp* IMDBFetcher::s_titleRx = 0; // static void IMDBFetcher::initRegExps() { - s_tagRx = new TQRegExp(TQString::fromLatin1("<.*>")); + s_tagRx = new TQRegExp(TQString::tqfromLatin1("<.*>")); s_tagRx->setMinimal(true); - s_anchorRx = new TQRegExp(TQString::fromLatin1("]*href\\s*=\\s*\"([^\"]*)\"[^<]*>([^<]*)"), false); + s_anchorRx = new TQRegExp(TQString::tqfromLatin1("]*href\\s*=\\s*\"([^\"]*)\"[^<]*>([^<]*)"), false); s_anchorRx->setMinimal(true); - s_anchorTitleRx = new TQRegExp(TQString::fromLatin1("]*href\\s*=\\s*\"([^\"]*/title/[^\"]*)\"[^<]*>([^<]*)"), false); + s_anchorTitleRx = new TQRegExp(TQString::tqfromLatin1("]*href\\s*=\\s*\"([^\"]*/title/[^\"]*)\"[^<]*>([^<]*)"), false); s_anchorTitleRx->setMinimal(true); - s_anchorNameRx = new TQRegExp(TQString::fromLatin1("]*href\\s*=\\s*\"([^\"]*/name/[^\"]*)\"[^<]*>([^<]*)"), false); + s_anchorNameRx = new TQRegExp(TQString::tqfromLatin1("]*href\\s*=\\s*\"([^\"]*/name/[^\"]*)\"[^<]*>([^<]*)"), false); s_anchorNameRx->setMinimal(true); - s_titleRx = new TQRegExp(TQString::fromLatin1("(.*)"), false); + s_titleRx = new TQRegExp(TQString::tqfromLatin1("(.*)"), false); s_titleRx->setMinimal(true); } IMDBFetcher::IMDBFetcher(TQObject* parent_, const char* name_) : Fetcher(parent_, name_), - m_job(0), m_started(false), m_fetchImages(true), m_host(TQString::fromLatin1(IMDB_SERVER)), + m_job(0), m_started(false), m_fetchImages(true), m_host(TQString::tqfromLatin1(IMDB_SERVER)), m_limit(IMDB_MAX_RESULTS), m_countOffset(0) { if(!s_tagRx) { initRegExps(); @@ -130,25 +130,25 @@ void IMDBFetcher::search(FetchKey key_, const TQString& value_) { #ifdef IMDB_TEST if(m_key == Title) { - m_url = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-title.html")); + m_url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title.html")); m_redirected = false; } else { - m_url = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-name.html")); + m_url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-name.html")); m_redirected = true; } #else m_url = KURL(); - m_url.setProtocol(TQString::fromLatin1("http")); - m_url.setHost(m_host.isEmpty() ? TQString::fromLatin1(IMDB_SERVER) : m_host); - m_url.setPath(TQString::fromLatin1("/find")); + m_url.setProtocol(TQString::tqfromLatin1("http")); + m_url.setHost(m_host.isEmpty() ? TQString::tqfromLatin1(IMDB_SERVER) : m_host); + m_url.setPath(TQString::tqfromLatin1("/find")); switch(key_) { case Title: - m_url.addQueryItem(TQString::fromLatin1("s"), TQString::fromLatin1("tt")); + m_url.addQueryItem(TQString::tqfromLatin1("s"), TQString::tqfromLatin1("tt")); break; case Person: - m_url.addQueryItem(TQString::fromLatin1("s"), TQString::fromLatin1("nm")); + m_url.addQueryItem(TQString::tqfromLatin1("s"), TQString::tqfromLatin1("nm")); break; default: @@ -159,7 +159,7 @@ void IMDBFetcher::search(FetchKey key_, const TQString& value_) { // as far as I can tell, the url encoding should always be iso-8859-1 // not utf-8 - m_url.addQueryItem(TQString::fromLatin1("q"), value_, 4 /* iso-8859-1 */); + m_url.addQueryItem(TQString::tqfromLatin1("q"), value_, 4 /* iso-8859-1 */); // myDebug() << "IMDBFetcher::search() url = " << m_url << endl; #endif @@ -282,9 +282,9 @@ void IMDBFetcher::parseMultipleTitleResults() { // IMDb can return three title lists, popular, exact, and partial // the popular titles are in the first table, after the "Popular Results" text - int pos_popular = output.find(TQString::fromLatin1("Popular Titles"), 0, false); - int pos_exact = output.find(TQString::fromLatin1("Exact Matches"), TQMAX(pos_popular, 0), false); - int pos_partial = output.find(TQString::fromLatin1("Partial Matches"), TQMAX(pos_exact, 0), false); + int pos_popular = output.find(TQString::tqfromLatin1("Popular Titles"), 0, false); + int pos_exact = output.find(TQString::tqfromLatin1("Exact Matches"), TQMAX(pos_popular, 0), false); + int pos_partial = output.find(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos_exact, 0), false); int end_popular = pos_exact; // keep track of where to end if(end_popular == -1) { end_popular = pos_partial == -1 ? output.length() : pos_partial; @@ -336,7 +336,7 @@ void IMDBFetcher::parseTitleBlock(const TQString& str_) { } // myDebug() << "IMDBFetcher::parseTitleBlock() - " << m_currentTitleBlock << endl; - TQRegExp akaRx(TQString::fromLatin1("aka (.*)(|| -1) { - int pNewLine = text.find(TQString::fromLatin1(" 50) { - desc = desc.left(50) + TQString::fromLatin1("..."); + desc = desc.left(50) + TQString::tqfromLatin1("..."); } } @@ -425,7 +425,7 @@ void IMDBFetcher::parseSingleNameResult() { return; } - TQRegExp tvRegExp(TQString::fromLatin1("TV\\sEpisode"), false); + TQRegExp tvRegExp(TQString::tqfromLatin1("TV\\sEpisode"), false); int len = 0; int count = 0; @@ -441,7 +441,7 @@ void IMDBFetcher::parseSingleNameResult() { desc = cap2.mid(pPos); } else { // look until the next -1) { - int pNewLine = tmp.find(TQString::fromLatin1("hasField(imdb) && m_fields.findIndex(imdb) > -1) { Data::FieldPtr field = new Data::Field(imdb, i18n("IMDB Link"), Data::Field::URL); field->setCategory(i18n("General")); @@ -707,7 +707,7 @@ void IMDBFetcher::doTitle(const TQString& str_, Data::EntryPtr entry_) { if(title.startsWith(TQChar('"')) && title.endsWith(TQChar('"'))) { title = title.mid(1, title.length()-2); } - entry_->setField(TQString::fromLatin1("title"), title); + entry_->setField(TQString::tqfromLatin1("title"), title); // remove parenthesis uint pPos2 = pPos+1; while(pPos2 < cap1.length() && cap1[pPos2].isDigit()) { @@ -715,62 +715,62 @@ void IMDBFetcher::doTitle(const TQString& str_, Data::EntryPtr entry_) { } TQString year = cap1.mid(pPos+1, pPos2-pPos-1); if(!year.isEmpty()) { - entry_->setField(TQString::fromLatin1("year"), year); + entry_->setField(TQString::tqfromLatin1("year"), year); } } } void IMDBFetcher::doRunningTime(const TQString& str_, Data::EntryPtr entry_) { // running time - TQRegExp runtimeRx(TQString::fromLatin1("runtime:.*(\\d+)\\s+min"), false); + TQRegExp runtimeRx(TQString::tqfromLatin1("runtime:.*(\\d+)\\s+min"), false); runtimeRx.setMinimal(true); if(runtimeRx.search(str_) > -1) { // myDebug() << "running-time = " << runtimeRx.cap(1) << endl; - entry_->setField(TQString::fromLatin1("running-time"), runtimeRx.cap(1)); + entry_->setField(TQString::tqfromLatin1("running-time"), runtimeRx.cap(1)); } } void IMDBFetcher::doAspectRatio(const TQString& str_, Data::EntryPtr entry_) { - TQRegExp rx(TQString::fromLatin1("aspect ratio:.*([\\d\\.]+\\s*:\\s*[\\d\\.]+)"), false); + TQRegExp rx(TQString::tqfromLatin1("aspect ratio:.*([\\d\\.]+\\s*:\\s*[\\d\\.]+)"), false); rx.setMinimal(true); if(rx.search(str_) > -1) { // myDebug() << "aspect ratio = " << rx.cap(1) << endl; - entry_->setField(TQString::fromLatin1("aspect-ratio"), rx.cap(1).stripWhiteSpace()); + entry_->setField(TQString::tqfromLatin1("aspect-ratio"), rx.cap(1).stripWhiteSpace()); } } void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) { - if(m_fields.findIndex(TQString::fromLatin1("alttitle")) == -1) { + if(m_fields.findIndex(TQString::tqfromLatin1("alttitle")) == -1) { return; } // match until next b tag -// TQRegExp akaRx(TQString::fromLatin1("also known as(.*)")); - TQRegExp akaRx(TQString::fromLatin1("also known as(.*)<(b[>\\s/]|div)"), false); +// TQRegExp akaRx(TQString::tqfromLatin1("also known as(.*)")); + TQRegExp akaRx(TQString::tqfromLatin1("also known as(.*)<(b[>\\s/]|div)"), false); akaRx.setMinimal(true); if(akaRx.search(str_) > -1 && !akaRx.cap(1).isEmpty()) { - Data::FieldPtr f = entry_->collection()->fieldByName(TQString::fromLatin1("alttitle")); + Data::FieldPtr f = entry_->collection()->fieldByName(TQString::tqfromLatin1("alttitle")); if(!f) { - f = new Data::Field(TQString::fromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table); + f = new Data::Field(TQString::tqfromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table); f->setFormatFlag(Data::Field::FormatTitle); entry_->collection()->addField(f); } // split by
, remembering it could become valid xhtml! - TQRegExp brRx(TQString::fromLatin1(""), false); + TQRegExp brRx(TQString::tqfromLatin1(""), false); brRx.setMinimal(true); TQStringList list = TQStringList::split(brRx, akaRx.cap(1)); // lang could be included with [fr] -// const TQRegExp parRx(TQString::fromLatin1("\\(.+\\)")); - const TQRegExp brackRx(TQString::fromLatin1("\\[\\w+\\]")); +// const TQRegExp parRx(TQString::tqfromLatin1("\\(.+\\)")); + const TQRegExp brackRx(TQString::tqfromLatin1("\\[\\w+\\]")); TQStringList values; for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) { TQString s = *it; // sometimes, the word "more" gets linked to the releaseinfo page, check that - if(s.find(TQString::fromLatin1("releaseinfo")) > -1) { + if(s.find(TQString::tqfromLatin1("releaseinfo")) > -1) { continue; } s.remove(*s_tagRx); @@ -786,7 +786,7 @@ void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) { } } if(!values.isEmpty()) { - entry_->setField(TQString::fromLatin1("alttitle"), values.join(sep)); + entry_->setField(TQString::tqfromLatin1("alttitle"), values.join(sep)); } } } @@ -799,36 +799,36 @@ void IMDBFetcher::doPlot(const TQString& str_, Data::EntryPtr entry_, const KURL TQString thisPlot; // match until next opening tag - TQRegExp plotRx(TQString::fromLatin1("plot (?:outline|summary):(.*)<[^/].* -1) { thisPlot = plotRx.cap(1); thisPlot.remove(*s_tagRx); // remove HTML tags - entry_->setField(TQString::fromLatin1("plot"), thisPlot); + entry_->setField(TQString::tqfromLatin1("plot"), thisPlot); // if thisPlot ends with (more) or contains // a url that ends with plotsummary, then we'll grab it, otherwise not - if(plotRx.cap(0).endsWith(TQString::fromLatin1("(more) -1) { + if(plotRx.cap(0).endsWith(TQString::tqfromLatin1("(more) -1) { useUserSummary = true; } } if(useUserSummary) { - TQRegExp idRx(TQString::fromLatin1("title/(tt\\d+)")); + TQRegExp idRx(TQString::tqfromLatin1("title/(tt\\d+)")); idRx.search(baseURL_.path()); KURL plotURL = baseURL_; - plotURL.setPath(TQString::fromLatin1("/title/") + idRx.cap(1) + TQString::fromLatin1("/plotsummary")); + plotURL.setPath(TQString::tqfromLatin1("/title/") + idRx.cap(1) + TQString::tqfromLatin1("/plotsummary")); // be quiet about failure TQString plotPage = FileHandler::readTextFile(plotURL, true); if(!plotPage.isEmpty()) { - TQRegExp plotRx(TQString::fromLatin1("(.*)(.*) -1) { TQString userPlot = plotRx.cap(1); userPlot.remove(*s_tagRx); // remove HTML tags - entry_->setField(TQString::fromLatin1("plot"), Tellico::decodeHTML(userPlot)); + entry_->setField(TQString::tqfromLatin1("plot"), Tellico::decodeHTML(userPlot)); } } } @@ -836,11 +836,11 @@ void IMDBFetcher::doPlot(const TQString& str_, Data::EntryPtr entry_, const KURL void IMDBFetcher::doPerson(const TQString& str_, Data::EntryPtr entry_, const TQString& imdbHeader_, const TQString& fieldName_) { - TQRegExp br2Rx(TQString::fromLatin1("\\s*"), false); + TQRegExp br2Rx(TQString::tqfromLatin1("\\s*"), false); br2Rx.setMinimal(true); - TQRegExp divRx(TQString::fromLatin1("<[/]*div"), false); + TQRegExp divRx(TQString::tqfromLatin1("<[/]*div"), false); divRx.setMinimal(true); - TQString name = TQString::fromLatin1("/name/"); + TQString name = TQString::tqfromLatin1("/name/"); StringSet people; for(int pos = str_.find(imdbHeader_); pos > 0; pos = str_.find(imdbHeader_, pos)) { @@ -866,13 +866,13 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL // that's usually a lot of people // but since it can be in billing order, the main actors might not // be in the short list - TQRegExp idRx(TQString::fromLatin1("title/(tt\\d+)")); + TQRegExp idRx(TQString::tqfromLatin1("title/(tt\\d+)")); idRx.search(baseURL_.path()); #ifdef IMDB_TEST - KURL castURL = KURL::fromPathOrURL(TQString::fromLatin1("/home/robby/imdb-title-fullcredits.html")); + KURL castURL = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title-fullcredits.html")); #else KURL castURL = baseURL_; - castURL.setPath(TQString::fromLatin1("/title/") + idRx.cap(1) + TQString::fromLatin1("/fullcredits")); + castURL.setPath(TQString::tqfromLatin1("/title/") + idRx.cap(1) + TQString::tqfromLatin1("/fullcredits")); #endif // be quiet about failure and be sure to translate entities TQString castPage = Tellico::decodeHTML(FileHandler::readTextFile(castURL, true)); @@ -883,28 +883,28 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL if(castText.isEmpty()) { // fall back to short list castText = str_; - pos = castText.find(TQString::fromLatin1("cast overview"), 0, false); + pos = castText.find(TQString::tqfromLatin1("cast overview"), 0, false); if(pos == -1) { - pos = castText.find(TQString::fromLatin1("credited cast"), 0, false); + pos = castText.find(TQString::tqfromLatin1("credited cast"), 0, false); } } else { // first look for anchor - TQRegExp castAnchorRx(TQString::fromLatin1(" 9) { // back up 9 places - if(castText.mid(pos-9, 9).startsWith(TQString::fromLatin1("episodes"))) { + if(castText.mid(pos-9, 9).startsWith(TQString::tqfromLatin1("episodes"))) { // find next cast list - pos = castText.find(TQString::fromLatin1("cast]*>(.*)"), false); + const TQString name = TQString::tqfromLatin1("/name/"); + TQRegExp tdRx(TQString::tqfromLatin1("]*>(.*)"), false); tdRx.setMinimal(true); TQStringList cast; // loop until closing table tag - const int endPos = castText.find(TQString::fromLatin1("search(castText, pos+1); while(pos > -1 && pos < endPos && static_cast(cast.count()) < m_numCast) { if(s_anchorRx->cap(1).find(name) > -1) { @@ -930,7 +930,7 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL const int pos2 = tdRx.search(castText, pos); if(pos2 > -1 && tdRx.search(castText, pos2+1) > -1) { cast += s_anchorRx->cap(2).stripWhiteSpace() - + TQString::fromLatin1("::") + tdRx.cap(1).simplifyWhiteSpace().remove(*s_tagRx); + + TQString::tqfromLatin1("::") + tdRx.cap(1).simplifyWhiteSpace().remove(*s_tagRx); } else { cast += s_anchorRx->cap(2).stripWhiteSpace(); } @@ -939,46 +939,46 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL } if(!cast.isEmpty()) { - entry_->setField(TQString::fromLatin1("cast"), cast.join(sep)); + entry_->setField(TQString::tqfromLatin1("cast"), cast.join(sep)); } } void IMDBFetcher::doRating(const TQString& str_, Data::EntryPtr entry_) { - if(m_fields.findIndex(TQString::fromLatin1("imdb-rating")) == -1) { + if(m_fields.findIndex(TQString::tqfromLatin1("imdb-rating")) == -1) { return; } // don't add a colon, since there's a
at the end // some of the imdb images use /10.gif in their path, so check for space or bracket - TQRegExp rx(TQString::fromLatin1("[>\\s](\\d+.?\\d*)/10[\\s](\\d+.?\\d*)/10[ -1 && !rx.cap(1).isEmpty()) { - Data::FieldPtr f = entry_->collection()->fieldByName(TQString::fromLatin1("imdb-rating")); + Data::FieldPtr f = entry_->collection()->fieldByName(TQString::tqfromLatin1("imdb-rating")); if(!f) { - f = new Data::Field(TQString::fromLatin1("imdb-rating"), i18n("IMDB Rating"), Data::Field::Rating); + f = new Data::Field(TQString::tqfromLatin1("imdb-rating"), i18n("IMDB Rating"), Data::Field::Rating); f->setCategory(i18n("General")); - f->setProperty(TQString::fromLatin1("maximum"), TQString::fromLatin1("10")); + f->setProperty(TQString::tqfromLatin1("maximum"), TQString::tqfromLatin1("10")); entry_->collection()->addField(f); } bool ok; float value = rx.cap(1).toFloat(&ok); if(ok) { - entry_->setField(TQString::fromLatin1("imdb-rating"), TQString::number(value)); + entry_->setField(TQString::tqfromLatin1("imdb-rating"), TQString::number(value)); } } } void IMDBFetcher::doCover(const TQString& str_, Data::EntryPtr entry_, const KURL& baseURL_) { // cover is the img with the "cover" alt text - TQRegExp imgRx(TQString::fromLatin1("]*src\\s*=\\s*\"([^\"]*)\"[^>]*>"), false); + TQRegExp imgRx(TQString::tqfromLatin1("]*src\\s*=\\s*\"([^\"]*)\"[^>]*>"), false); imgRx.setMinimal(true); - TQRegExp posterRx(TQString::fromLatin1("]*name\\s*=\\s*\"poster\"[^>]*>(.*)
"), false); + TQRegExp posterRx(TQString::tqfromLatin1("]*name\\s*=\\s*\"poster\"[^>]*>(.*)"), false); posterRx.setMinimal(true); - const TQString cover = TQString::fromLatin1("cover"); + const TQString cover = TQString::tqfromLatin1("cover"); int pos = posterRx.search(str_); while(pos > -1) { @@ -1011,14 +1011,14 @@ void IMDBFetcher::doCover(const TQString& str_, Data::EntryPtr entry_, const KUR // end up reparsing whole string, but it's not really that slow // loook at every anchor tag in the string void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { - const TQString genre = TQString::fromLatin1("/Genres/"); - const TQString country = TQString::fromLatin1("/Countries/"); - const TQString lang = TQString::fromLatin1("/Languages/"); - const TQString colorInfo = TQString::fromLatin1("color-info"); - const TQString cert = TQString::fromLatin1("certificates="); - const TQString soundMix = TQString::fromLatin1("sound-mix="); - const TQString year = TQString::fromLatin1("/Years/"); - const TQString company = TQString::fromLatin1("/company/"); + const TQString genre = TQString::tqfromLatin1("/Genres/"); + const TQString country = TQString::tqfromLatin1("/Countries/"); + const TQString lang = TQString::tqfromLatin1("/Languages/"); + const TQString colorInfo = TQString::tqfromLatin1("color-info"); + const TQString cert = TQString::tqfromLatin1("certificates="); + const TQString soundMix = TQString::tqfromLatin1("sound-mix="); + const TQString year = TQString::tqfromLatin1("/Years/"); + const TQString company = TQString::tqfromLatin1("/company/"); // IIMdb also has links with the word "sections" in them, remove that // for genres and nationalities @@ -1027,19 +1027,19 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { for(int pos = s_anchorRx->search(str_); pos > -1; pos = s_anchorRx->search(str_, pos+1)) { const TQString cap1 = s_anchorRx->cap(1); if(cap1.find(genre) > -1) { - if(s_anchorRx->cap(2).find(TQString::fromLatin1(" section"), 0, false) == -1) { + if(s_anchorRx->cap(2).find(TQString::tqfromLatin1(" section"), 0, false) == -1) { genres += s_anchorRx->cap(2).stripWhiteSpace(); } } else if(cap1.find(country) > -1) { - if(s_anchorRx->cap(2).find(TQString::fromLatin1(" section"), 0, false) == -1) { + if(s_anchorRx->cap(2).find(TQString::tqfromLatin1(" section"), 0, false) == -1) { countries += s_anchorRx->cap(2).stripWhiteSpace(); } } else if(cap1.find(lang) > -1) { langs += s_anchorRx->cap(2).stripWhiteSpace(); } else if(cap1.find(colorInfo) > -1) { // change "black and white" to "black & white" - entry_->setField(TQString::fromLatin1("color"), - s_anchorRx->cap(2).replace(TQString::fromLatin1("and"), TQChar('&')).stripWhiteSpace()); + entry_->setField(TQString::tqfromLatin1("color"), + s_anchorRx->cap(2).replace(TQString::tqfromLatin1("and"), TQChar('&')).stripWhiteSpace()); } else if(cap1.find(cert) > -1) { certs += s_anchorRx->cap(2).stripWhiteSpace(); } else if(cap1.find(soundMix) > -1) { @@ -1047,34 +1047,34 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { } else if(cap1.find(company) > -1) { studios += s_anchorRx->cap(2).stripWhiteSpace(); // if year field wasn't set before, do it now - } else if(entry_->field(TQString::fromLatin1("year")).isEmpty() && cap1.find(year) > -1) { - entry_->setField(TQString::fromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace()); + } else if(entry_->field(TQString::tqfromLatin1("year")).isEmpty() && cap1.find(year) > -1) { + entry_->setField(TQString::tqfromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace()); } } - entry_->setField(TQString::fromLatin1("genre"), genres.join(sep)); - entry_->setField(TQString::fromLatin1("nationality"), countries.join(sep)); - entry_->setField(TQString::fromLatin1("language"), langs.join(sep)); - entry_->setField(TQString::fromLatin1("audio-track"), tracks.join(sep)); - entry_->setField(TQString::fromLatin1("studio"), studios.join(sep)); + entry_->setField(TQString::tqfromLatin1("genre"), genres.join(sep)); + entry_->setField(TQString::tqfromLatin1("nationality"), countries.join(sep)); + entry_->setField(TQString::tqfromLatin1("language"), langs.join(sep)); + entry_->setField(TQString::tqfromLatin1("audio-track"), tracks.join(sep)); + entry_->setField(TQString::tqfromLatin1("studio"), studios.join(sep)); if(!certs.isEmpty()) { // first try to set default certification - const TQStringList& certsAllowed = entry_->collection()->fieldByName(TQString::fromLatin1("certification"))->allowed(); + const TQStringList& certsAllowed = entry_->collection()->fieldByName(TQString::tqfromLatin1("certification"))->allowed(); for(TQStringList::ConstIterator it = certs.begin(); it != certs.end(); ++it) { TQString country = (*it).section(':', 0, 0); TQString cert = (*it).section(':', 1, 1); if(cert == Latin1Literal("Unrated")) { cert = TQChar('U'); } - cert += TQString::fromLatin1(" (") + country + ')'; + cert += TQString::tqfromLatin1(" (") + country + ')'; if(certsAllowed.findIndex(cert) > -1) { - entry_->setField(TQString::fromLatin1("certification"), cert); + entry_->setField(TQString::tqfromLatin1("certification"), cert); break; } } // now add new field for all certifications - const TQString allc = TQString::fromLatin1("allcertification"); + const TQString allc = TQString::tqfromLatin1("allcertification"); if(m_fields.findIndex(allc) > -1) { Data::FieldPtr f = entry_->collection()->fieldByName(allc); if(!f) { @@ -1082,7 +1082,7 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) { f->setFlags(Data::Field::AllowGrouped); entry_->collection()->addField(f); } - entry_->setField(TQString::fromLatin1("allcertification"), certs.join(sep)); + entry_->setField(TQString::tqfromLatin1("allcertification"), certs.join(sep)); } } } @@ -1091,8 +1091,8 @@ void IMDBFetcher::updateEntry(Data::EntryPtr entry_) { // myLog() << "IMDBFetcher::updateEntry() - " << entry_->title() << endl; // only take first 5 m_limit = 5; - TQString t = entry_->field(TQString::fromLatin1("title")); - KURL link = entry_->field(TQString::fromLatin1("imdb")); + TQString t = entry_->field(TQString::tqfromLatin1("title")); + KURL link = entry_->field(TQString::tqfromLatin1("imdb")); if(!link.isEmpty() && link.isValid()) { // check if we want a different host if(link.host() != m_host) { @@ -1173,7 +1173,7 @@ IMDBFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const IMDBFetcher* fe m_numCast->setValue(fetcher_->m_numCast); m_fetchImageCheck->setChecked(fetcher_->m_fetchImages); } else { //defaults - m_hostEdit->setText(TQString::fromLatin1(IMDB_SERVER)); + m_hostEdit->setText(TQString::tqfromLatin1(IMDB_SERVER)); m_numCast->setValue(10); m_fetchImageCheck->setChecked(true); } @@ -1198,10 +1198,10 @@ TQString IMDBFetcher::ConfigWidget::preferredName() const { //static Tellico::StringMap IMDBFetcher::customFields() { StringMap map; - map[TQString::fromLatin1("imdb")] = i18n("IMDB Link"); - map[TQString::fromLatin1("imdb-rating")] = i18n("IMDB Rating"); - map[TQString::fromLatin1("alttitle")] = i18n("Alternative Titles"); - map[TQString::fromLatin1("allcertification")] = i18n("Certifications"); + map[TQString::tqfromLatin1("imdb")] = i18n("IMDB Link"); + map[TQString::tqfromLatin1("imdb-rating")] = i18n("IMDB Rating"); + map[TQString::tqfromLatin1("alttitle")] = i18n("Alternative Titles"); + map[TQString::tqfromLatin1("allcertification")] = i18n("Certifications"); return map; } -- cgit v1.2.3