Logo Search packages:      
Sourcecode: basket version File versions  Download package

bool Item::match ( const SearchData data  ) 

Search

Definition at line 460 of file item.cpp.

References annotations(), fileName(), SearchData::isSearching, SearchData::string, and text().

Referenced by Basket::insertItem().

{
      if ( ! data.isSearching )
            return true;

      switch (m_type) {
            case Text:
                  if (text() .find(data.string, 0, false) != -1)
                        return true;
                  break;
            case Html:
                  if (html() .find(data.string, 0, false) != -1) // TODO: it will also search in HTML tags !!
                        return true;
                  break;
            case Image:
                  break;
            case Animation:
                  break;
            case Sound:
                  if (fileName().find(data.string, 0, false) != -1)
                        return true;
                  break;
            case File:
                  if (fileName().find(data.string, 0, false) != -1)
                        return true;
                  break;
            case Link:
                  if (title().find(data.string, 0, false) != -1 ||
                      url().prettyURL().find(data.string, 0, false) != -1)
                        return true;
                  break;
            case Launcher:
                  if (service()->exec().find(data.string, 0, false) != -1 ||
                      service()->name().find(data.string, 0, false) != -1   )
                        return true;
                  break;
            case Color:
                  if (color().name().find(data.string, 0, false) != -1)
                        return true;
                  break;
            case Unknow:
                  if (text() .find(data.string, 0, false) != -1)
                        return true;
                  break;
      }
      return annotations().find(data.string, 0, false) != -1;
}


Generated by  Doxygen 1.6.0   Back to index