class KDirOperator


Full nameKIO::KDirOperator
Definition#include <kdiroperator.h>
InheritsQWidget (qt)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Signals

Protected Methods

Protected Slots

 KDirOperator (const KURL& urlName = KURL(), QWidget *parent = 0, const char* name = 0)

You need to call listDirectory() to actually load the directory, this constructor only initializes and doesn't start loading.

void  setNameFilter (const QString& filter)

Set a filter like "*.cpp *.h *.o". Call rereadDir() to apply it.

const QString&  nameFilter ()

[const]

Returns: the current namefilter.

KURL  url ()

[const]

local URLs (i.e. directories) always have file: prepended.

void  setCurrentItem ( const QString& filename )

Clears the current selection and attempts to set filename the current file. filename is just the name, no path or url.

QWidget *  viewWidget ()

[const]

Returns the widget of the current view. 0L if there is no view/widget.

KProgress *  progressBar ()

[const]

Returns: the progress widget, that is shown during directory listing. You can for example reparent() it to put it into a statusbar.

void  setMode ( KFile::Mode m )

Sets the listing/selection mode for the views, an OR'ed combination of

You cannot mix File and Files of course.

void  setPreviewWidget (const QWidget *w)

Sets a preview-widget to be shown next to the file-view. The ownership of w is transferred to KDirOperator, so don't delete it yourself!

const KFileViewItemList *  selectedItems ()

[const]

Returns: a list of all currently selected items. If there is no view, then 0L is returned.

KCompletion *  completionObject ()

[const]

Returns: a KCompletion object, containing all filenames and directories of the current directory/URL. You can use it to insert it into a KLineEdit or KComboBox Note: it will only contain files, after prepareCompletionObjects() has been called. It will be implicitly called from makeCompletion() or makeDirCompletion()

KCompletiondirCompletionObject ()

[const]

Returns: a KCompletion object, containing only all directories of the current directory/URL. You can use it to insert it into a KLineEdit or KComboBox Note: it will only contain directories, after prepareCompletionObjects() has been called. It will be implicitly called from makeCompletion() or makeDirCompletion()

KActionCollection *  actionCollection ()

[const]

an accessor to a collection of all available Actions. The actions are static, they will be there all the time (no need to connect to the signals KActionCollection::inserted() or removed().

There are the following actions:

The short and detailed view are in an exclusive group. The sort-by actions are in an exclusive group as well. Also the "separate dirs", "preview" and "single" actions are in an exclusive group.

You can e.g. use

actionCollection()->action( "up" )->plug( someToolBar );</pre>
 to add a button into a toolbar, which makes the dirOperator change to
 its parent directory.

 @returns all available Actions
     

void  readConfig ( KConfig *, const QString& group = QString::null )

[virtual]

Reads the default settings for a view, i.e. the default KFile::FileView. Also reads the sorting and whether hidden files should be shown. Note: the default view will not be set - you have to call

@ref setView( KFile::Default )</pre> to apply it.
     

void  setOnlyDoubleClickSelectsFiles ( bool enable )

This is a KFileDialog specific hack: we want to select directories with single click, but not files. But as a generic class, we have to be able to select files on single click as well.

This gives us the opportunity to do both.

The default is false, set it to true if you don't want files selected with single click.

bool  onlyDoubleClickSelectsFiles ()

[const]

Returns: whether files (not directories) should only be select()ed by double-clicks.

bool  mkdir ( const QString& directory, bool enterDirectory = true )

Creates the given directory/url. If it is a relative path, it will be completed with the current directory. If enterDirectory is true, the directory will be entered after a successful operation. If unsuccessful, a messagebox will be presented to the user.

Returns: true if the directory could be created.

void  clearHistory ()

Clears the forward and backward history.

void  setEnableDirHighlighting ( bool enable )

When going up in the directory hierarchy, KDirOperator can highlight the directory that was just left.

I.e. when you go from /home/gis/src to /home/gis, the item "src" will be made the current item.

Default is off.

bool  dirHighlighting ()

[const]

Default is false.

Returns: whether the last directory will be made the current item when going up in the directory hierarchy.

void  deleteSelected ()

[slot]

Deletes the currently selected files/directories.

void  activatedMenu ( const KFileViewItem * )

[protected virtual slot]

Called upon right-click to activate the popupmenu.

void  viewChanged ( KFileView * newView )

[signal]

Emitted whenever the current fileview is changed, either by an explicit call to setView() or by the user selecting a different view thru the GUI.


Generated by: ssk@tauon.ph.unimelb.EDU.AU on Wed May 23 05:25:30 2001, using kdoc 2.0a35.