summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kfiledialog.cpp11
-rw-r--r--microkde/kfiledialog.h2
-rw-r--r--microkde/kio/kfile/kurlrequester.cpp7
-rw-r--r--microkde/kio/kfile/kurlrequester.h2
4 files changed, 19 insertions, 3 deletions
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp
index 6be1580..c64f325 100644
--- a/microkde/kfiledialog.cpp
+++ b/microkde/kfiledialog.cpp
@@ -60,5 +60,9 @@ QString KFileDialog::getOpenFileName( const QString & fn,
return retfile;
}
-
+QString KFileDialog::getExistingDirectory( const QString & fn,
+ const QString & cap, QWidget * par )
+{
+ return KFileDialog::getSaveFileName( fn, cap, pr );
+}
#else
@@ -76,4 +80,9 @@ QString KFileDialog::getOpenFileName( const QString & fn,
return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap );
}
+QString KFileDialog::getExistingDirectory( const QString & fn,
+ const QString & cap, QWidget * par )
+{
+ return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap );
+}
#endif
diff --git a/microkde/kfiledialog.h b/microkde/kfiledialog.h
index 0825872..90709cd 100644
--- a/microkde/kfiledialog.h
+++ b/microkde/kfiledialog.h
@@ -16,4 +16,6 @@ class KFileDialog
const QString &, QWidget * );
+ static QString getExistingDirectory( const QString &,
+ const QString &, QWidget * );
};
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
@@ -212,5 +212,5 @@ void KURLRequester::init()
myFileDialog = 0L;
myShowLocalProt = false;
-
+ mPathIsDir = false;
if (/*US !d->combo && */ !d->edit )
d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" );
@@ -273,5 +273,8 @@ void KURLRequester::slotOpenDialog()
//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 == "" )
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
@@ -106,4 +106,5 @@ public:
*/
void setMode( unsigned int m );
+ void setPathIsDir( ) {mPathIsDir = true;}
/**
@@ -235,4 +236,5 @@ private:
bool myShowLocalProt;
mutable KFileDialog * myFileDialog;
+ bool mPathIsDir;