class KDirOperator |
|
|
This widget works as a network transparent filebrowser. You specify a URL to display and this url will be loaded via KDirLister. The user can browse through directories, highlight and select files, delete or rename files. It supports different views, e.g. a detailed view (see KFileDetailView), a simple icon view (see KFileIconView), a combination of two views, separating directories and files ( KCombiView). Additionally, a preview view is available (see KFilePreview), which can show either a simple or detailed view and additionally a preview widget (see setPreviewWidget()). KImageFilePreview is one implementation of a preview widget, that displays previews for all supported filetypes utilizing KIO.PreviewJob.
|
|
Constructs the KDirOperator with no initial view. As the views are configurable, call readConfig() to load the user's configuration and then setView to explicitly set a view. This constructor doesn't start loading the url, setView will do it. |
|
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 );to add a button into a toolbar, which makes the dirOperator change to its parent directory. Returns all available Actions |
|
Called upon right-click to activate the popupmenu. |
|
Goes one step back in the history and opens that url. |
|
Goes one directory up from the current url. |
|
Checks if there support from KIO.PreviewJob for the currently shown files, taking mimeFilter() and nameFilter() into account Enables/disables the preview-action accordingly. |
|
Clears both the namefilter and mimetype filter, so that all files and directories will be shown. Call updateDir() to apply it. See also setMimeFilter See also setNameFilter |
|
Clears the forward and backward history. |
|
Stops loading immediately. You don't need to call this, usually. |
|
|
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() |
|
A view factory for creating predefined fileviews. Called internally by setView , but you can also call it directly. Reimplement this if you depend on self defined fileviews. parent - is the QWidget to be set as parent view - is the predefined view to be set, note: this can be several ones OR:ed together. Returns the created KFileView See also KFileView See also KCombiView See also KFileDetailView See also KFileIconView See also KFilePreview See also KFile.FileView See also setView |
|
|
|
Deletes the currently selected files/directories. |
|
|
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() |
|
Returns whether the last directory will be made the current item when going up in the directory hierarchy. Default is false. |
|
Returns the object listing the directory |
|
Returns true if we are in directory-only mode, that is, no files are shown. |
|
|
Emitted when files are dropped. Dropping files is disabled by default. You need to enable it with setAcceptDrops() item - the item on which the drop occurred or 0. event - the drop event itself. urls - the urls that where dropped. |
|
Emitted when a file is highlighted or generally the selection changes in multiselection mode. In the latter case, item is 0L. You can access the selected items with selectedItems(). |
|
|
|
Goes one step forward in the history and opens that url. |
|
Emits fileHighlighted( i ) |
|
Enters the home directory. |
|
Adds a new list of KFileItems to the view (coming from KDirLister) |
|
Returns true if we are displaying the root directory of the current url |
|
Returns true if item is currently selected, or false otherwise. |
|
Removes the given KFileItem item from the view (usually called from KDirLister). |
|
Tries to complete the given string (only completes files). |
|
Tries to complete the given string (only completes directores). |
|
Returns the current mime filter. |
|
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. |
|
Opens a dialog to create a new directory. |
|
Returns the listing/selection mode. |
|
Returns the current namefilter. See also setNameFilter |
|
Returns the number of directories in the currently listed url. Returns 0 if there is no view. |
|
Returns the number of files in the currently listed url. Returns 0 if there is no view. |
|
Returns whether files (not directories) should only be select()ed by double-clicks. See also setOnlyDoubleClickSelectsFiles |
|
Called after setUrl() to load the directory, update the history, etc. |
|
Synchronizes the completion objects with the entries of the currently listed url. Automatically called from makeCompletion() and makeDirCompletion() |
|
Returns the progress widget, that is shown during directory listing. You can for example reparent() it to put it into a statusbar. |
|
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 setView( KFile.Default )to apply it. See also setView See also setViewConfig See also writeConfig |
|
Re-reads the current url. |
|
Restores the normal cursor after showing the busy-cursor. Also hides the progressbar. |
|
|
Enters the directory specified by the given item. |
|
Emits fileSelected( item ) |
|
Returns a list of all currently selected items. If there is no view, then 0L is returned. |
|
Reimplemented - allow dropping of files if b is true b - true if the widget should allow dropping of files |
|
Clears the current selection and attempts to set filename the current file. filename is just the name, no path or url. |
|
Sets a custom KDirLister to list directories. |
|
Sets the options for dropping files. See also KFileView.DropOptions |
|
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. |
|
Sets a list of mimetypes as filter. Only files of those mimetypes will be shown. Example: QStringList filter; filter << "text/html" << "image/png" << "inode/directory"; dirOperator->setMimefilter( filter ); Node: Without the mimetype inode/directory, only files would be shown. Call updateDir() to apply it. See also KDirLister.setMimeFilter See also mimeFilter |
|
Sets the listing/selection mode for the views, an OR'ed combination of You cannot mix File and Files of course, as the former means single-selection mode, the latter multi-selection. |
|
Sets a filter like "*.cpp *.h *.o". Only files matching that filter will be shown. Call updateDir() to apply it. See also KDirLister.setNameFilter See also nameFilter |
|
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. |
|
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! |
|
Enables/disables showing hidden files. |
|
Sets the way to sort files and directories. |
|
Sets a new url to list. clearforward - specifies whether the "forward" history should be cleared. url - the URL to set |
|
Sets a new KFileView to be used for showing and browsing files. Note: this will read the current url() to fill the view. See also KFileView See also KFileIconView See also KFileDetailView See also KCombiView See also view |
|
Sets one of the predefined fileviews See also KFile.FileView |
|
Sets the config object and the to be used group in KDirOperator. This will be used to store the view's configuration via KFileView.writeConfig() (and for KFileView.readConfig()). If you don't set this, the views cannot save and restore their configuration. Usually you call this right after KDirOperator creation so that the view instantiation can make use of it already. Note that KDirOperator does NOT take ownership of that object (typically it's KGlobal.config() anyway. You must not delete the KConfig or KConfigGroup object (and master config object) before either deleting the KDirOperator or calling setViewConfig(0); or something like that See also viewConfig See also viewConfigGroup |
|
Sets up all the actions. Called from the constructor, you usually better not call this. |
|
Sets up the action menu. whichActions - is an value of OR'd ActionTypes that controls which actions to show in the action menu |
|
Sets up the context-menu with all the necessary actions. Called from the constructor, you usually don't need to call this. |
|
Returns true when hidden files are shown or false otherwise. |
|
Tries to make the given match as current item in the view and emits completion( match ) |
|
Changes sorting to sort by date |
|
Changes sorting to sort by name |
|
Changes sorting to sort by size |
|
Changes sorting to reverse sorting |
|
Returns the current way of sorting files and directories |
|
Toggles showing directories first / having them sorted like files. |
|
Toggles case sensitive / case insensitive sorting |
|
Starts and returns a KIO.CopyJob to trash the given items.
items - the list of items to be trashed parent - the parent widget used for the confirmation dialog ask - specifies whether a confirmation dialog should be shown showProgress - passed to the CopyJob to show a progress dialog |
|
Trashes the currently selected files/directories. This function used to take activation reason and keyboard modifiers, in order to call deleteSelected() if the user wanted to delete. Instead, call deleteSelected(). FIXME KAction Port: link deleteSelected() up correctly |
|
to update the view after changing the settings |
|
|
Enables/disables actions that are selection dependent. Call this e.g. when you are about to show a popup menu using some of KDirOperators actions. |
|
Updates the sorting-related actions to comply with the current sorting See also sorting |
|
Updates the view-related actions to comply with the current KFile.FileView |
|
Returns the current url |
|
|
Returns the currently used view. See also setView |
|
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. |
|
|
Returns the widget of the current view. 0L if there is no view/widget. (KFileView itself is not a widget.) |
|
Saves the current settings like sorting, simple or detailed view. See also readConfig See also setViewConfig |
SortActions | - | ||
ViewActions | - | ||
NavActions | - | ||
FileActions | - | ||
AllActions | - |