#include <tdefilefilter.h>
Public Member Functions | |
KSimpleFileFilter () | |
virtual void | setFilterDotFiles (bool filter) |
bool | filterDotFiles () const |
virtual void | setFilterSpecials (bool filter) |
bool | filterSpecials () const |
void | setNameFilters (const TQString &nameFilters, bool caseSensitive, const TQChar &separator=' ') |
virtual void | setNameFilters (const TQString &nameFilters) |
virtual void | setMimeFilters (const TQStringList &mimeFilters) |
TQStringList | mimeFilters () const |
virtual void | setModeFilter (mode_t mode) |
mode_t | modeFilter () const |
virtual bool | passesFilter (const KFileItem *item) const |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
TQPtrList< TQRegExp > | m_nameFilters |
Detailed Description
A simple file filter that can filter hidden dot files, by name, by mime type and by mode.
A simple file filter.
Definition at line 59 of file tdefilefilter.h.
Constructor & Destructor Documentation
◆ KSimpleFileFilter()
KSimpleFileFilter::KSimpleFileFilter | ( | ) |
Creates a new filter.
By default, it filters only hidden dot files and "." and "..".
Definition at line 28 of file tdefilefilter.cpp.
Member Function Documentation
◆ filterDotFiles()
|
inline |
Checks whether filtering dot files is enabled.
This option is enabled by default.
- Returns
- true if filtering is enabled, false otherwise
- See also
- setFilterDotFiles
Definition at line 83 of file tdefilefilter.h.
◆ filterSpecials()
|
inline |
Checks whether it filters "." and "..", default is true.
- Returns
- true if enabled, false otherwise
Definition at line 94 of file tdefilefilter.h.
◆ mimeFilters()
|
inline |
Returns the list of mime types.
- Returns
- the list of mime types
- See also
- mimeFilter
Definition at line 131 of file tdefilefilter.h.
◆ modeFilter()
|
inline |
Returns the mode filter, as set by setModeFilter().
- Returns
- the mode filter, 0 if disabled
- See also
- setModeFilter
Definition at line 147 of file tdefilefilter.h.
◆ passesFilter()
|
virtual |
Checks the given item
.
- Parameters
-
item the item to filter
- Returns
- true if the
item
passes the filter, false otherwise
Implements KFileFilter.
Definition at line 80 of file tdefilefilter.cpp.
◆ setFilterDotFiles()
|
virtual |
Enable or disable filtering hidden dot files.
This option is enabled by default.
- Parameters
-
filter true to enable filtering dot files, false to disable
- See also
- filterDotFiles
Definition at line 40 of file tdefilefilter.cpp.
◆ setFilterSpecials()
|
virtual |
Filters "." and "..", default is true.
- Parameters
-
filter true to enable, false otherwise
Definition at line 45 of file tdefilefilter.cpp.
◆ setMimeFilters()
|
virtual |
Sets a list of mime filters.
A file can only pass if its mime type is contained in this list.
- Parameters
-
mimeFilters the list of mime types
- See also
- setMimeFilter
Definition at line 70 of file tdefilefilter.cpp.
◆ setModeFilter()
|
virtual |
Sets the mode filter.
If the mode
is 0, the filter is disabled. When enabled, a file will only pass if the files mode ANDed with mode
is not zero.
- Parameters
-
mode the new mode. 0 to disable
- See also
- modeFilter
Definition at line 75 of file tdefilefilter.cpp.
◆ setNameFilters() [1/2]
|
virtual |
Sets a list of regular expressions to filter by name.
The file will only pass if its name matches one of the regular expressions.
- Parameters
-
nameFilters a list of regular expressions, separated by space (' ')
Definition at line 50 of file tdefilefilter.cpp.
◆ setNameFilters() [2/2]
void KSimpleFileFilter::setNameFilters | ( | const TQString & | nameFilters, |
bool | caseSensitive, | ||
const TQChar & | separator = ' ' |
||
) |
Sets a list of regular expressions to filter by name.
The file will only pass if its name matches one of the regular expressions.
- Parameters
-
nameFilters a list of regular expressions, separated by the character separator
caseSensitive if true, matches case sensitive. False otherwise separator the separator in the nameFilter
- Since
- 3.1
Definition at line 56 of file tdefilefilter.cpp.
The documentation for this class was generated from the following files: