diff options
Diffstat (limited to 'src/fetch')
| -rw-r--r-- | src/fetch/amazonfetcher.cpp | 28 | ||||
| -rw-r--r-- | src/fetch/animenfofetcher.cpp | 6 | ||||
| -rw-r--r-- | src/fetch/configwidget.cpp | 2 | ||||
| -rw-r--r-- | src/fetch/discogsfetcher.cpp | 4 | ||||
| -rw-r--r-- | src/fetch/entrezfetcher.cpp | 6 | ||||
| -rw-r--r-- | src/fetch/execexternalfetcher.cpp | 10 | ||||
| -rw-r--r-- | src/fetch/execexternalfetcher.h | 2 | ||||
| -rw-r--r-- | src/fetch/fetchmanager.cpp | 14 | ||||
| -rw-r--r-- | src/fetch/gcstarpluginfetcher.cpp | 6 | ||||
| -rw-r--r-- | src/fetch/googlescholarfetcher.cpp | 2 | ||||
| -rw-r--r-- | src/fetch/ibsfetcher.cpp | 14 | ||||
| -rw-r--r-- | src/fetch/imdbfetcher.cpp | 112 | ||||
| -rw-r--r-- | src/fetch/scripts/dark_horse_comics.py | 2 | ||||
| -rw-r--r-- | src/fetch/scripts/ministerio_de_cultura.py | 6 | ||||
| -rw-r--r-- | src/fetch/srufetcher.cpp | 4 | ||||
| -rw-r--r-- | src/fetch/yahoofetcher.cpp | 2 | ||||
| -rw-r--r-- | src/fetch/z3950fetcher.cpp | 4 | 
17 files changed, 112 insertions, 112 deletions
diff --git a/src/fetch/amazonfetcher.cpp b/src/fetch/amazonfetcher.cpp index e67bba6..e5f50b8 100644 --- a/src/fetch/amazonfetcher.cpp +++ b/src/fetch/amazonfetcher.cpp @@ -286,7 +286,7 @@ void AmazonFetcher::doSearch() {          TQString s = m_value; // not encValue!!!          s.remove('-');          // limit to first 10 -        s.tqreplace(TQString::tqfromLatin1("; "), TQString::tqfromLatin1(",")); +        s.replace(TQString::tqfromLatin1("; "), TQString::tqfromLatin1(","));          s = s.section(',', 0, 9);          u.addQueryItem(TQString::tqfromLatin1("ItemId"), s);        } @@ -463,7 +463,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {        TQRegExp rx(TQString::tqfromLatin1("\\.([^\\s])"));        TQStringList values = entry->fields(TQString::tqfromLatin1("author"), false);        for(TQStringList::Iterator it = values.begin(); it != values.end(); ++it) { -        (*it).tqreplace(rx, TQString::tqfromLatin1(". \\1")); +        (*it).replace(rx, TQString::tqfromLatin1(". \\1"));        }        entry->setField(TQString::tqfromLatin1("author"), values.join(TQString::tqfromLatin1("; ")));      } @@ -472,7 +472,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {      if(m_site == UK && coll->type() == Data::Collection::Video) {        TQRegExp rx(TQString::tqfromLatin1("\\[(\\d{4})\\]"));        TQString t = entry->title(); -      if(t.tqfind(rx) > -1) { +      if(t.find(rx) > -1) {          TQString y = rx.cap(1);          t.remove(rx).simplifyWhiteSpace();          entry->setField(TQString::tqfromLatin1("title"), t); @@ -563,7 +563,7 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {      ++m_page;      m_countOffset = 0;      doSearch(); -  } else if(m_value.tqcontains(';') > 9) { +  } else if(m_value.contains(';') > 9) {      search(m_key, m_value.section(';', 10));    } else {      m_countOffset = m_entries.count() % AMAZON_RETURNS_PER_REQUEST; @@ -583,7 +583,7 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {    TQStringList defaultFields = customFields().keys();    for(TQStringList::Iterator it = defaultFields.begin(); it != defaultFields.end(); ++it) { -    if(!m_fields.tqcontains(*it)) { +    if(!m_fields.contains(*it)) {        entry->setField(*it, TQString());      }    } @@ -626,7 +626,7 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {          // only care about genres that have "Genres" in the amazon response          // and take the first word after that          for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) { -          if((*it).tqfind(TQString::tqfromLatin1("Genres")) == -1) { +          if((*it).find(TQString::tqfromLatin1("Genres")) == -1) {              continue;            } @@ -663,7 +663,7 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {          // only care about genres that have "Styles" in the amazon response          // and take the first word after that          for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) { -          if((*it).tqfind(TQString::tqfromLatin1("Styles")) == -1) { +          if((*it).find(TQString::tqfromLatin1("Styles")) == -1) {              continue;            } @@ -811,23 +811,23 @@ void AmazonFetcher::parseTitle(Data::EntryPtr entry, int collType) {  bool AmazonFetcher::parseTitleToken(Data::EntryPtr entry, const TQString& token) {    // if res = true, then the token gets removed from the title    bool res = false; -  if(token.tqfind(TQString::tqfromLatin1("widescreen"), 0, false /* case-insensitive*/) > -1 || -     token.tqfind(i18n("Widescreen"), 0, false) > -1) { +  if(token.find(TQString::tqfromLatin1("widescreen"), 0, false /* case-insensitive*/) > -1 || +     token.find(i18n("Widescreen"), 0, false) > -1) {      entry->setField(TQString::tqfromLatin1("widescreen"), TQString::tqfromLatin1("true"));      // res = true; leave it in the title -  } else if(token.tqfind(TQString::tqfromLatin1("full screen"), 0, false) > -1) { +  } else if(token.find(TQString::tqfromLatin1("full screen"), 0, false) > -1) {      // skip, but go ahead and remove from title      res = true;    } -  if(token.tqfind(TQString::tqfromLatin1("blu-ray"), 0, false) > -1) { +  if(token.find(TQString::tqfromLatin1("blu-ray"), 0, false) > -1) {      entry->setField(TQString::tqfromLatin1("medium"), i18n("Blu-ray"));      res = true; -  } else if(token.tqfind(TQString::tqfromLatin1("hd dvd"), 0, false) > -1) { +  } else if(token.find(TQString::tqfromLatin1("hd dvd"), 0, false) > -1) {      entry->setField(TQString::tqfromLatin1("medium"), i18n("HD DVD"));      res = true;    } -  if(token.tqfind(TQString::tqfromLatin1("director's cut"), 0, false) > -1 || -     token.tqfind(i18n("Director's Cut"), 0, false) > -1) { +  if(token.find(TQString::tqfromLatin1("director's cut"), 0, false) > -1 || +     token.find(i18n("Director's Cut"), 0, false) > -1) {      entry->setField(TQString::tqfromLatin1("directors-cut"), TQString::tqfromLatin1("true"));      // res = true; leave it in the title    } diff --git a/src/fetch/animenfofetcher.cpp b/src/fetch/animenfofetcher.cpp index 393313a..8a938a4 100644 --- a/src/fetch/animenfofetcher.cpp +++ b/src/fetch/animenfofetcher.cpp @@ -288,7 +288,7 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) {    int oldpos = -1;    for(int pos = infoRx.search(s); pos > -1; pos = infoRx.search(s, pos+1)) {      if(n == 0 && !key.isEmpty()) { -      if(fieldMap.tqcontains(key)) { +      if(fieldMap.contains(key)) {          value = value.simplifyWhiteSpace();          if(value.length() > 2) { // might be "-"            if(key == Latin1Literal("Genres")) { @@ -329,13 +329,13 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) {    // now look for alternative titles and plot    const TQString a = TQString::tqfromLatin1("Alternative titles"); -  pos = s.tqfind(a, oldpos+1, false); +  pos = s.find(a, oldpos+1, false);    if(pos > -1) {      pos += a.length();    }    int pos2 = -1;    if(pos > -1) { -    pos2 = s.tqfind(TQString::tqfromLatin1("Description"), pos+1, true); +    pos2 = s.find(TQString::tqfromLatin1("Description"), pos+1, true);      if(pos2 > -1) {        value = s.mid(pos, pos2-pos).remove(tagRx).simplifyWhiteSpace();        entry->setField(TQString::tqfromLatin1("alttitle"), value); diff --git a/src/fetch/configwidget.cpp b/src/fetch/configwidget.cpp index 97ff608..f67c39a 100644 --- a/src/fetch/configwidget.cpp +++ b/src/fetch/configwidget.cpp @@ -42,7 +42,7 @@ void ConfigWidget::addFieldsWidget(const StringMap& customFields_, const TQStrin    for(StringMap::ConstIterator it = customFields_.begin(); it != customFields_.end(); ++it) {      TQCheckBox* cb = new TQCheckBox(it.data(), box);      m_fields.insert(it.key(), cb); -    if(fieldsToAdd_.tqcontains(it.key())) { +    if(fieldsToAdd_.contains(it.key())) {        cb->setChecked(true);      }      connect(cb, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetModified())); diff --git a/src/fetch/discogsfetcher.cpp b/src/fetch/discogsfetcher.cpp index b569940..13341f6 100644 --- a/src/fetch/discogsfetcher.cpp +++ b/src/fetch/discogsfetcher.cpp @@ -289,7 +289,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {    const StringMap customFields = this->customFields();    for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) { -    if(!m_fields.tqcontains(it.key())) { +    if(!m_fields.contains(it.key())) {        coll->removeField(it.key());      }    } @@ -298,7 +298,7 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {    coll->removeField(TQString::tqfromLatin1("discogs-id"));    entry = coll->entries().front(); -  m_entries.tqreplace(uid_, entry); +  m_entries.replace(uid_, entry);    return entry;  } diff --git a/src/fetch/entrezfetcher.cpp b/src/fetch/entrezfetcher.cpp index 99f01f1..6383735 100644 --- a/src/fetch/entrezfetcher.cpp +++ b/src/fetch/entrezfetcher.cpp @@ -319,7 +319,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {      return entry;    } -  if(!m_matches.tqcontains(uid_)) { +  if(!m_matches.contains(uid_)) {      return 0;    } @@ -376,7 +376,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {    Data::EntryPtr e = coll->entries().front();    // try to get a link, but only if necessary -  if(m_fields.tqcontains(TQString::tqfromLatin1("url"))) { +  if(m_fields.contains(TQString::tqfromLatin1("url"))) {      KURL link(TQString::tqfromLatin1(ENTREZ_BASE_URL));      link.addPath(TQString::tqfromLatin1(ENTREZ_LINK_CGI));      link.addQueryItem(TQString::tqfromLatin1("tool"),   TQString::tqfromLatin1("Tellico")); @@ -409,7 +409,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {    const StringMap customFields = EntrezFetcher::customFields();    for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) { -    if(!m_fields.tqcontains(it.key())) { +    if(!m_fields.contains(it.key())) {        coll->removeField(it.key());      }    } diff --git a/src/fetch/execexternalfetcher.cpp b/src/fetch/execexternalfetcher.cpp index 3c11c20..630abc9 100644 --- a/src/fetch/execexternalfetcher.cpp +++ b/src/fetch/execexternalfetcher.cpp @@ -124,7 +124,7 @@ void ExecExternalFetcher::readConfigHook(const KConfigGroup& config_) {  void ExecExternalFetcher::search(FetchKey key_, const TQString& value_) {    m_started = true; -  if(!m_args.tqcontains(key_)) { +  if(!m_args.contains(key_)) {      stop();      return;    } @@ -145,8 +145,8 @@ void ExecExternalFetcher::search(FetchKey key_, const TQString& value_) {    }    TQString args = m_args[key_];    TQRegExp rx2(TQString::tqfromLatin1("['\"]%1\\1")); -  args.tqreplace(rx2, TQString::tqfromLatin1("%1")); -  startSearch(parseArguments(args.tqarg(value))); // tqreplace %1 with search value +  args.replace(rx2, TQString::tqfromLatin1("%1")); +  startSearch(parseArguments(args.tqarg(value))); // replace %1 with search value  }  void ExecExternalFetcher::startSearch(const TQStringList& args_) { @@ -402,7 +402,7 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(TQWidget* parent_, const ExecExt      le->completionObject()->addItem(TQString::tqfromLatin1("%1"));      gridLayout->addWidget(le, row, 1);      m_leDict.insert(key, le); -    if(fetcher_ && fetcher_->m_args.tqcontains(key)) { +    if(fetcher_ && fetcher_->m_args.contains(key)) {        cb->setChecked(true);        le->setEnabled(true);        le->setText(fetcher_->m_args[key]); @@ -480,7 +480,7 @@ void ExecExternalFetcher::ConfigWidget::readConfig(KConfig* config_) {      TQCheckBox* cb = m_cbDict[key];      KLineEdit* le = m_leDict[key];      if(cb && le) { -      if(args.tqcontains(key)) { +      if(args.contains(key)) {          cb->setChecked(true);          le->setEnabled(true);          le->setText(args[key]); diff --git a/src/fetch/execexternalfetcher.h b/src/fetch/execexternalfetcher.h index 49a16d0..99e3fc8 100644 --- a/src/fetch/execexternalfetcher.h +++ b/src/fetch/execexternalfetcher.h @@ -50,7 +50,7 @@ public:    virtual TQString source() const;    virtual bool isSearching() const { return m_started; } -  virtual bool canSearch(FetchKey k) const { return m_args.tqcontains(k); } +  virtual bool canSearch(FetchKey k) const { return m_args.contains(k); }    virtual bool canUpdate() const { return m_canUpdate; }    virtual void search(FetchKey key, const TQString& value);    virtual void updateEntry(Data::EntryPtr entry); diff --git a/src/fetch/fetchmanager.cpp b/src/fetch/fetchmanager.cpp index e0b176c..fb83e9f 100644 --- a/src/fetch/fetchmanager.cpp +++ b/src/fetch/fetchmanager.cpp @@ -359,7 +359,7 @@ Tellico::Fetch::FetcherVec Manager::defaultFetchers() {    vec.append(new GoogleScholarFetcher(this));    vec.append(new DiscogsFetcher(this));  // only add IBS if user includes italian -  if(KGlobal::locale()->languagesTwoAlpha().tqcontains(TQString::tqfromLatin1("it"))) { +  if(KGlobal::locale()->languagesTwoAlpha().contains(TQString::tqfromLatin1("it"))) {      vec.append(new IBSFetcher(this));    }    return vec; @@ -489,7 +489,7 @@ Tellico::Fetch::ConfigWidget* Manager::configWidget(TQWidget* parent_, Type type        break;      case ExecExternal:        w = new ExecExternalFetcher::ConfigWidget(parent_); -      if(!name_.isEmpty() && m_scriptMap.tqcontains(name_)) { +      if(!name_.isEmpty() && m_scriptMap.contains(name_)) {          // bundledScriptHasExecPath() actually needs to write the exec path          // back to the config so the configWidget can read it. But if the spec file          // is not readablle, that doesn't work. So work around it with a copy to a temp file @@ -599,15 +599,15 @@ TQPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int siz      const Fetch::ExecExternalFetcher* f = static_cast<const Fetch::ExecExternalFetcher*>(fetcher_.data());      const TQString p = f->execPath();      KURL u; -    if(p.tqfind(TQString::tqfromLatin1("allocine")) > -1) { +    if(p.find(TQString::tqfromLatin1("allocine")) > -1) {        u = TQString::tqfromLatin1("http://www.allocine.fr"); -    } else if(p.tqfind(TQString::tqfromLatin1("ministerio_de_cultura")) > -1) { +    } else if(p.find(TQString::tqfromLatin1("ministerio_de_cultura")) > -1) {        u = TQString::tqfromLatin1("http://www.mcu.es"); -    } else if(p.tqfind(TQString::tqfromLatin1("dark_horse_comics")) > -1) { +    } else if(p.find(TQString::tqfromLatin1("dark_horse_comics")) > -1) {        u = TQString::tqfromLatin1("http://www.darkhorse.com"); -    } else if(p.tqfind(TQString::tqfromLatin1("boardgamegeek")) > -1) { +    } else if(p.find(TQString::tqfromLatin1("boardgamegeek")) > -1) {        u = TQString::tqfromLatin1("http://www.boardgamegeek.com"); -    } else if(f->source().tqfind(TQString::tqfromLatin1("amarok"), 0, false /*case-sensitive*/) > -1) { +    } else if(f->source().find(TQString::tqfromLatin1("amarok"), 0, false /*case-sensitive*/) > -1) {        return LOAD_ICON(TQString::tqfromLatin1("amarok"), group_, size_);      }      if(!u.isEmpty() && u.isValid()) { diff --git a/src/fetch/gcstarpluginfetcher.cpp b/src/fetch/gcstarpluginfetcher.cpp index d6d049c..ccb963d 100644 --- a/src/fetch/gcstarpluginfetcher.cpp +++ b/src/fetch/gcstarpluginfetcher.cpp @@ -43,7 +43,7 @@ GCstarPluginFetcher::PluginParse GCstarPluginFetcher::pluginParse = NotYet;  //static  GCstarPluginFetcher::PluginList GCstarPluginFetcher::plugins(int collType_) { -  if(!pluginMap.tqcontains(collType_)) { +  if(!pluginMap.contains(collType_)) {      GUI::CursorSaver cs;      TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar")); @@ -80,7 +80,7 @@ GCstarPluginFetcher::PluginList GCstarPluginFetcher::plugins(int collType_) {      }    } -  return pluginMap.tqcontains(collType_) ? pluginMap[collType_] : GCstarPluginFetcher::PluginList(); +  return pluginMap.contains(collType_) ? pluginMap[collType_] : GCstarPluginFetcher::PluginList();  }  void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) { @@ -156,7 +156,7 @@ void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_)        info.insert(rx.cap(1).lower(), rx.cap(2));      }      // only add if it has a name -    if(info.tqcontains(TQString::tqfromLatin1("name"))) { +    if(info.contains(TQString::tqfromLatin1("name"))) {        plugins << info;      }    } diff --git a/src/fetch/googlescholarfetcher.cpp b/src/fetch/googlescholarfetcher.cpp index d7773d2..e93c7cd 100644 --- a/src/fetch/googlescholarfetcher.cpp +++ b/src/fetch/googlescholarfetcher.cpp @@ -158,7 +158,7 @@ void GoogleScholarFetcher::slotComplete(KIO::Job* job_) {    TQString text = TQString::fromUtf8(m_data, m_data.size());    TQString bibtex;    int count = 0; -  for(int pos = text.tqfind(m_bibtexRx); count < m_limit && pos > -1; pos = text.tqfind(m_bibtexRx, pos+m_bibtexRx.matchedLength()), ++count) { +  for(int pos = text.find(m_bibtexRx); count < m_limit && pos > -1; pos = text.find(m_bibtexRx, pos+m_bibtexRx.matchedLength()), ++count) {      KURL bibtexUrl(TQString::tqfromLatin1(SCHOLAR_BASE_URL), m_bibtexRx.cap(1));  //    myDebug() << bibtexUrl << endl;      bibtex += FileHandler::readTextFile(bibtexUrl, true); diff --git a/src/fetch/ibsfetcher.cpp b/src/fetch/ibsfetcher.cpp index 734c431..4c86ef3 100644 --- a/src/fetch/ibsfetcher.cpp +++ b/src/fetch/ibsfetcher.cpp @@ -174,8 +174,8 @@ void IBSFetcher::slotComplete(KIO::Job* job_) {  #ifdef IBS_TEST        KURL url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/ibs2.html"));  #else -      // the url probable tqcontains & so be careful -      KURL url = u.tqreplace(TQString::tqfromLatin1("&"), TQChar('&')); +      // the url probable contains & so be careful +      KURL url = u.replace(TQString::tqfromLatin1("&"), TQChar('&'));  #endif        m_matches.insert(r->uid, url); @@ -185,9 +185,9 @@ void IBSFetcher::slotComplete(KIO::Job* job_) {      }      u = anchorRx.cap(1);      t = anchorRx.cap(2); -    pos2 = s.tqfind(TQString::tqfromLatin1("<br>"), pos, false); +    pos2 = s.find(TQString::tqfromLatin1("<br>"), pos, false);      if(pos2 > -1) { -      int pos3 = s.tqfind(TQString::tqfromLatin1("<br>"), pos2+1, false); +      int pos3 = s.find(TQString::tqfromLatin1("<br>"), pos2+1, false);        if(pos3 > -1) {          d = s.mid(pos2, pos3-pos2).remove(tagRx).simplifyWhiteSpace();        } @@ -197,7 +197,7 @@ void IBSFetcher::slotComplete(KIO::Job* job_) {    if(!u.isEmpty()) {      SearchResult* r = new SearchResult(this, t, d, TQString());      emit signalResultFound(r); -    m_matches.insert(r->uid, u.tqreplace(TQString::tqfromLatin1("&"), TQChar('&'))); +    m_matches.insert(r->uid, u.replace(TQString::tqfromLatin1("&"), TQChar('&')));    }  #endif @@ -221,7 +221,7 @@ void IBSFetcher::slotCompleteISBN(KIO::Job* job_) {    }    TQString str = Tellico::decodeHTML(TQString(m_data)); -  if(str.tqfind(TQString::tqfromLatin1("Libro non presente"), 0, false /* cas-sensitive */) > -1) { +  if(str.find(TQString::tqfromLatin1("Libro non presente"), 0, false /* cas-sensitive */) > -1) {      stop();      return;    } @@ -364,7 +364,7 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const TQString& str_) {    TQStringList names = entry->fields(TQString::tqfromLatin1("author"), false);    if(!names.isEmpty() && !names[0].isEmpty()) {      for(TQStringList::Iterator it = names.begin(); it != names.end(); ++it) { -      if((*it).tqfind(',') > -1) { +      if((*it).find(',') > -1) {          continue; // skip if it has a comma        }        TQStringList words = TQStringList::split(' ', *it); diff --git a/src/fetch/imdbfetcher.cpp b/src/fetch/imdbfetcher.cpp index d70429f..682ae1f 100644 --- a/src/fetch/imdbfetcher.cpp +++ b/src/fetch/imdbfetcher.cpp @@ -140,7 +140,7 @@ void IMDBFetcher::search(FetchKey key_, const TQString& value_) {    m_url = KURL();    m_url.setProtocol(TQString::tqfromLatin1("http"));    m_url.setHost(m_host.isEmpty() ? TQString::tqfromLatin1(IMDB_SERVER) : m_host); -  m_url.setPath(TQString::tqfromLatin1("/tqfind")); +  m_url.setPath(TQString::tqfromLatin1("/find"));    switch(key_) {      case Title: @@ -263,7 +263,7 @@ void IMDBFetcher::parseSingleTitleResult() {    s_titleRx->search(Tellico::decodeHTML(TQString(m_data)));    // split title at parenthesis    const TQString cap1 = s_titleRx->cap(1); -  int pPos = cap1.tqfind('('); +  int pPos = cap1.find('(');    // FIXME: maybe remove parentheses here?    SearchResult* r = new SearchResult(this,                                       pPos == -1 ? cap1 : cap1.left(pPos), @@ -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.tqfind(TQString::tqfromLatin1("Popular Titles"),  0,                    false); -  int pos_exact   = output.tqfind(TQString::tqfromLatin1("Exact Matches"),   TQMAX(pos_popular, 0), false); -  int pos_partial = output.tqfind(TQString::tqfromLatin1("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; @@ -348,10 +348,10 @@ void IMDBFetcher::parseTitleBlock(const TQString& str_) {      const TQString cap1 = s_anchorTitleRx->cap(1); // the anchor url      const TQString cap2 = s_anchorTitleRx->cap(2).stripWhiteSpace(); // the anchor text      start += s_anchorTitleRx->matchedLength(); -    int pPos = cap2.tqfind('('); // if it has parentheses, use that for description +    int pPos = cap2.find('('); // if it has parentheses, use that for description      TQString desc;      if(pPos > -1) { -      int pPos2 = cap2.tqfind(')', pPos+1); +      int pPos2 = cap2.find(')', pPos+1);        if(pPos2 > -1) {          desc = cap2.mid(pPos+1, pPos2-pPos-1);        } @@ -362,11 +362,11 @@ void IMDBFetcher::parseTitleBlock(const TQString& str_) {          end = str_.length();        }        TQString text = str_.mid(start, end-start); -      pPos = text.tqfind('('); +      pPos = text.find('(');        if(pPos > -1) { -        int pNewLine = text.tqfind(TQString::tqfromLatin1("<br")); +        int pNewLine = text.find(TQString::tqfromLatin1("<br"));          if(pNewLine == -1 || pPos < pNewLine) { -          int pPos2 = text.tqfind(')', pPos); +          int pPos2 = text.find(')', pPos);            desc = text.mid(pPos+1, pPos2-pPos-1);          }          pPos = -1; @@ -436,24 +436,24 @@ void IMDBFetcher::parseSingleNameResult() {      len = s_anchorTitleRx->cap(0).length();      // split title at parenthesis      const TQString cap2 = s_anchorTitleRx->cap(2).stripWhiteSpace(); -    int pPos = cap2.tqfind('('); +    int pPos = cap2.find('(');      if(pPos > -1) {        desc = cap2.mid(pPos);      } else {        // look until the next <a -      int aPos = output.tqfind(TQString::tqfromLatin1("<a"), pos+len, false); +      int aPos = output.find(TQString::tqfromLatin1("<a"), pos+len, false);        if(aPos == -1) {          aPos = output.length();        }        TQString tmp = output.mid(pos+len, aPos-pos-len); -      if(tmp.tqfind(tvRegExp) > -1) { +      if(tmp.find(tvRegExp) > -1) {          isEpisode = true;        } -      pPos = tmp.tqfind('('); +      pPos = tmp.find('(');        if(pPos > -1) { -        int pNewLine = tmp.tqfind(TQString::tqfromLatin1("<br")); +        int pNewLine = tmp.find(TQString::tqfromLatin1("<br"));          if(pNewLine == -1 || pPos < pNewLine) { -          int pEnd = tmp.tqfind(')', pPos+1); +          int pEnd = tmp.find(')', pPos+1);            desc = tmp.mid(pPos+1, pEnd-pPos-1).remove(*s_tagRx);          }          // but need to indicate it wasn't found initially @@ -501,17 +501,17 @@ void IMDBFetcher::parseMultipleNameResults() {    // the exact results are in the first table after the "exact results" text    TQString output = Tellico::decodeHTML(TQString(m_data)); -  int pos = output.tqfind(TQString::tqfromLatin1("Popular Results"), 0, false); +  int pos = output.find(TQString::tqfromLatin1("Popular Results"), 0, false);    if(pos == -1) { -    pos = output.tqfind(TQString::tqfromLatin1("Exact Matches"), 0, false); +    pos = output.find(TQString::tqfromLatin1("Exact Matches"), 0, false);    }    // find beginning of partial matches -  int end = output.tqfind(TQString::tqfromLatin1("Other Results"), TQMAX(pos, 0), false); +  int end = output.find(TQString::tqfromLatin1("Other Results"), TQMAX(pos, 0), false);    if(end == -1) { -    end = output.tqfind(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos, 0), false); +    end = output.find(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos, 0), false);      if(end == -1) { -      end = output.tqfind(TQString::tqfromLatin1("Approx Matches"), TQMAX(pos, 0), false); +      end = output.find(TQString::tqfromLatin1("Approx Matches"), TQMAX(pos, 0), false);        if(end == -1) {          end = output.length();        } @@ -529,7 +529,7 @@ void IMDBFetcher::parseMultipleNameResults() {        KURL u(m_url, s_anchorNameRx->cap(1));        s = s_anchorNameRx->cap(2).stripWhiteSpace() + ' ';        // if more than one exact, add parentheses -      if(nameMap.tqcontains(s) && nameMap[s] > 0) { +      if(nameMap.contains(s) && nameMap[s] > 0) {          // fix the first one that didn't have a number          if(nameMap[s] == 1) {            KURL u2 = map[s]; @@ -552,7 +552,7 @@ void IMDBFetcher::parseMultipleNameResults() {    while(pos > -1 && m_matches.size() < m_limit) {      KURL u(m_url, s_anchorNameRx->cap(1)); // relative URL      s = s_anchorNameRx->cap(2).stripWhiteSpace(); -    if(nameMap.tqcontains(s) && nameMap[s] > 0) { +    if(nameMap.contains(s) && nameMap[s] > 0) {      // fix the first one that didn't have a number        if(nameMap[s] == 1) {          KURL u2 = map[s]; @@ -685,7 +685,7 @@ Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const TQString& str_) {    }    const TQString imdb = TQString::tqfromLatin1("imdb"); -  if(!coll->hasField(imdb) && m_fields.tqfindIndex(imdb) > -1) { +  if(!coll->hasField(imdb) && m_fields.findIndex(imdb) > -1) {      Data::FieldPtr field = new Data::Field(imdb, i18n("IMDB Link"), Data::Field::URL);      field->setCategory(i18n("General"));      coll->addField(field); @@ -701,7 +701,7 @@ void IMDBFetcher::doTitle(const TQString& str_, Data::EntryPtr entry_) {    if(s_titleRx->search(str_) > -1) {      const TQString cap1 = s_titleRx->cap(1);      // titles always have parentheses -    int pPos = cap1.tqfind('('); +    int pPos = cap1.find('(');      TQString title = cap1.left(pPos).stripWhiteSpace();      // remove first and last quotes is there      if(title.startsWith(TQChar('"')) && title.endsWith(TQChar('"'))) { @@ -742,7 +742,7 @@ void IMDBFetcher::doAspectRatio(const TQString& str_, Data::EntryPtr entry_) {  }  void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) { -  if(m_fields.tqfindIndex(TQString::tqfromLatin1("alttitle")) == -1) { +  if(m_fields.findIndex(TQString::tqfromLatin1("alttitle")) == -1) {      return;    } @@ -770,7 +770,7 @@ void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) {      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.tqfind(TQString::tqfromLatin1("releaseinfo")) > -1) { +      if(s.find(TQString::tqfromLatin1("releaseinfo")) > -1) {          continue;        }        s.remove(*s_tagRx); @@ -807,7 +807,7 @@ void IMDBFetcher::doPlot(const TQString& str_, Data::EntryPtr entry_, const KURL      thisPlot = plotRx.cap(1);      thisPlot.remove(*s_tagRx); // remove HTML tags      entry_->setField(TQString::tqfromLatin1("plot"), thisPlot); -    // if thisPlot ends with (more) or tqcontains +    // 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::tqfromLatin1("(more)</")) || plotURLRx.search(plotRx.cap(0)) > -1) {        useUserSummary = true; @@ -843,14 +843,14 @@ void IMDBFetcher::doPerson(const TQString& str_, Data::EntryPtr entry_,    TQString name = TQString::tqfromLatin1("/name/");    StringSet people; -  for(int pos = str_.tqfind(imdbHeader_); pos > 0; pos = str_.tqfind(imdbHeader_, pos)) { +  for(int pos = str_.find(imdbHeader_); pos > 0; pos = str_.find(imdbHeader_, pos)) {      // loop until repeated <br> tags or </div> tag -    const int endPos1 = str_.tqfind(br2Rx, pos); -    const int endPos2 = str_.tqfind(divRx, pos); +    const int endPos1 = str_.find(br2Rx, pos); +    const int endPos2 = str_.find(divRx, pos);      const int endPos = TQMIN(endPos1, endPos2); // ok to be -1      pos = s_anchorRx->search(str_, pos+1);      while(pos > -1 && pos < endPos) { -      if(s_anchorRx->cap(1).tqfind(name) > -1) { +      if(s_anchorRx->cap(1).find(name) > -1) {          people.add(s_anchorRx->cap(2).stripWhiteSpace());        }        pos = s_anchorRx->search(str_, pos+1); @@ -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.tqfind(TQString::tqfromLatin1("cast overview"), 0, false); +    pos = castText.find(TQString::tqfromLatin1("cast overview"), 0, false);      if(pos == -1) { -      pos = castText.tqfind(TQString::tqfromLatin1("credited cast"), 0, false); +      pos = castText.find(TQString::tqfromLatin1("credited cast"), 0, false);      }    } else {      // first look for anchor      TQRegExp castAnchorRx(TQString::tqfromLatin1("<a\\s+name\\s*=\\s*\"cast\""), false); -    pos = castText.tqfind(castAnchorRx); +    pos = castText.find(castAnchorRx);      if(pos < 0) {        TQRegExp tableClassRx(TQString::tqfromLatin1("<table\\s+class\\s*=\\s*\"cast\""), false); -      pos = castText.tqfind(tableClassRx); +      pos = castText.find(tableClassRx);        if(pos < 0) { -        // fragile, the word "cast" appears in the title, but need to tqfind +        // fragile, the word "cast" appears in the title, but need to find          // the one right above the actual cast table          // for TV shows, there's a link on the sidebar for "episodes case"          // so need to not match that one -        pos = castText.tqfind(TQString::tqfromLatin1("cast</"), 0, false); +        pos = castText.find(TQString::tqfromLatin1("cast</"), 0, false);          if(pos > 9) {            // back up 9 places            if(castText.mid(pos-9, 9).startsWith(TQString::tqfromLatin1("episodes"))) {              // find next cast list -            pos = castText.tqfind(TQString::tqfromLatin1("cast</"), pos+6, false); +            pos = castText.find(TQString::tqfromLatin1("cast</"), pos+6, false);            }          }        } @@ -921,10 +921,10 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL    TQStringList cast;    // loop until closing table tag -  const int endPos = castText.tqfind(TQString::tqfromLatin1("</table"), pos, false); +  const int endPos = castText.find(TQString::tqfromLatin1("</table"), pos, false);    pos = s_anchorRx->search(castText, pos+1);    while(pos > -1 && pos < endPos && static_cast<int>(cast.count()) < m_numCast) { -    if(s_anchorRx->cap(1).tqfind(name) > -1) { +    if(s_anchorRx->cap(1).find(name) > -1) {        // now search for <td> item with character name        // there's a column with ellipses then the character        const int pos2 = tdRx.search(castText, pos); @@ -944,7 +944,7 @@ void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL  }  void IMDBFetcher::doRating(const TQString& str_, Data::EntryPtr entry_) { -  if(m_fields.tqfindIndex(TQString::tqfromLatin1("imdb-rating")) == -1) { +  if(m_fields.findIndex(TQString::tqfromLatin1("imdb-rating")) == -1) {      return;    } @@ -996,7 +996,7 @@ void IMDBFetcher::doCover(const TQString& str_, Data::EntryPtr entry_, const KUR    // didn't find the cover, IMDb also used to put "cover" inside the url    pos = imgRx.search(str_);    while(pos > -1) { -    if(imgRx.cap(0).tqfind(cover, 0, false) > -1) { +    if(imgRx.cap(0).find(cover, 0, false) > -1) {        KURL u(baseURL_, imgRx.cap(1));        TQString id = ImageFactory::addImage(u, true);        if(!id.isEmpty()) { @@ -1026,28 +1026,28 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) {    TQStringList genres, countries, langs, certs, tracks, studios;    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.tqfind(genre) > -1) { -      if(s_anchorRx->cap(2).tqfind(TQString::tqfromLatin1(" section"), 0, false) == -1) { +    if(cap1.find(genre) > -1) { +      if(s_anchorRx->cap(2).find(TQString::tqfromLatin1(" section"), 0, false) == -1) {          genres += s_anchorRx->cap(2).stripWhiteSpace();        } -    } else if(cap1.tqfind(country) > -1) { -      if(s_anchorRx->cap(2).tqfind(TQString::tqfromLatin1(" section"), 0, false) == -1) { +    } else if(cap1.find(country) > -1) { +      if(s_anchorRx->cap(2).find(TQString::tqfromLatin1(" section"), 0, false) == -1) {          countries += s_anchorRx->cap(2).stripWhiteSpace();        } -    } else if(cap1.tqfind(lang) > -1) { +    } else if(cap1.find(lang) > -1) {        langs += s_anchorRx->cap(2).stripWhiteSpace(); -    } else if(cap1.tqfind(colorInfo) > -1) { +    } else if(cap1.find(colorInfo) > -1) {        // change "black and white" to "black & white"        entry_->setField(TQString::tqfromLatin1("color"), -                       s_anchorRx->cap(2).tqreplace(TQString::tqfromLatin1("and"), TQChar('&')).stripWhiteSpace()); -    } else if(cap1.tqfind(cert) > -1) { +                       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.tqfind(soundMix) > -1) { +    } else if(cap1.find(soundMix) > -1) {        tracks += s_anchorRx->cap(2).stripWhiteSpace(); -    } else if(cap1.tqfind(company) > -1) { +    } 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::tqfromLatin1("year")).isEmpty() && cap1.tqfind(year) > -1) { +    } else if(entry_->field(TQString::tqfromLatin1("year")).isEmpty() && cap1.find(year) > -1) {        entry_->setField(TQString::tqfromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace());      }    } @@ -1067,7 +1067,7 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) {          cert = TQChar('U');        }        cert += TQString::tqfromLatin1(" (") + country + ')'; -      if(certsAllowed.tqfindIndex(cert) > -1) { +      if(certsAllowed.findIndex(cert) > -1) {          entry_->setField(TQString::tqfromLatin1("certification"), cert);          break;        } @@ -1075,7 +1075,7 @@ void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) {      // now add new field for all certifications      const TQString allc = TQString::tqfromLatin1("allcertification"); -    if(m_fields.tqfindIndex(allc) > -1) { +    if(m_fields.findIndex(allc) > -1) {        Data::FieldPtr f = entry_->collection()->fieldByName(allc);        if(!f) {          f = new Data::Field(allc, i18n("Certifications"), Data::Field::Table); diff --git a/src/fetch/scripts/dark_horse_comics.py b/src/fetch/scripts/dark_horse_comics.py index 0db83ec..513127c 100644 --- a/src/fetch/scripts/dark_horse_comics.py +++ b/src/fetch/scripts/dark_horse_comics.py @@ -220,7 +220,7 @@ class DarkHorseParser:  		Retrieve all links related to the search. self.__data contains HTML content fetched by self.__getHTMLContent()   		that need to be parsed.  		""" -		matchList = re.findall("""<a *href="%s(?P<page>.*?)">(?P<title>.*?)</a>""" % self.__basePath.tqreplace('?', '\?'), self.__data) +		matchList = re.findall("""<a *href="%s(?P<page>.*?)">(?P<title>.*?)</a>""" % self.__basePath.replace('?', '\?'), self.__data)  		if not matchList: return None  		return matchList diff --git a/src/fetch/scripts/ministerio_de_cultura.py b/src/fetch/scripts/ministerio_de_cultura.py index cdbb580..7f949ba 100644 --- a/src/fetch/scripts/ministerio_de_cultura.py +++ b/src/fetch/scripts/ministerio_de_cultura.py @@ -53,7 +53,7 @@ SVN Version:  	* Removed "Collection" field as I moved to Series/Series Number  Version 0.3.2: -	* Now tqfind 'notas' field related information +	* Now find 'notas' field related information  	* search URL modified to fetch information of exhausted books too  Version 0.3.1: @@ -281,7 +281,7 @@ class MinisterioCulturaParser:  		# Strip out hyphens if kind is ISBN  		if kind == ISBN: -			criteria = criteria.tqreplace('-', NULLSTRING) +			criteria = criteria.replace('-', NULLSTRING)  			# Support for multiple search  			isbnList = criteria.split(';')  			for n in isbnList: @@ -502,7 +502,7 @@ Tellico cannot connect to: http://www.mcu.es/comun/bases/isbn/ISBN.htm webpage:  		# Now retrieve infos  		if links:  			for entry in links: -				data = self.__fetchBookInfo( url = self.__baseURL + entry.tqreplace(' ', '%20') ) +				data = self.__fetchBookInfo( url = self.__baseURL + entry.replace(' ', '%20') )  				node = self.__domTree.addEntry(data)  		else:  			return None diff --git a/src/fetch/srufetcher.cpp b/src/fetch/srufetcher.cpp index 6719a53..99529c3 100644 --- a/src/fetch/srufetcher.cpp +++ b/src/fetch/srufetcher.cpp @@ -289,7 +289,7 @@ void SRUFetcher::slotComplete(KIO::Job* job_) {    const StringMap customFields = SRUFetcher::customFields();    for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) { -    if(!m_fields.tqcontains(it.key())) { +    if(!m_fields.contains(it.key())) {        coll->removeField(it.key());      }    } @@ -524,7 +524,7 @@ TQString SRUConfigWidget::preferredName() const {  void SRUConfigWidget::slotCheckHost() {    TQString s = m_hostEdit->text();    // someone might be pasting a full URL, check that -  if(s.tqfind(':') > -1 || s.tqfind('/') > -1) { +  if(s.find(':') > -1 || s.find('/') > -1) {      KURL u(s);      if(u.isValid()) {        m_hostEdit->setText(u.host()); diff --git a/src/fetch/yahoofetcher.cpp b/src/fetch/yahoofetcher.cpp index 6e74d60..dcd1823 100644 --- a/src/fetch/yahoofetcher.cpp +++ b/src/fetch/yahoofetcher.cpp @@ -346,7 +346,7 @@ TQString YahooFetcher::insertValue(const TQString& str_, const TQString& value_,    bool write = true;    if(!list[pos_-1].isNull()) {      // for some reason, some songs are repeated from yahoo, with 0 length, don't overwrite that -    if(value_.tqcontains(TQString::tqfromLatin1("::")) < 2) { // means no length value +    if(value_.contains(TQString::tqfromLatin1("::")) < 2) { // means no length value        write = false;      }    } diff --git a/src/fetch/z3950fetcher.cpp b/src/fetch/z3950fetcher.cpp index d0bffa3..2496b5b 100644 --- a/src/fetch/z3950fetcher.cpp +++ b/src/fetch/z3950fetcher.cpp @@ -416,7 +416,7 @@ void Z3950Fetcher::handleResult(const TQString& result_) {    const StringMap customFields = Z3950Fetcher::customFields();    for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) { -    if(!m_fields.tqcontains(it.key())) { +    if(!m_fields.contains(it.key())) {        coll->removeField(it.key());      }    } @@ -759,7 +759,7 @@ void Z3950Fetcher::ConfigWidget::loadPresets(const TQString& current_) {      if(current_.isEmpty() && idx == -1) {        // set the initial selection to something depending on the language        const TQStringList locales = cfg.readListEntry("Locale"); -      if(locales.tqfindIndex(lang) > -1 || locales.tqfindIndex(lang2A) > -1) { +      if(locales.findIndex(lang) > -1 || locales.findIndex(lang2A) > -1) {          idx = m_serverCombo->count() - 1;        }      } else if(id == current_) {  | 
