Sayonara Player
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Library::Filter Class Reference

The Filter class. More...

#include <Filter.h>

Public Types

enum  Mode {
  Fulltext =0,
  Filename,
  Genre,
  Invalid
}
 

Public Member Functions

 Filter (const Filter &other)
 
Filteroperator= (const Filter &other)
 
bool operator== (const Filter &other)
 
int count () const
 
QStringList filtertext (bool with_percent) const
 get splitted filtertext with or without percent. Needed for file search for example where cissearch is not suitable More...
 
QStringList searchModeFiltertext (bool with_percent) const
 get splitted filtertext with or without percent but converts the search string suitable for cissearch first. More...
 
void setFiltertext (const QString &str, SearchModeMask search_mode)
 set comma separated filtertext. Usually this is the string found at the search box in the library More...
 
Filter::Mode mode () const
 Returns the filtermode. More...
 
void setMode (Filter::Mode mode)
 Sets the Filter::Mode. More...
 
void clear ()
 Clear the searchterm. We are not looking for an invalid genre, too.
 
bool cleared () const
 Is the searchterm empty? More...
 
void setInvalidGenre (bool b)
 Sets a genre, which is not searched directly. This is meant to fetch all tracks which contains no genre. More...
 
bool isInvalidGenre () const
 Is the invalid genre mode active? More...
 
bool isUseable () const
 Invalid mode is not usable. Invalid genre means, that this is a valid query -> Usable. When searching for a track, the id needs to be non-negative. When searching for different stuff, the size of the searchstrings needs at least to be 3 characters. More...
 

Static Public Member Functions

static QString text (Mode mode)
 Get an human readable string for the mode. More...
 

Detailed Description

The Filter class.

Member Function Documentation

◆ cleared()

bool Library::Filter::cleared ( ) const

Is the searchterm empty?

Returns
true if the searchterm is empty. If the current mode indicates that we are looking for an invalid genre, false is returned, too

◆ filtertext()

QStringList Library::Filter::filtertext ( bool  with_percent) const

get splitted filtertext with or without percent. Needed for file search for example where cissearch is not suitable

Parameters
with_percentappends and prepends a percent sign to each filtertext
Returns

◆ isInvalidGenre()

bool Library::Filter::isInvalidGenre ( ) const

Is the invalid genre mode active?

Returns

◆ isUseable()

bool Library::Filter::isUseable ( ) const

Invalid mode is not usable. Invalid genre means, that this is a valid query -> Usable. When searching for a track, the id needs to be non-negative. When searching for different stuff, the size of the searchstrings needs at least to be 3 characters.

Returns

◆ mode()

Filter::Mode Library::Filter::mode ( ) const

Returns the filtermode.

Returns

◆ searchModeFiltertext()

QStringList Library::Filter::searchModeFiltertext ( bool  with_percent) const

get splitted filtertext with or without percent but converts the search string suitable for cissearch first.

Parameters
with_percentappends and prepends a percent sign to each filtertext
Returns

◆ setFiltertext()

void Library::Filter::setFiltertext ( const QString &  str,
SearchModeMask  search_mode 
)

set comma separated filtertext. Usually this is the string found at the search box in the library

Parameters
strsearchstring
search_modewhat do we want to search?

◆ setInvalidGenre()

void Library::Filter::setInvalidGenre ( bool  b)

Sets a genre, which is not searched directly. This is meant to fetch all tracks which contains no genre.

Parameters
b

◆ setMode()

void Library::Filter::setMode ( Filter::Mode  mode)

Sets the Filter::Mode.

Parameters
mode

◆ text()

static QString Library::Filter::text ( Mode  mode)
static

Get an human readable string for the mode.

Parameters
mode
Returns