~paulbrianstewart/ubuntu/oneiric/tellico/852247-Formatting-Fix

« back to all changes in this revision

Viewing changes to src/translators/tellicoimporter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Regis Boudin
  • Date: 2005-12-06 14:14:47 UTC
  • mfrom: (0.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051206141447-n3c0u0tww5tyx0x0
Tags: 1.0.3+SVNr327-1
* New upstream release (Closes: #337634)
  + Subversion snapshot to get extra fixes
  + Fixes various bugs (including some crashes)
  + Update IMDB search
  + Include fix from Aurelien Jarno to build on GNU/kFreeBSD (Closes: #336949)
* Remove tight dependency on kdepim-related packages, the C++ ABI transition
  is complete for them. Also remove build-dependency on libkcal2-dev, which is
  pulled by kdepim-dev
* Upload sponsored by Thibaut VARENE <varenet@debian.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
 
231
231
//  as a special case, for old book collections with a bibtex-id field, convert to Bibtex
232
232
  if(syntaxVersion < 4 && m_coll->type() == Data::Collection::Book
233
 
     && m_coll->fieldByName(QString::fromLatin1("bibtex-id")) != 0) {
 
233
     && m_coll->hasField(QString::fromLatin1("bibtex-id"))) {
234
234
    Data::BibtexCollection* c = Data::BibtexCollection::convertBookCollection(m_coll);
235
235
    delete m_coll;
236
236
    m_coll = c;
748
748
void TellicoImporter::addDefaultFilters() {
749
749
  switch(m_coll->type()) {
750
750
    case Data::Collection::Book:
751
 
      if(m_coll->fieldByName(QString::fromLatin1("read"))) {
 
751
      if(m_coll->hasField(QString::fromLatin1("read"))) {
752
752
        Filter* f = new Filter(Filter::MatchAny);
753
753
        f->setName(i18n("Unread Books"));
754
754
        f->append(new FilterRule(QString::fromLatin1("read"), QString::fromLatin1("true"), FilterRule::FuncNotContains));
758
758
      break;
759
759
 
760
760
    case Data::Collection::Video:
761
 
      if(m_coll->fieldByName(QString::fromLatin1("year"))) {
 
761
      if(m_coll->hasField(QString::fromLatin1("year"))) {
762
762
        Filter* f = new Filter(Filter::MatchAny);
763
763
        f->setName(i18n("Old Movies"));
764
764
        // old movies from before 1960
766
766
        m_coll->addFilter(f);
767
767
        m_modified = true;
768
768
      }
769
 
      if(m_coll->fieldByName(QString::fromLatin1("widescreen"))) {
 
769
      if(m_coll->hasField(QString::fromLatin1("widescreen"))) {
770
770
        Filter* f = new Filter(Filter::MatchAny);
771
771
        f->setName(i18n("Widescreen"));
772
772
        f->append(new FilterRule(QString::fromLatin1("widescreen"), QString::fromLatin1("true"), FilterRule::FuncContains));
776
776
      break;
777
777
 
778
778
    case Data::Collection::Album:
779
 
      if(m_coll->fieldByName(QString::fromLatin1("year"))) {
 
779
      if(m_coll->hasField(QString::fromLatin1("year"))) {
780
780
        Filter* f = new Filter(Filter::MatchAny);
781
781
        f->setName(i18n("80's Music"));
782
782
        f->append(new FilterRule(QString::fromLatin1("year"), QString::fromLatin1("198\\d"),FilterRule::FuncRegExp));
788
788
    default:
789
789
      break;
790
790
  }
791
 
  if(m_coll->fieldByName(QString::fromLatin1("rating"))) {
 
791
  if(m_coll->hasField(QString::fromLatin1("rating"))) {
792
792
    Filter* filter = new Filter(Filter::MatchAny);
793
793
    filter->setName(i18n("Favorites"));
794
794
    // check all the numbers, and use top 20% or so