The Filter class.
More...
#include <Filter.h>
|
enum | Mode {
Fulltext =0,
Filename,
Genre,
Invalid
} |
|
|
| Filter (const Filter &other) |
|
Filter & | operator= (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 QString | text (Mode mode) |
| Get an human readable string for the mode. More...
|
|
◆ 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_percent | appends 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_percent | appends 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
-
str | searchstring |
search_mode | what 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
-
◆ setMode()
void Library::Filter::setMode |
( |
Filter::Mode |
mode | ) |
|
Sets the Filter::Mode.
- Parameters
-
◆ text()
static QString Library::Filter::text |
( |
Mode |
mode | ) |
|
|
static |
Get an human readable string for the mode.
- Parameters
-
- Returns