Diffstat (limited to 'microkde/kio/kfile/kurlrequester.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kio/kfile/kurlrequester.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp index 991c8be..ca94570 100644 --- a/microkde/kio/kfile/kurlrequester.cpp +++ b/microkde/kio/kfile/kurlrequester.cpp @@ -190,49 +190,49 @@ KURLRequester::KURLRequester( QWidget *parent, const char *name ) KURLRequester::KURLRequester( const QString& url, QWidget *parent, const char *name ) : QHBox( parent, name ) { d = new KURLRequesterPrivate; init(); setURL( url ); } KURLRequester::~KURLRequester() { //US delete myCompletion; delete myFileDialog; delete d; } void KURLRequester::init() { myFileDialog = 0L; myShowLocalProt = false; - + mPathIsDir = false; if (/*US !d->combo && */ !d->edit ) d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); myButton = new KURLDragPushButton( this, "kfile button"); QIconSet iconSet = SmallIconSet("fileopen"); QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); myButton->setIconSet( iconSet ); myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); //US QToolTip::add(myButton, i18n("Open file dialog")); connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() )); setSpacing( KDialog::spacingHint() ); QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit; setFocusProxy( widget ); d->connectSignals( this ); connect( myButton, SIGNAL( clicked() ), this, SLOT( slotOpenDialog() )); /*US myCompletion = new KURLCompletion(); d->setCompletionObject( myCompletion ); KAccel *accel = new KAccel( this ); @@ -251,49 +251,52 @@ void KURLRequester::setURL( const QString& url ) else d->setText( url ); } void KURLRequester::setCaption( const QString& caption ) { //US fileDialog()->setCaption( caption ); //US QWidget::setCaption( caption ); } QString KURLRequester::url() const { return d->url(); } void KURLRequester::slotOpenDialog() { emit openFileDialog( this ); //US use our special KFIleDialog instead KURL u( url() ); //QString fn = u.url(); QString fn = d->edit->text(); - fn = KFileDialog::getSaveFileName( fn, "", this ); + if ( mPathIsDir ) + fn = KFileDialog::getExistingDirectory ( fn, "", this ); + else + fn = KFileDialog::getSaveFileName( fn, "", this ); if ( fn == "" ) return; setURL( fn ); emit urlSelected( d->url() ); /*US KFileDialog *dlg = fileDialog(); if ( !d->url().isEmpty() ) { KURL u( url() ); // If we won't be able to list it (e.g. http), then don't try :) if ( KProtocolInfo::supportsListing( u.protocol() ) ) dlg->setSelection( u.url() ); } if ( dlg->exec() == QDialog::Accepted ) { setURL( dlg->selectedURL().prettyURL() ); emit urlSelected( d->url() ); } */ } |