Nepomuk
#include <Nepomuk/Query/FileQuery>

Public Types | |
enum | FileModeFlags { QueryFiles = 0x1 , QueryFolders = 0x2 , QueryFilesAndFolders = QueryFiles|QueryFolders } |
![]() | |
enum | QueryFlag { NoQueryFlags = 0x0 , NoResultRestrictions = 0x1 , WithoutFullTextExcerpt = 0x2 } |
enum | SparqlFlag { NoFlags = 0x0 , CreateCountQuery = 0x1 , HandleInverseProperties = 0x2 , CreateAskQuery = 0x4 } |
Public Member Functions | |
FileQuery () | |
FileQuery (const Query &query) | |
FileQuery (const Term &term) | |
~FileQuery () | |
void | addExcludeFolder (const KUrl &folder) |
void | addIncludeFolder (const KUrl &folder) |
void | addIncludeFolder (const KUrl &folder, bool recursive) |
QHash< KUrl, bool > | allIncludeFolders () const |
KUrl::List | excludeFolders () const |
FileMode | fileMode () const |
KUrl::List | includeFolders () const |
FileQuery & | operator= (const Query &) |
void | setExcludeFolders (const KUrl::List &folders) |
void | setFileMode (FileMode mode) |
void | setIncludeFolders (const KUrl::List &folders) |
void | setIncludeFolders (const QHash< KUrl, bool > &folders) |
![]() | |
Query () | |
Query (const Query &) | |
Query (const Term &term) | |
~Query () | |
void | addRequestProperty (const RequestProperty &property) |
bool | fullTextScoringEnabled () const |
Qt::SortOrder | fullTextScoringSortOrder () const |
bool | isFileQuery () const |
bool | isValid () const |
int | limit () const |
int | offset () const |
bool | operator!= (const Query &query) const |
Query & | operator= (const Query &) |
Query & | operator= (const Term &term) |
bool | operator== (const Query &query) const |
Query | optimized () const |
QueryFlags | queryFlags () const |
QList< RequestProperty > | requestProperties () const |
RequestPropertyMap | requestPropertyMap () const |
void | setFullTextScoringEnabled (bool enabled) |
void | setFullTextScoringSortOrder (Qt::SortOrder order) |
void | setLimit (int) |
void | setOffset (int offset) |
void | setQueryFlags (QueryFlags flags) |
void | setRequestProperties (const QList< RequestProperty > &properties) |
void | setTerm (const Term &) |
Term | term () const |
FileQuery | toFileQuery () const |
KUrl | toSearchUrl (const QString &customTitle, SparqlFlags flags=NoFlags) const |
KUrl | toSearchUrl (SparqlFlags flags=NoFlags) const |
QString | toSparqlQuery (SparqlFlags flags=NoFlags) const |
QString | toString () const |
Additional Inherited Members | |
![]() | |
static Query | fromQueryUrl (const KUrl &url) |
static Query | fromString (const QString &queryString) |
static QString | sparqlFromQueryUrl (const KUrl &url) |
static QString | titleFromQueryUrl (const KUrl &url) |
Detailed Description
A Nepomuk desktop query specialized for file searches.
FileQuery is an extension to Query which adds some syntactic sugar for dealing with file queries. This includes a restriction of the results to files and the possibility to restrict the search to specific folders via setIncludeFolders() and setExcludeFolders().
- Warning
- FileQuery does only return files and folders as results.
- Since
- 4.4
Definition at line 44 of file filequery.h.
Member Enumeration Documentation
◆ FileModeFlags
An enumeration used in setFileMode() to state wether the query should return files and folders or only files or only folders.
- Since
- 4.5
Enumerator | |
---|---|
QueryFiles | |
QueryFolders | |
QueryFilesAndFolders |
Definition at line 167 of file filequery.h.
Constructor & Destructor Documentation
◆ FileQuery() [1/3]
Nepomuk::Query::FileQuery::FileQuery | ( | ) |
Create an empty invalid file query object.
◆ FileQuery() [2/3]
|
explicit |
Create a file query with root term term.
- Since
- 4.6
◆ FileQuery() [3/3]
Nepomuk::Query::FileQuery::FileQuery | ( | const Query & | query | ) |
Copy constructor.
◆ ~FileQuery()
Nepomuk::Query::FileQuery::~FileQuery | ( | ) |
Destructor.
Member Function Documentation
◆ addExcludeFolder()
void Nepomuk::Query::FileQuery::addExcludeFolder | ( | const KUrl & | folder | ) |
Add a folder to exclude from the search.
If exclude folders are set the query will be restricted to files that are not in that folder and its subfolders.
- Parameters
-
folder The folder to exclude from the search.
- See also
- setExcludeFolders, excludeFolders, addIncludeFolder
◆ addIncludeFolder() [1/2]
void Nepomuk::Query::FileQuery::addIncludeFolder | ( | const KUrl & | folder | ) |
Add a folder to include in the search.
If include folders are set the query will be restricted to files from that folders and their subfolders.
- Parameters
-
folder The folder to include in the search.
- See also
- setIncludeFolders, includeFolders, addExcludeFolder
◆ addIncludeFolder() [2/2]
void Nepomuk::Query::FileQuery::addIncludeFolder | ( | const KUrl & | folder, |
bool | recursive | ||
) |
Add a folder to include in the search path.
If include folders are set the query will be restricted to files from that folders and optionally their subfolders.
- Parameters
-
folder The folder to include in the search. recursive If true
subfolders offolder
will be searched, too.
- See also
- setIncludeFolders, includeFolders, addExcludeFolder
- Since
- 4.6
◆ allIncludeFolders()
QHash< KUrl, bool > Nepomuk::Query::FileQuery::allIncludeFolders | ( | ) | const |
The hash of include folders set via addIncludeFolder() and setIncludeFolders() including their recursive flag.
- Since
- 4.6
◆ excludeFolders()
KUrl::List Nepomuk::Query::FileQuery::excludeFolders | ( | ) | const |
The list of exclude folders set via addExcludeFolder() and setExcludeFolders().
- See also
- addExcludeFolder, setExcludeFolders, includeFolders
◆ fileMode()
FileMode Nepomuk::Query::FileQuery::fileMode | ( | ) | const |
- Returns
- The file mode set in setFileMode()
- Since
- 4.5
◆ includeFolders()
KUrl::List Nepomuk::Query::FileQuery::includeFolders | ( | ) | const |
The list of include folders set via addIncludeFolder() and setIncludeFolders().
◆ operator=()
◆ setExcludeFolders()
void Nepomuk::Query::FileQuery::setExcludeFolders | ( | const KUrl::List & | folders | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
folders The folders to exclude from the search.
- See also
- addExcludeFolder, excludeFolders, setIncludeFolders
◆ setFileMode()
void Nepomuk::Query::FileQuery::setFileMode | ( | FileMode | mode | ) |
Set the file mode, i.e.
wether the query should return files and folders or only files or only folders. By default both files and folders are returned.
- See also
- fileMode()
- Since
- 4.5
◆ setIncludeFolders() [1/2]
void Nepomuk::Query::FileQuery::setIncludeFolders | ( | const KUrl::List & | folders | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
folders The folders to include in the search.
- See also
- addIncludeFolder, includeFolders, setExcludeFolders
◆ setIncludeFolders() [2/2]
void Nepomuk::Query::FileQuery::setIncludeFolders | ( | const QHash< KUrl, bool > & | folders | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
folders A hash of the folders to include in the search and their recursive flag.
- Since
- 4.6
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.