.TH "KDirLister" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDirLister \- The dir lister deals with the kiojob used to list and update a directory and has signals for the user of this class (e.g. Helper class for the kiojob used to list and update a directory.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kdirlister.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
Inherited by \fBKFileTreeBranch\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBWhichItems\fP { \fBAllItems\fP =  0, \fBFilteredItems\fP =  1 }"
.br
.RI "\fIUsed by \fBitems\fP() and \fBitemsForDir\fP() to specify whether you want all items for a directory or just the filtered ones. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBstarted\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fITell the view that we started to list \fC_url\fP. \fP"
.ti -1c
.RI "void \fBcompleted\fP ()"
.br
.RI "\fITell the view that listing is finished. \fP"
.ti -1c
.RI "void \fBcompleted\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fITell the view that the listing of the directory \fC_url\fP is finished. \fP"
.ti -1c
.RI "void \fBcanceled\fP ()"
.br
.RI "\fITell the view that the user canceled the listing. \fP"
.ti -1c
.RI "void \fBcanceled\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fITell the view that the listing of the directory \fC_url\fP was canceled. \fP"
.ti -1c
.RI "void \fBredirection\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fISignal a redirection. \fP"
.ti -1c
.RI "void \fBredirection\fP (const  \fBKURL\fP &oldUrl, const  \fBKURL\fP &newUrl)"
.br
.RI "\fISignal a redirection. \fP"
.ti -1c
.RI "void \fBclear\fP ()"
.br
.RI "\fISignal to clear all items. \fP"
.ti -1c
.RI "void \fBclear\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fISignal to empty the directory \fC_url\fP. \fP"
.ti -1c
.RI "void \fBnewItems\fP (const  \fBKFileItemList\fP &items)"
.br
.RI "\fISignal new items. \fP"
.ti -1c
.RI "void \fBitemsFilteredByMime\fP (const  \fBKFileItemList\fP &items)"
.br
.RI "\fISend a list of items filtered-out by mime-type. \fP"
.ti -1c
.RI "void \fBdeleteItem\fP (\fBKFileItem\fP *_fileItem)"
.br
.RI "\fISignal an item to remove. \fP"
.ti -1c
.RI "void \fBrefreshItems\fP (const  \fBKFileItemList\fP &items)"
.br
.RI "\fISignal an item to refresh (its mimetype/icon/name has changed). \fP"
.ti -1c
.RI "void \fBinfoMessage\fP (const  \fBQString\fP &msg)"
.br
.RI "\fIEmitted to display information about running jobs. \fP"
.ti -1c
.RI "void \fBpercent\fP (int percent)"
.br
.RI "\fIProgress signal showing the overall progress of the KDirLister. \fP"
.ti -1c
.RI "void \fBtotalSize\fP (KIO::filesize_t size)"
.br
.RI "\fIEmitted when we know the size of the jobs. \fP"
.ti -1c
.RI "void \fBprocessedSize\fP (KIO::filesize_t size)"
.br
.RI "\fIRegularly emitted to show the progress of this KDirLister. \fP"
.ti -1c
.RI "void \fBspeed\fP (int bytes_per_second)"
.br
.RI "\fIEmitted to display information about the speed of the jobs. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDirLister\fP (bool _delayedMimeTypes=false)"
.br
.RI "\fICreate a directory lister. \fP"
.ti -1c
.RI "virtual \fB~KDirLister\fP ()"
.br
.RI "\fIDestroy the directory lister. \fP"
.ti -1c
.RI "virtual bool \fBopenURL\fP (const  \fBKURL\fP &_url, bool _keep=false, bool _reload=false)"
.br
.RI "\fIRun the directory lister on the given url. \fP"
.ti -1c
.RI "virtual void \fBstop\fP ()"
.br
.RI "\fIStop listing all directories currently being listed. \fP"
.ti -1c
.RI "virtual void \fBstop\fP (const  \fBKURL\fP &_url)"
.br
.RI "\fIStop listing the given directory. \fP"
.ti -1c
.RI "bool \fBautoUpdate\fP () const "
.br
.RI "\fIChecks whether \fBKDirWatch\fP will automatically update directories. \fP"
.ti -1c
.RI "virtual void \fBsetAutoUpdate\fP (bool enable)"
.br
.RI "\fIEnable/disable automatic directory updating, when a directory changes (using \fBKDirWatch\fP). \fP"
.ti -1c
.RI "bool \fBautoErrorHandlingEnabled\fP () const "
.br
.RI "\fICheck whether auto error handling is enabled. \fP"
.ti -1c
.RI "void \fBsetAutoErrorHandlingEnabled\fP (bool enable, \fBQWidget\fP *\fBparent\fP)"
.br
.RI "\fIEnable or disable auto error handling is enabled. \fP"
.ti -1c
.RI "bool \fBshowingDotFiles\fP () const "
.br
.RI "\fIChecks whether hidden files (files beginning with a dot) will be shown. \fP"
.ti -1c
.RI "virtual void \fBsetShowingDotFiles\fP (bool _showDotFiles)"
.br
.RI "\fIChanges the 'is viewing dot files' setting. \fP"
.ti -1c
.RI "bool \fBdirOnlyMode\fP () const "
.br
.RI "\fIChecks whether the KDirLister only lists directories or all files. \fP"
.ti -1c
.RI "virtual void \fBsetDirOnlyMode\fP (bool dirsOnly)"
.br
.RI "\fICall this to list only directories. \fP"
.ti -1c
.RI "const  \fBKURL\fP & \fBurl\fP () const "
.br
.RI "\fIReturns the URL that is listed by this KDirLister. \fP"
.ti -1c
.RI "virtual void \fBemitChanges\fP ()"
.br
.RI "\fIActually emit the changes made with setShowingDotFiles, setDirOnlyMode, setNameFilter and setMimeFilter. \fP"
.ti -1c
.RI "virtual void \fBupdateDirectory\fP (const  \fBKURL\fP &_dir)"
.br
.RI "\fIUpdate the directory \fC_dir\fP. \fP"
.ti -1c
.RI "bool \fBisFinished\fP () const "
.br
.RI "\fIReturns true if no io operation is currently in progress. \fP"
.ti -1c
.RI "\fBKFileItem\fP * \fBrootItem\fP () const "
.br
.RI "\fIReturns the file item of the URL. \fP"
.ti -1c
.RI "virtual \fBKFileItem\fP * \fBfindByURL\fP (const  \fBKURL\fP &_url) const "
.br
.RI "\fIFind an item by its URL. \fP"
.ti -1c
.RI "\fBKFileItem\fP * \fBfind\fP (const  \fBKURL\fP &_url) const "
.br
.ti -1c
.RI "virtual \fBKFileItem\fP * \fBfindByName\fP (const  \fBQString\fP &\fBname\fP) const "
.br
.RI "\fIFind an item by its name. \fP"
.ti -1c
.RI "virtual void \fBsetNameFilter\fP (const  \fBQString\fP &filter)"
.br
.RI "\fISet a name filter to only list items matching this name, e.g. \fP"
.ti -1c
.RI "const  \fBQString\fP & \fBnameFilter\fP () const "
.br
.RI "\fIReturns the current name filter, as set via \fBsetNameFilter\fP(). \fP"
.ti -1c
.RI "virtual void \fBsetMimeFilter\fP (const  \fBQStringList\fP &mimeList)"
.br
.RI "\fISet mime-based filter to only list items matching the given mimetypes. \fP"
.ti -1c
.RI "void \fBsetMimeExcludeFilter\fP (const  \fBQStringList\fP &mimeList)"
.br
.RI "\fIFiltering should be done with KFileFilter. \fP"
.ti -1c
.RI "virtual void \fBclearMimeFilter\fP ()"
.br
.RI "\fIClears the mime based filter. \fP"
.ti -1c
.RI "const  \fBQStringList\fP & \fBmimeFilters\fP () const "
.br
.RI "\fIReturns the list of mime based filters, as set via \fBsetMimeFilter\fP(). \fP"
.ti -1c
.RI "bool \fBmatchesFilter\fP (const  \fBQString\fP &\fBname\fP) const "
.br
.RI "\fIChecks whether \fCname\fP matches a filter in the list of name filters. \fP"
.ti -1c
.RI "bool \fBmatchesMimeFilter\fP (const  \fBQString\fP &mime) const "
.br
.RI "\fIChecks whether \fCmime\fP matches a filter in the list of mime types. \fP"
.ti -1c
.RI "void \fBsetMainWindow\fP (\fBQWidget\fP *window)"
.br
.RI "\fIPass the main window this object is associated with this is used for caching authentication data. \fP"
.ti -1c
.RI "\fBQWidget\fP * \fBmainWindow\fP ()"
.br
.RI "\fIReturns the main window associated with this object. \fP"
.ti -1c
.RI "\fBKFileItemList\fP \fBitems\fP (\fBWhichItems\fP which=FilteredItems) const "
.br
.RI "\fIReturns the items listed for the current \fBurl\fP(). \fP"
.ti -1c
.RI "\fBKFileItemList\fP \fBitemsForDir\fP (const  \fBKURL\fP &dir, \fBWhichItems\fP which=FilteredItems) const "
.br
.RI "\fIReturns the items listed for the given \fCdir\fP. \fP"
.in -1c
.SS "Protected Types"

.in +1c
.ti -1c
.RI "enum \fBChanges\fP { \fBNONE\fP = 0, \fBNAME_FILTER\fP = 1, \fBMIME_FILTER\fP = 2, \fBDOT_FILES\fP = 4, \fBDIR_ONLY_MODE\fP = 8 }"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBmatchesFilter\fP (const  \fBKFileItem\fP *) const "
.br
.RI "\fICalled for every new item before emitting \fBnewItems\fP(). \fP"
.ti -1c
.RI "virtual bool \fBmatchesMimeFilter\fP (const  \fBKFileItem\fP *) const "
.br
.RI "\fICalled for every new item before emitting \fBnewItems\fP(). \fP"
.ti -1c
.RI "virtual bool \fBdoNameFilter\fP (const  \fBQString\fP &\fBname\fP, const  \fBQPtrList\fP< \fBQRegExp\fP > &filters) const "
.br
.RI "\fICalled by the public \fBmatchesFilter\fP() to do the actual filtering. \fP"
.ti -1c
.RI "virtual bool \fBdoMimeFilter\fP (const  \fBQString\fP &mime, const  \fBQStringList\fP &filters) const "
.br
.RI "\fICalled by the public \fBmatchesMimeFilter\fP() to do the actual filtering. \fP"
.ti -1c
.RI "bool \fBdoMimeExcludeFilter\fP (const  \fBQString\fP &mimeExclude, const  \fBQStringList\fP &filters) const "
.br
.ti -1c
.RI "virtual bool \fBvalidURL\fP (const  \fBKURL\fP &) const "
.br
.RI "\fIChecks if an url is malformed or not and displays an error message if it is and autoErrorHandling is set to true. \fP"
.ti -1c
.RI "virtual void \fBhandleError\fP (\fBKIO::Job\fP *)"
.br
.RI "\fIReimplement to customize error handling. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKDirListerPrivate\fP"
.br
.ti -1c
.RI "class \fBKDirListerCache\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
The dir lister deals with the kiojob used to list and update a directory and has signals for the user of this class (e.g. Helper class for the kiojob used to list and update a directory. 

konqueror view or kdesktop) to create/destroy its items when asked.
.PP
This class is independent from the graphical representation of the dir (icon container, tree view, ...) and it stores the items (as KFileItems).
.PP
Typical usage : 
.IP "\(bu" 2
Create an instance. 
.IP "\(bu" 2
Connect to at least update, clear, newItem, and deleteItem. 
.IP "\(bu" 2
Call openURL - the signals will be called. 
.IP "\(bu" 2
Reuse the instance when opening a new url (openURL). 
.IP "\(bu" 2
Destroy the instance when not needed anymore (usually destructor).
.PP
Advanced usage : call openURL with _keep = true to list directories without forgetting the ones previously read (e.g. for a tree view)
.PP
Definition at line 54 of file kdirlister.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKDirLister::WhichItems\fP"
.PP
Used by \fBitems\fP() and \fBitemsForDir\fP() to specify whether you want all items for a directory or just the filtered ones. Definition at line 350 of file kdirlister.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDirLister::KDirLister (bool _delayedMimeTypes = false)"
.PP
Create a directory lister. \fBParameters:\fP
.RS 4
\fI_delayedMimeTypes\fP if true, mime types will be fetched on demand. If false, they will always be fetched immediately 
.RE
.PP
Definition at line 1512 of file kdirlister.cpp.
.PP
References setAutoErrorHandlingEnabled(), setAutoUpdate(), setDirOnlyMode(), and setShowingDotFiles().
.SS "KDirLister::~\fBKDirLister\fP ()\fC [virtual]\fP"
.PP
Destroy the directory lister. Definition at line 1526 of file kdirlister.cpp.
.PP
References stop().
.SH "Member Function Documentation"
.PP 
.SS "bool KDirLister::openURL (const \fBKURL\fP & _url, bool _keep = false, bool _reload = false)\fC [virtual]\fP"
.PP
Run the directory lister on the given url. This method causes KDirLister to emit _all_ the items of \fC_url\fP, in any case. Depending on \fC_keep\fP either \fBclear\fP() or \fBclear\fP(const \fBKURL\fP &) will be emitted first.
.PP
The \fBnewItems\fP() signal may be emitted more than once to supply you with KFileItems, up until the signal \fBcompleted\fP() is emitted (and \fBisFinished\fP() returns true).
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the directory URL. 
.br
\fI_keep\fP if true the previous directories aren't forgotten (they are still watched by kdirwatch and their items are kept for this KDirLister). This is useful for e.g. a treeview. 
.br
\fI_reload\fP indicates wether to use the cache (false) or to reread the directory from the disk. Use only when opening a dir not yet listed by this lister without using the cache. Otherwise use updateDirectory. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise (e.g. invalid \fC_url\fP) 
.RE
.PP
Definition at line 1535 of file kdirlister.cpp.
.PP
References emitChanges(), KURL::prettyURL(), and validURL().
.PP
Referenced by KFileTreeBranch::populate(), KDirOperator::rereadDir(), and KDirOperator::setURL().
.SS "void KDirLister::stop ()\fC [virtual]\fP"
.PP
Stop listing all directories currently being listed. Emits \fBcanceled\fP() if there was at least one job running. Emits \fBcanceled\fP( const \fBKURL\fP& ) for each stopped job if there are at least two dirctories being watched by KDirLister. Definition at line 1554 of file kdirlister.cpp.
.PP
Referenced by KDirOperator::close(), and ~KDirLister().
.SS "void KDirLister::stop (const \fBKURL\fP & _url)\fC [virtual]\fP"
.PP
Stop listing the given directory. Emits \fBcanceled\fP() if the killed job was the last running one. Emits \fBcanceled\fP( const \fBKURL\fP& ) for the killed job if there are at least two directories being watched by KDirLister. No signal is emitted if there was no job running for \fC_url\fP. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the directory URL 
.RE
.PP
Definition at line 1560 of file kdirlister.cpp.
.PP
References KURL::prettyURL().
.SS "bool KDirLister::autoUpdate () const"
.PP
Checks whether \fBKDirWatch\fP will automatically update directories. This is enabled by default. 
.PP
\fBReturns:\fP
.RS 4
true if \fBKDirWatch\fP is used to automatically update directories. 
.RE
.PP
Definition at line 1566 of file kdirlister.cpp.
.SS "void KDirLister::setAutoUpdate (bool enable)\fC [virtual]\fP"
.PP
Enable/disable automatic directory updating, when a directory changes (using \fBKDirWatch\fP). \fBParameters:\fP
.RS 4
\fIenable\fP true to enable, false to disable 
.RE
.PP
Definition at line 1571 of file kdirlister.cpp.
.PP
Referenced by KDirLister(), and KDirOperator::setDirLister().
.SS "bool KDirLister::autoErrorHandlingEnabled () const"
.PP
Check whether auto error handling is enabled. If enabled, it will show an error dialog to the user when an error occurs. It is turned on by default. 
.PP
\fBReturns:\fP
.RS 4
true if auto error handling is enabled, false otherwise 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoErrorHandlingEnabled()\fP 
.RE
.PP
Definition at line 1608 of file kdirlister.cpp.
.SS "void KDirLister::setAutoErrorHandlingEnabled (bool enable, \fBQWidget\fP * parent)"
.PP
Enable or disable auto error handling is enabled. If enabled, it will show an error dialog to the user when an error occurs. It is turned on by default. 
.PP
\fBParameters:\fP
.RS 4
\fIenable\fP true to enable auto error handling, false to disable 
.br
\fIparent\fP the parent widget for the error dialogs, can be 0 for top-level 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBautoErrorHandlingEnabled()\fP 
.RE
.PP
Definition at line 1613 of file kdirlister.cpp.
.PP
Referenced by KDirLister().
.SS "bool KDirLister::showingDotFiles () const"
.PP
Checks whether hidden files (files beginning with a dot) will be shown. By default this option is disabled (hidden files will be not shown). 
.PP
\fBReturns:\fP
.RS 4
true if dot files are shown, false otherwise 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetShowingDotFiles()\fP 
.RE
.PP
Definition at line 1580 of file kdirlister.cpp.
.SS "void KDirLister::setShowingDotFiles (bool _showDotFiles)\fC [virtual]\fP"
.PP
Changes the 'is viewing dot files' setting. Calls \fBupdateDirectory\fP() if setting changed. By default this option is disabled (hidden files will not be shown). 
.PP
\fBParameters:\fP
.RS 4
\fI_showDotFiles\fP true to enable showing hidden files, false to disable 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBshowingDotFiles()\fP 
.RE
.PP
Definition at line 1585 of file kdirlister.cpp.
.PP
Referenced by KDirLister(), KFileTreeBranch::KFileTreeBranch(), and KDirOperator::readConfig().
.SS "bool KDirLister::dirOnlyMode () const"
.PP
Checks whether the KDirLister only lists directories or all files. By default this option is disabled (all files will be shown). 
.PP
\fBReturns:\fP
.RS 4
true if setDirOnlyMode(true) was called 
.RE
.PP
Definition at line 1594 of file kdirlister.cpp.
.SS "void KDirLister::setDirOnlyMode (bool dirsOnly)\fC [virtual]\fP"
.PP
Call this to list only directories. By default this option is disabled (all files will be shown). 
.PP
\fBParameters:\fP
.RS 4
\fIdirsOnly\fP true to list only directories 
.RE
.PP
Definition at line 1599 of file kdirlister.cpp.
.PP
Referenced by KDirLister(), KFileTreeView::setDirOnlyMode(), and KDirOperator::setMode().
.SS "const  \fBKURL\fP & KDirLister::url () const"
.PP
Returns the URL that is listed by this KDirLister. It might be different from the one given with \fBopenURL\fP(). if there was a redirection. If you called \fBopenURL\fP() with \fC_keep\fP == true, this is the first url opened (in e.g. a treeview this is the root).
.PP
\fBReturns:\fP
.RS 4
the url used by this instance to list the files. 
.RE
.PP
Definition at line 1619 of file kdirlister.cpp.
.PP
Referenced by items().
.SS "void KDirLister::emitChanges ()\fC [virtual]\fP"
.PP
Actually emit the changes made with setShowingDotFiles, setDirOnlyMode, setNameFilter and setMimeFilter. Definition at line 1624 of file kdirlister.cpp.
.PP
References QPtrListIterator::current(), deleteItem(), doMimeFilter(), doNameFilter(), QValueList< KURL >::Iterator(), and KGlobal::staticQString().
.PP
Referenced by openURL(), and KDirOperator::updateDir().
.SS "void KDirLister::updateDirectory (const \fBKURL\fP & _dir)\fC [virtual]\fP"
.PP
Update the directory \fC_dir\fP. This method causes KDirLister to _only_ emit the items of \fC_dir\fP that actually changed compared to the current state in the cache and updates the cache.
.PP
The current implementation calls updateDirectory automatically for local files, using \fBKDirWatch\fP (if \fBautoUpdate()\fP is true), but it might be useful to force an update manually.
.PP
\fBParameters:\fP
.RS 4
\fI_dir\fP the directory URL 
.RE
.PP
Definition at line 1713 of file kdirlister.cpp.
.SS "bool KDirLister::isFinished () const"
.PP
Returns true if no io operation is currently in progress. \fBReturns:\fP
.RS 4
true if finished, false otherwise 
.RE
.PP
Definition at line 1718 of file kdirlister.cpp.
.SS "\fBKFileItem\fP * KDirLister::rootItem () const"
.PP
Returns the file item of the URL. \fBReturns:\fP
.RS 4
the file item for \fBurl()\fP itself ('.') 
.RE
.PP
Definition at line 1723 of file kdirlister.cpp.
.SS "\fBKFileItem\fP * KDirLister::findByURL (const \fBKURL\fP & _url) const\fC [virtual]\fP"
.PP
Find an item by its URL. \fBParameters:\fP
.RS 4
\fI_url\fP the item URL 
.RE
.PP
\fBReturns:\fP
.RS 4
the pointer to the \fBKFileItem\fP 
.RE
.PP
Definition at line 1728 of file kdirlister.cpp.
.PP
Referenced by KFileTreeBranch::findTVIByURL().
.SS "\fBKFileItem\fP * KDirLister::findByName (const \fBQString\fP & name) const\fC [virtual]\fP"
.PP
Find an item by its name. \fBParameters:\fP
.RS 4
\fIname\fP the item name 
.RE
.PP
\fBReturns:\fP
.RS 4
the pointer to the \fBKFileItem\fP 
.RE
.PP
Definition at line 1733 of file kdirlister.cpp.
.PP
Referenced by KDirOperator::setCurrentItem().
.SS "void KDirLister::setNameFilter (const \fBQString\fP & filter)\fC [virtual]\fP"
.PP
Set a name filter to only list items matching this name, e.g. '*.cpp'.
.PP
You can set more than one filter by separating them with whitespace, e.g '*.cpp *.h'. Note: the direcory is not automatically reloaded.
.PP
\fBParameters:\fP
.RS 4
\fIfiler\fP the new filter, QString::null to disable filtering 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmatchesFilter\fP 
.RE
.PP
Definition at line 1748 of file kdirlister.cpp.
.PP
References QStringList::split().
.PP
Referenced by KDirOperator::clearFilter(), and KDirOperator::setNameFilter().
.SS "const  \fBQString\fP & KDirLister::nameFilter () const"
.PP
Returns the current name filter, as set via \fBsetNameFilter\fP(). \fBReturns:\fP
.RS 4
the current name filter, can be QString::null if filtering is turned off 
.RE
.PP
Definition at line 1769 of file kdirlister.cpp.
.PP
Referenced by KDirOperator::nameFilter().
.SS "void KDirLister::setMimeFilter (const \fBQStringList\fP & mimeList)\fC [virtual]\fP"
.PP
Set mime-based filter to only list items matching the given mimetypes. NOTE: setting the filter does not automatically reload direcory. Also calling this function will not affect any named filter already set.
.PP
\fBParameters:\fP
.RS 4
\fImimeList\fP a list of mime-types.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBclearMimeFilter\fP 
.PP
\fBmatchesMimeFilter\fP 
.RE
.PP
Definition at line 1774 of file kdirlister.cpp.
.PP
Referenced by KDirOperator::setMimeFilter().
.SS "void KDirLister::setMimeExcludeFilter (const \fBQStringList\fP & mimeList)"
.PP
Filtering should be done with KFileFilter. This will be implemented in a later revision of KDirLister. This method may be removed then.
.PP
Set mime-based exclude filter to only list items not matching the given mimetypes
.PP
NOTE: setting the filter does not automatically reload direcory. Also calling this function will not affect any named filter already set.
.PP
\fBParameters:\fP
.RS 4
\fImimeList\fP a list of mime-types. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBclearMimeFilter\fP 
.PP
\fBmatchesMimeFilter\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1788 of file kdirlister.cpp.
.SS "void KDirLister::clearMimeFilter ()\fC [virtual]\fP"
.PP
Clears the mime based filter. \fBSee also:\fP
.RS 4
\fBsetMimeFilter\fP 
.RE
.PP
Definition at line 1798 of file kdirlister.cpp.
.PP
Referenced by KDirOperator::clearFilter().
.SS "const  \fBQStringList\fP & KDirLister::mimeFilters () const"
.PP
Returns the list of mime based filters, as set via \fBsetMimeFilter\fP(). \fBReturns:\fP
.RS 4
the list of mime based filters. Empty, when no mime filter is set. 
.RE
.PP
Definition at line 1810 of file kdirlister.cpp.
.PP
Referenced by KDirOperator::mimeFilter().
.SS "bool KDirLister::matchesFilter (const \fBQString\fP & name) const"
.PP
Checks whether \fCname\fP matches a filter in the list of name filters. \fBReturns:\fP
.RS 4
true if \fCname\fP matches a filter in the list, otherwise false. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetNameFilter\fP 
.RE
.PP
Definition at line 1815 of file kdirlister.cpp.
.PP
References doNameFilter(), and KStdAccel::name().
.PP
Referenced by itemsForDir(), and matchesFilter().
.SS "bool KDirLister::matchesMimeFilter (const \fBQString\fP & mime) const"
.PP
Checks whether \fCmime\fP matches a filter in the list of mime types. \fBParameters:\fP
.RS 4
\fImime\fP the mimetype to find in the filter list. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if \fCname\fP matches a filter in the list, otherwise false. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetMimeFilter\fP. 
.RE
.PP
Definition at line 1820 of file kdirlister.cpp.
.PP
References doMimeFilter().
.PP
Referenced by itemsForDir(), and matchesMimeFilter().
.SS "void KDirLister::setMainWindow (\fBQWidget\fP * window)"
.PP
Pass the main window this object is associated with this is used for caching authentication data. \fBParameters:\fP
.RS 4
\fIwindow\fP the window to associate with, 0 to disassociate 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2094 of file kdirlister.cpp.
.SS "\fBQWidget\fP * KDirLister::mainWindow ()"
.PP
Returns the main window associated with this object. \fBReturns:\fP
.RS 4
the associated main window, or 0 if there is none 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2099 of file kdirlister.cpp.
.SS "\fBKFileItemList\fP KDirLister::items (\fBWhichItems\fP which = FilteredItems) const"
.PP
Returns the items listed for the current \fBurl\fP(). This method will NOT start listing a directory, you should only call this when receiving the \fBfinished\fP() signal.
.PP
The items in the \fBKFileItemList\fP are references to the items used by KDirLister, so e.g. an item gets destroyed when the \fBdeleteItem\fP() signal is emitted.
.PP
\fBParameters:\fP
.RS 4
\fIwhich\fP specifies whether the returned list will contain all entries or only the ones that passed the \fBnameFilter\fP(), \fBmimeFilter\fP(), etc. Note that the latter causes iteration over all the items, filtering them. If this is too slow for you, use the \fBnewItems\fP() signal, sending out filtered items in chunks. 
.RE
.PP
\fBReturns:\fP
.RS 4
the items listed for the current \fBurl\fP(). 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2104 of file kdirlister.cpp.
.PP
References itemsForDir(), and url().
.SS "\fBKFileItemList\fP KDirLister::itemsForDir (const \fBKURL\fP & dir, \fBWhichItems\fP which = FilteredItems) const"
.PP
Returns the items listed for the given \fCdir\fP. This method will NOT start listing \fCdir\fP, you should only call this when receiving the \fBfinished\fP() signal.
.PP
The items in the \fBKFileItemList\fP are references to the items used by KDirLister, so e.g. an item gets destroyed when the \fBdeleteItem\fP() signal is emitted.
.PP
\fBParameters:\fP
.RS 4
\fIdir\fP specifies the url for which the items should be returned. This is only useful if you use KDirLister with multiple URLs i.e. using bool keep = true in \fBopenURL\fP(). 
.br
\fIwhich\fP specifies whether the returned list will contain all entries or only the ones that passed the nameFilter, mimeFilter, etc. Note that the latter causes iteration over all the items, filtering them. If this is too slow for you, use the \fBnewItems\fP() signal, sending out filtered items in chunks. 
.RE
.PP
\fBReturns:\fP
.RS 4
the items listed for the current \fBurl\fP(). 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2109 of file kdirlister.cpp.
.PP
References QPtrList::append(), QPtrListIterator::current(), KFileItem::isDir(), matchesFilter(), and matchesMimeFilter().
.PP
Referenced by items().
.SS "void KDirLister::started (const \fBKURL\fP & _url)\fC [signal]\fP"
.PP
Tell the view that we started to list \fC_url\fP. NOTE: this does _not_ imply that there is really a job running! I.e. KDirLister::jobs() may return an empty list. In this case the items are taken from the cache.
.PP
The view knows that openURL should start it, so it might seem useless, but the view also needs to know when an automatic update happens. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the URL to list 
.RE
.PP
Referenced by KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::completed ()\fC [signal]\fP"
.PP
Tell the view that listing is finished. There are no jobs running anymore. Referenced by KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::completed (const \fBKURL\fP & _url)\fC [signal]\fP"
.PP
Tell the view that the listing of the directory \fC_url\fP is finished. There might be other running jobs left. This signal is only emitted if KDirLister is watching more than one directory. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the directory URL 
.RE
.PP

.SS "void KDirLister::canceled ()\fC [signal]\fP"
.PP
Tell the view that the user canceled the listing. No running jobs are left. Referenced by KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::canceled (const \fBKURL\fP & _url)\fC [signal]\fP"
.PP
Tell the view that the listing of the directory \fC_url\fP was canceled. There might be other running jobs left. This signal is only emitted if KDirLister is watching more than one directory. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the directory URL 
.RE
.PP

.SS "void KDirLister::redirection (const \fBKURL\fP & _url)\fC [signal]\fP"
.PP
Signal a redirection. Only emitted if there's just one directory to list, i.e. most probably \fBopenURL\fP() has been called with  == false. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the new URL 
.RE
.PP
Referenced by KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::redirection (const \fBKURL\fP & oldUrl, const \fBKURL\fP & newUrl)\fC [signal]\fP"
.PP
Signal a redirection. \fBParameters:\fP
.RS 4
\fIoldUrl\fP the original URL 
.br
\fInewUrl\fP the new URL 
.RE
.PP

.SS "void KDirLister::clear ()\fC [signal]\fP"
.PP
Signal to clear all items. It must always be connected to this signal to avoid doubled items! Referenced by KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::clear (const \fBKURL\fP & _url)\fC [signal]\fP"
.PP
Signal to empty the directory \fC_url\fP. It is only emitted if the lister is holding more than one directory. 
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the directory that will be emptied 
.RE
.PP

.SS "void KDirLister::newItems (const \fBKFileItemList\fP & items)\fC [signal]\fP"
.PP
Signal new items. \fBParameters:\fP
.RS 4
\fIitems\fP a list of new items 
.RE
.PP
Referenced by KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::itemsFilteredByMime (const \fBKFileItemList\fP & items)\fC [signal]\fP"
.PP
Send a list of items filtered-out by mime-type. \fBParameters:\fP
.RS 4
\fIitems\fP the list of filtered items 
.RE
.PP

.SS "void KDirLister::deleteItem (\fBKFileItem\fP * _fileItem)\fC [signal]\fP"
.PP
Signal an item to remove. ATTENTION: if \fC_fileItem\fP == \fBrootItem\fP() the directory this lister is holding was deleted and you HAVE to release especially the \fBrootItem\fP() of this lister, otherwise your app will CRASH!! The \fBclear\fP() signals have been emitted already. 
.PP
\fBParameters:\fP
.RS 4
\fIthe\fP fileItem to delete 
.RE
.PP
Referenced by emitChanges(), and KFileTreeBranch::KFileTreeBranch().
.SS "void KDirLister::refreshItems (const \fBKFileItemList\fP & items)\fC [signal]\fP"
.PP
Signal an item to refresh (its mimetype/icon/name has changed). Note: \fBKFileItem::refresh\fP has already been called on those items. 
.PP
\fBParameters:\fP
.RS 4
\fIitems\fP the items to refresh 
.RE
.PP

.SS "void KDirLister::infoMessage (const \fBQString\fP & msg)\fC [signal]\fP"
.PP
Emitted to display information about running jobs. Examples of message are 'Resolving host', 'Connecting to host...', etc. 
.PP
\fBParameters:\fP
.RS 4
\fImsg\fP the info message 
.RE
.PP

.SS "void KDirLister::percent (int percent)\fC [signal]\fP"
.PP
Progress signal showing the overall progress of the KDirLister. This allows using a progress bar very easily. (see \fBKProgress\fP) 
.PP
\fBParameters:\fP
.RS 4
\fIpercent\fP the progress in percent 
.RE
.PP

.SS "void KDirLister::totalSize (KIO::filesize_t size)\fC [signal]\fP"
.PP
Emitted when we know the size of the jobs. \fBParameters:\fP
.RS 4
\fIsize\fP the total size in bytes 
.RE
.PP

.SS "void KDirLister::processedSize (KIO::filesize_t size)\fC [signal]\fP"
.PP
Regularly emitted to show the progress of this KDirLister. \fBParameters:\fP
.RS 4
\fIsize\fP the processed size in bytes 
.RE
.PP

.SS "void KDirLister::speed (int bytes_per_second)\fC [signal]\fP"
.PP
Emitted to display information about the speed of the jobs. \fBParameters:\fP
.RS 4
\fIbytes_per_second\fP the speed in bytes/s 
.RE
.PP

.SS "bool KDirLister::matchesFilter (const \fBKFileItem\fP *) const\fC [protected, virtual]\fP"
.PP
Called for every new item before emitting \fBnewItems\fP(). You may reimplement this method in a subclass to implement your own filtering. The default implementation filters out '..' and everything not matching the name filter(s) 
.PP
\fBReturns:\fP
.RS 4
true if the item is 'ok'. false if the item shall not be shown in a view, e.g. files not matching a pattern *.cpp (\fBKFileItem::isHidden\fP()) 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmatchesFilter\fP 
.PP
\fBsetNameFilter\fP 
.RE
.PP
Definition at line 1827 of file kdirlister.cpp.
.PP
References KFileItem::isDir(), matchesFilter(), KGlobal::staticQString(), and KFileItem::text().
.SS "bool KDirLister::matchesMimeFilter (const \fBKFileItem\fP *) const\fC [protected, virtual]\fP"
.PP
Called for every new item before emitting \fBnewItems\fP(). You may reimplement this method in a subclass to implement your own filtering. The default implementation filters out '..' and everything not matching the name filter(s) 
.PP
\fBReturns:\fP
.RS 4
true if the item is 'ok'. false if the item shall not be shown in a view, e.g. files not matching a pattern *.cpp (\fBKFileItem::isHidden\fP()) 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmatchesMimeFilter\fP 
.PP
\fBsetMimeFilter\fP 
.RE
.PP
Definition at line 1844 of file kdirlister.cpp.
.PP
References matchesMimeFilter(), and KFileItem::mimetype().
.SS "bool KDirLister::doNameFilter (const \fBQString\fP & name, const \fBQPtrList\fP< \fBQRegExp\fP > & filters) const\fC [protected, virtual]\fP"
.PP
Called by the public \fBmatchesFilter\fP() to do the actual filtering. Those methods may be reimplemented to customize filtering. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name to filter 
.br
\fIfilers\fP a list of regular expressions for filtering 
.RE
.PP
Definition at line 1850 of file kdirlister.cpp.
.PP
References QPtrListIterator::current(), and KStdAccel::name().
.PP
Referenced by emitChanges(), and matchesFilter().
.SS "bool KDirLister::doMimeFilter (const \fBQString\fP & mime, const \fBQStringList\fP & filters) const\fC [protected, virtual]\fP"
.PP
Called by the public \fBmatchesMimeFilter\fP() to do the actual filtering. Those methods may be reimplemented to customize filtering. 
.PP
\fBParameters:\fP
.RS 4
\fImime\fP the mime type to filter 
.br
\fIfilters\fP the list of mime types to filter 
.RE
.PP
Definition at line 1859 of file kdirlister.cpp.
.PP
Referenced by emitChanges(), and matchesMimeFilter().
.SS "bool KDirLister::validURL (const \fBKURL\fP &) const\fC [protected, virtual]\fP"
.PP
Checks if an url is malformed or not and displays an error message if it is and autoErrorHandling is set to true. \fBReturns:\fP
.RS 4
true if url is valid, otherwise false. 
.RE
.PP
Definition at line 1886 of file kdirlister.cpp.
.PP
References KMessageBox::error(), KURL::isMalformed(), and KURL::prettyURL().
.PP
Referenced by openURL().
.SS "void KDirLister::handleError (\fBKIO::Job\fP *)\fC [protected, virtual]\fP"
.PP
Reimplement to customize error handling. Definition at line 1903 of file kdirlister.cpp.
.PP
References KIO::Job::showErrorDialog().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
