Baloo::Query
#include <Baloo/Query>
Public Types | |
enum | SortingOption { SortNone , SortAuto } |
Public Member Functions | |
Query (const Query &rhs) | |
void | addType (const QString &type) |
void | addTypes (const QStringList &typeList) |
int | dayFilter () const |
ResultIterator | exec () |
QString | includeFolder () const |
uint | limit () const |
int | monthFilter () const |
uint | offset () const |
bool | operator!= (const Query &rhs) const |
Query & | operator= (const Query &rhs) |
bool | operator== (const Query &rhs) const |
QString | searchString () const |
void | setDateFilter (int year, int month=0, int day=0) |
void | setIncludeFolder (const QString &folder) |
void | setLimit (uint limit) |
void | setOffset (uint offset) |
void | setSearchString (const QString &str) |
void | setSortingOption (SortingOption option) |
void | setType (const QString &type) |
void | setTypes (const QStringList &types) |
SortingOption | sortingOption () const |
QByteArray | toJSON () |
QUrl | toSearchUrl (const QString &title=QString()) |
QStringList | types () const |
int | yearFilter () const |
Static Public Member Functions | |
static Query | fromJSON (const QByteArray &arr) |
static Query | fromSearchUrl (const QUrl &url) |
static QString | titleFromQueryUrl (const QUrl &url) |
Detailed Description
The Query class is the central class to query to search for files from the Index.
This class has an inbuilt parser which recognizes words along with AND / OR and parenthesis and specific properties. This can be used with the setSearchString method
Member Enumeration Documentation
◆ SortingOption
Enumerator | |
---|---|
SortNone | The results are returned in the most efficient order. They can be returned in any order. |
SortAuto | The results are returned in the order Baloo decides should be ideal. This criteria is based on the mtime of the file. This is the default sorting mechanism. |
Constructor & Destructor Documentation
◆ Query() [1/2]
◆ Query() [2/2]
Member Function Documentation
◆ addType()
void Query::addType | ( | const QString & | type | ) |
Add a type to the results of the query.
Every file has a higher level type such as "Audio", "Video", "Image", "Document", etc.
Please note that the types are ANDed together. So searching for "Image" and "Video" will probably never return any results. Have a look at KFileMetaData::TypeInfo for a list of type names.
◆ addTypes()
void Query::addTypes | ( | const QStringList & | typeList | ) |
◆ dayFilter()
◆ exec()
◆ fromJSON()
|
static |
◆ fromSearchUrl()
◆ includeFolder()
◆ limit()
◆ monthFilter()
◆ offset()
◆ operator!=()
◆ operator=()
◆ operator==()
◆ searchString()
◆ setDateFilter()
void Query::setDateFilter | ( | int | year, |
int | month = 0, | ||
int | day = 0 ) |
◆ setIncludeFolder()
void Query::setIncludeFolder | ( | const QString & | folder | ) |
◆ setLimit()
void Query::setLimit | ( | uint | limit | ) |
◆ setOffset()
◆ setSearchString()
void Query::setSearchString | ( | const QString & | str | ) |
◆ setSortingOption()
void Query::setSortingOption | ( | Query::SortingOption | option | ) |
◆ setType()
◆ setTypes()
void Query::setTypes | ( | const QStringList & | types | ) |
◆ sortingOption()
Query::SortingOption Query::sortingOption | ( | ) | const |
◆ titleFromQueryUrl()
◆ toJSON()
QByteArray Query::toJSON | ( | ) |
◆ toSearchUrl()
◆ types()
QStringList Query::types | ( | ) | const |
◆ yearFilter()
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.