|
|
The dir lister deals with the kiojob used to list and update a directory, handles the timer, and has signals for the user of this class (e.g. konqueror view or kdesktop) to create/destroy its items when asked.
This class is independent from the graphical representation of the dir (icon container, tree view, ...) and it stores the items (as KFileItems).
Typical usage : Create an instance, Connect to at least update, clear, newItem, and deleteItem Call openURL - the signals will be called Reuse the instance when opening a new url (openURL) Destroy the instance when not needed anymore (usually destructor)
Advanced usage : call openURL with _keep = true to list directories without forgetting the ones previously read (e.g. for a tree view)
|
Create a directory lister
~ |
[virtual]
Destroy the directory lister
void |
[virtual]
Run the directory lister on the given url
The newItems() signal may be emitted more than once to supply you with KFileItems, up until the signal completed() is emitted (and isFinished() returns true).
Parameters:
void |
[virtual]
Stop listing the current directory
const KURL & |
[const virtual]
Returns: the url used by this instance to list the files It might be different from the one we gave, if there was a redirection.
bool |
[virtual]
Sets url
as the current url, forgetting any previous ones and stopping
any pending job. If url
is malformed, the previous url will be kept
and false will be returned.
Does _not_ start loading that url,
void |
[virtual]
Update url.
The current implementation calls it automatically for
local files, using KDirWatch (if autoUpdate() is true), but it might be
useful to force an update manually.
void |
Convenience method. Starts loading the current directory, e.g. set via setURL(), if the URL is "dirty" -- otherwise the cached entries are reused. The url is dirty when a new URL was set via setURL or the nameFilter was changed.
void |
Sets the current URL "dirty", so it will be reloaded upon the next listDirectory() call.
void |
Enable/disable automatic directory updating, when a directory changes (using KDirWatch).
bool |
[const]
Returns: whether KDirWatch is used to automatically update directories. enabled by default.
void |
[virtual]
Changes the "is viewing dot files" setting. Calls updateDirectory() if setting changed
bool |
[const virtual]
Returns: whether dotfiles are shown
KFileItem* |
[const]
Find an item by its URL
Parameters:
Returns: the pointer to the KFileItem
Reimplemented from DCOPObject.
KFileItem* |
[const]
Find an item by its name
Parameters:
Returns: the pointer to the KFileItem
QList<KFileItem> & |
Returns: the list of file items. The list may be incomplete if isFinished() is false, i.e. it is still loading items.
KFileItem * |
[const]
Returns: the file item for url() itself (".")
KIO::ListJob * |
[const]
void |
Call this with dirsOnly
= true to list only directories
bool |
[const]
Returns: true if setDirOnlyMode(true) was called
void |
Set a name filter to only list items matching this name, e.g. "*.cpp".
You can set more than one filter by separating them with whitespace, e.g "*.cpp *.h". Call setNameFilter( QString::null ) to disable filtering. Note: the direcory is not automatically reloaded.
const QString& |
[const]
Returns: the current name filter, as set via setNameFilter()
bool |
[const]
Returns: true if name
matches a filter in the list,
otherwise fale.
void |
[virtual]
Notify that files have been added in directory
The receiver will list that directory again to find
the new items (since it needs more than just the names anyway).
Reimplemented from KDirNotify.
Reimplemented from KDirNotify.
void |
[virtual]
Notify that files have been deleted. This call passes the exact urls of the deleted files so that any view showing them can simply remove them or be closed (if its current dir was deleted) Reimplemented from KDirNotify.
Reimplemented from KDirNotify.
void |
[virtual]
Notify that files have been changed. At the moment, this is only used for new icon, but it could be used for size etc. as well. Note: this is ASYNC so that it can be used with a broadcast
Reimplemented from KDirNotify.
void |
[virtual]
Reimplemented from KDirNotify.
bool |
[const]
Returns true if no io operation is currently in progress.
void |
[signal]
Tell the view that we started to list _url. 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.
void |
[signal]
Tell the view that listing is finished
void |
[signal]
Tell the view that user canceled the listing
void |
[signal]
Signal a redirection
void |
[signal]
Clear all items
void |
[signal]
Signal new items, complete
is true when the directory loading has
finished
void |
[signal]
Signal an item to remove
void |
[signal]
Signal an item to refresh (its mimetype/icon/name has changed) Note: KFileItem::refresh has already been called on those items.
void |
[signal]
Instruct the view to close itself, since the dir was just deleted.
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
void |
[protected slot]
KFileItem * |
[protected virtual]
called to create a KFileItem - you may subclass and reimplement this method if you use "special KFileItems", i.e. a subclass like KonqFileItem Must return a valid KFileItem
Parameters:
bool |
[protected const virtual]
Called for every item after createFileItem().
Returns: false if the item shall not be shown in a view, e.g. files not matching a pattern *.cpp (KFileItem::isHidden()) 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)
See also: matchesFilter, setNameFilter
void |
[protected]
Unregister dirs from kdirwatch and clear list of dirs
void |
[protected]
Delete unmarked items, as it says on the tin
bool |
[protected const]
Checks if a url is malformed or not and displays an error message if it is. Returns true if it is valid, otherwise false.
KURL |
[protected]
The url that we used to list (can be different in case of redirect)
KIO::ListJob * |
[protected]
QList<KFileItem> |
[protected]
The internal storage of file items
KFileItem * |
[protected]
File Item for m_url itself (".")
KURL::List |
[protected]
List of dirs handled by this instance. Same as m_url if only one dir But for a tree view, it contains all the dirs shown (Used to unregister from kdirwatch)
bool |
[protected]
bool |
[protected]
QValueList<KIO::UDSEntry> |
[protected]
Keep entries found - used by slotUpdate*
bool |
[protected]
List only directories
bool |
[protected]
QList<QRegExp> |
[protected]
a list of file-filters
KDirListerPrivate * |
[protected]
Generated by: baudens@ke.mandrakesoft.com on Thu Oct 26 17:36:34 2000, using kdoc 2.0a40. |