class KDirLister

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. More...

Full nameKIO::KDirLister
Definition#include <kdirlister.h>
InheritsQObject (kdecore)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Signals

Protected Methods

Protected Slots

Protected Members


Detailed Description

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 _bKeep = true to list directories without forgetting the ones previously read (e.g. for a tree view)

 KDirLister ( bool _delayedMimeTypes = false )

Create a directory lister

KDirLister ()

[virtual]

Destroy the directory lister

void  openURL ( const KURL& _url, bool _showDotFiles, bool _keep = false )

[virtual]

Run the directory lister on the given url

Parameters:
_urlthe directory URL
_showDotFileswhether to return the "hidden" files
_keepif true the previous directories aren't forgotten (they are still watched by kdirwatch and their items are kept in m_lstFileItems)

void  stop ()

[virtual]

Stop listing the current directory

const KURL &  url ()

[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.

void  updateDirectory ( const QString& _dir )

[virtual]

Update the currently displayed directory The current implementation calls it automatically for local files, using KDirWatch, but it might be useful to force an update manually.

void  setShowingDotFiles ( bool _showDotFiles )

[virtual]

Changes the "is viewing dot files" setting. Calls updateDirectory() if setting changed

KFileItem*  find ( const QString& _url )

Find an item

Parameters:
_urlthe item URL

Returns: the pointer to the KFileItem

QList<KFileItem> &  items ()

Returns: the list of file items currently displayed

KFileItem *  rootItem ()

Returns: the file item for url() itself (".")

void  setNameFilter (const QString&)

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.

bool  matchesFilter ( const QString& name )

[const]

Returns: true if @param name matches a filter in the list, otherwise fale.

void  started ( const QString& _url )

[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  completed ()

[signal]

Tell the view that listing is finished

void  canceled ()

[signal]

Tell the view that user canceled the listing

void  redirection ( const KURL & url )

[signal]

Signal a redirection

void  clear ()

[signal]

Clear all items

void  newItems ( const KFileItemList & items )

[signal]

Signal new items

void  deleteItem ( KFileItem * _fileItem )

[signal]

Signal a item to remove

KFileItem *  createFileItem ( const KIO::UDSEntry&, const KURL&, bool determineMimeTypeOnDemand )

[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

bool  filterItem ( const KFileItem * )

[protected 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  forgetDirs ()

[protected]

Unregister dirs from kdirwatch and clear m_lstDirs

KURL m_url

[protected]

The url that we used to list (can be different in case of redirect)

QList<KFileItem> m_lstFileItems

[protected]

The internal storage of file items

KFileItem * m_rootFileItem

[protected]

File Item for m_url itself (".")

QStringList m_lstDirs

[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)

QValueList<KIO::UDSEntry> m_buffer

[protected]

Keep entries found - used by slotUpdate*

bool m_bDirOnlyMode

[protected]

List only directories

QList<QRegExp> m_lstFilters

[protected]

a list of file-filters


Generated by: root@porky.devel.redhat.com on Wed May 10 08:56:52 2000, using kdoc 2.0a35.