Diffstat (limited to 'microkde/kio/kfile/kurlrequester.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kio/kfile/kurlrequester.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/microkde/kio/kfile/kurlrequester.h b/microkde/kio/kfile/kurlrequester.h index 3253dd5..faa3326 100644 --- a/microkde/kio/kfile/kurlrequester.h +++ b/microkde/kio/kfile/kurlrequester.h @@ -44,128 +44,129 @@ class QTimer; * * The defaults for the filedialog are to ask for one existing local file, i.e. * KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly ) * The default filter is "*", i.e. show all files, and the start directory is * the current working directory, or the last directory where a file has been * selected. * * You can change this behavior by using @ref setMode() or @ref setFilter(). * * @short A widget to request a filename/url from the user * @author Carsten Pfeiffer <pfeiffer@kde.org> */ class KURLRequester : public QHBox { Q_OBJECT Q_PROPERTY( QString url READ url WRITE setURL ) public: /** * Constructs a KURLRequester widget. */ KURLRequester( QWidget *parent=0, const char *name=0 ); /** * Constructs a KURLRequester widget with the initial URL @p url. */ KURLRequester( const QString& url, QWidget *parent=0, const char *name=0 ); /** * Special constructor, which creates a KURLRequester widget with a custom * edit-widget. The edit-widget can be either a KComboBox or a KLineEdit * (or inherited thereof). Note: for geometry management reasons, the * edit-widget is reparented to have the KURLRequester as parent. * @param modal specifies whether the filedialog should be opened as modal * or not. */ //US KURLRequester( QWidget *editWidget, QWidget *parent, const char *name=0 ); /** * Destructs the KURLRequester. */ ~KURLRequester(); /** * @returns the current url in the lineedit. May be malformed, if the user * entered something weird. ~user or environment variables are substituted * for local files. */ QString url() const; /** * Enables/disables showing file:/ in the lineedit, when a local file has * been selected in the filedialog or was set via @ref setURL(). * Default is false, not showing file:/ * @see #showLocalProtocol */ void setShowLocalProtocol( bool b ); /** * Sets the mode of the file dialog. * Note: you can only select one file with the filedialog, * so KFile::Files doesn't make much sense. * @see KFileDialog::setMode() */ void setMode( unsigned int m ); + void setPathIsDir( ) {mPathIsDir = true;} /** * Sets the filter for the file dialog. * @see KFileDialog::setFilter() */ void setFilter( const QString& filter ); /** * @returns whether local files will be prefixed with file:/ in the * lineedit * @see #setShowLocalProtocol */ bool showLocalProtocol() const { return myShowLocalProt; } /** * @returns a pointer to the filedialog * You can use this to customize the dialog, e.g. to specify a filter. * Never returns 0L. */ virtual KFileDialog * fileDialog() const; /** * @returns a pointer to the lineedit, either the default one, or the * special one, if you used the special constructor. * * It is provided so that you can e.g. set an own completion object * (e.g. @ref KShellCompletion) into it. */ KLineEdit * lineEdit() const; /** * @returns a pointer to the combobox, in case you have set one using the * special constructor. Returns 0L otherwise. */ //US KComboBox * comboBox() const; /** * @returns a pointer to the pushbutton. It is provided so that you can * specify an own pixmap or a text, if you really need to. */ QPushButton * button() const; /** * @returns the KURLCompletion object used in the lineedit/combobox. */ //US KURLCompletion *completionObject() const { return myCompletion; } /** * @returns an object, suitable for use with KEditListBox. It allows you * to put this KURLRequester into a KEditListBox. * Basically, do it like this: * <pre> * KURLRequester *req = new KURLRequester( someWidget ); * [...] * KEditListBox *editListBox = new KEditListBox( i18n("Some Title"), req->customEditor(), someWidget ); * </pre> * @since 3.1 */ //US KEditListBox::CustomEditor customEditor(); public slots: /** * Sets the url in the lineedit to @p url. Depending on the state of * @ref showLocalProtocol(), file:/ on local files will be shown or not. @@ -173,97 +174,98 @@ public slots: */ void setURL( const QString& url ); /** * @reimp * Sets the caption of the file dialog. * @since 3.1 */ virtual void setCaption( const QString& caption ); /** * Clears the lineedit/combobox. */ void clear(); signals: // forwards from LineEdit /** * Emitted when the text in the lineedit changes. * The parameter contains the contents of the lineedit. * @since 3.1 */ void textChanged( const QString& ); /** * Emitted when return or enter was pressed in the lineedit. */ void returnPressed(); /** * Emitted when return or enter was pressed in the lineedit. * The parameter contains the contents of the lineedit. */ void returnPressed( const QString& ); /** * Emitted before the filedialog is going to open. Connect * to this signal to "configure" the filedialog, e.g. set the * filefilter, the mode, a preview-widget, etc. It's usually * not necessary to set a URL for the filedialog, as it will * get set properly from the editfield contents. * * If you use multiple KURLRequesters, you can connect all of them * to the same slot and use the given KURLRequester pointer to know * which one is going to open. */ void openFileDialog( KURLRequester * ); /** * Emitted when the user changed the URL via the file dialog. * The parameter contains the contents of the lineedit. */ void urlSelected( const QString& ); protected: void init(); //US KURLCompletion * myCompletion; private: KURLDragPushButton * myButton; bool myShowLocalProt; mutable KFileDialog * myFileDialog; + bool mPathIsDir; protected slots: /** * Called when the button is pressed to open the filedialog. * Also called when @ref KStdAccel::Open (default is Ctrl-O) is pressed. */ void slotOpenDialog(); private slots: void slotUpdateURL(); protected: virtual void virtual_hook( int id, void* data ); private: class KURLRequesterPrivate; KURLRequesterPrivate *d; }; /*US class KURLComboRequester : public KURLRequester // For use in Qt Designer { Q_OBJECT public: */ /** * Constructs a KURLRequester widget with a combobox. */ /*US KURLComboRequester( QWidget *parent=0, const char *name=0 ); }; */ #endif // KURLREQUESTER_H |