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
enum Baloo::Query::SortingOption |
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.
◆ setDateFilter()
void Baloo::Query::setDateFilter | ( | int | year, |
int | month = 0 , |
||
int | day = 0 |
||
) |
Filter the results in the specified date range.
The year/month/day may be set to 0 in order to ignore it.
◆ setIncludeFolder()
void Query::setIncludeFolder | ( | const QString & | folder | ) |
◆ setLimit()
void Query::setLimit | ( | uint | limit | ) |
◆ setSearchString()
void Baloo::Query::setSearchString | ( | const QString & | str | ) |
Set some text which should be used to search for Items.
This contain a single word or an entire sentence.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:56:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.