summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2005-06-11 17:03:59 (UTC)
committer zautrix <zautrix>2005-06-11 17:03:59 (UTC)
commit81370a5f955c2710b6e9336b6c412c8d630ef72a (patch) (unidiff)
tree6252851fbafcbc3ff777e1af0171990124beb23e /microkde
parent0cfaf22fc5d8f511320813171be84ce3436990c6 (diff)
downloadkdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.zip
kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.tar.gz
kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.tar.bz2
fixes
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
@@ -56,13 +56,17 @@ QString KFileDialog::getOpenFileName( const QString & fn,
56 dia.setCaption( cap ); 56 dia.setCaption( cap );
57 int res = dia.exec(); 57 int res = dia.exec();
58 if ( res ) 58 if ( res )
59 retfile = o.selectedName(); 59 retfile = o.selectedName();
60 return retfile; 60 return retfile;
61} 61}
62 62QString KFileDialog::getExistingDirectory( const QString & fn,
63 const QString & cap, QWidget * par )
64{
65 return KFileDialog::getSaveFileName( fn, cap, pr );
66}
63#else 67#else
64 68
65#include <qfiledialog.h> 69#include <qfiledialog.h>
66 70
67QString KFileDialog::getSaveFileName( const QString & fn, 71QString KFileDialog::getSaveFileName( const QString & fn,
68 const QString & cap , QWidget * par ) 72 const QString & cap , QWidget * par )
@@ -72,8 +76,13 @@ QString KFileDialog::getSaveFileName( const QString & fn,
72QString KFileDialog::getOpenFileName( const QString & fn, 76QString KFileDialog::getOpenFileName( const QString & fn,
73 const QString & cap, QWidget * par ) 77 const QString & cap, QWidget * par )
74{ 78{
75 79
76 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); 80 return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap );
77} 81}
82QString KFileDialog::getExistingDirectory( const QString & fn,
83 const QString & cap, QWidget * par )
84{
85 return QFileDialog::getExistingDirectory( fn, par, "exidtingdir", cap );
86}
78#endif 87#endif
79 88
diff --git a/microkde/kfiledialog.h b/microkde/kfiledialog.h
index 0825872..90709cd 100644
--- a/microkde/kfiledialog.h
+++ b/microkde/kfiledialog.h
@@ -12,9 +12,11 @@ class KFileDialog
12 const QString &, QWidget * ); 12 const QString &, QWidget * );
13 13
14 14
15 static QString getOpenFileName( const QString &, 15 static QString getOpenFileName( const QString &,
16 const QString &, QWidget * ); 16 const QString &, QWidget * );
17 17
18 static QString getExistingDirectory( const QString &,
19 const QString &, QWidget * );
18}; 20};
19 21
20#endif 22#endif
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
@@ -208,13 +208,13 @@ KURLRequester::~KURLRequester()
208 208
209 209
210void KURLRequester::init() 210void KURLRequester::init()
211{ 211{
212 myFileDialog = 0L; 212 myFileDialog = 0L;
213 myShowLocalProt = false; 213 myShowLocalProt = false;
214 214 mPathIsDir = false;
215 if (/*US !d->combo && */ !d->edit ) 215 if (/*US !d->combo && */ !d->edit )
216 d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); 216 d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" );
217 217
218 myButton = new KURLDragPushButton( this, "kfile button"); 218 myButton = new KURLDragPushButton( this, "kfile button");
219 QIconSet iconSet = SmallIconSet("fileopen"); 219 QIconSet iconSet = SmallIconSet("fileopen");
220 QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); 220 QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal );
@@ -269,13 +269,16 @@ void KURLRequester::slotOpenDialog()
269 emit openFileDialog( this ); 269 emit openFileDialog( this );
270 270
271//US use our special KFIleDialog instead 271//US use our special KFIleDialog instead
272 KURL u( url() ); 272 KURL u( url() );
273 //QString fn = u.url(); 273 //QString fn = u.url();
274 QString fn = d->edit->text(); 274 QString fn = d->edit->text();
275 fn = KFileDialog::getSaveFileName( fn, "", this ); 275 if ( mPathIsDir )
276 fn = KFileDialog::getExistingDirectory ( fn, "", this );
277 else
278 fn = KFileDialog::getSaveFileName( fn, "", this );
276 279
277 if ( fn == "" ) 280 if ( fn == "" )
278 return; 281 return;
279 282
280 setURL( fn ); 283 setURL( fn );
281 emit urlSelected( d->url() ); 284 emit urlSelected( d->url() );
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
@@ -102,12 +102,13 @@ public:
102 * Sets the mode of the file dialog. 102 * Sets the mode of the file dialog.
103 * Note: you can only select one file with the filedialog, 103 * Note: you can only select one file with the filedialog,
104 * so KFile::Files doesn't make much sense. 104 * so KFile::Files doesn't make much sense.
105 * @see KFileDialog::setMode() 105 * @see KFileDialog::setMode()
106 */ 106 */
107 void setMode( unsigned int m ); 107 void setMode( unsigned int m );
108 void setPathIsDir( ) {mPathIsDir = true;}
108 109
109 /** 110 /**
110 * Sets the filter for the file dialog. 111 * Sets the filter for the file dialog.
111 * @see KFileDialog::setFilter() 112 * @see KFileDialog::setFilter()
112 */ 113 */
113 void setFilter( const QString& filter ); 114 void setFilter( const QString& filter );
@@ -231,12 +232,13 @@ protected:
231 232
232 233
233private: 234private:
234 KURLDragPushButton * myButton; 235 KURLDragPushButton * myButton;
235 bool myShowLocalProt; 236 bool myShowLocalProt;
236 mutable KFileDialog * myFileDialog; 237 mutable KFileDialog * myFileDialog;
238 bool mPathIsDir;
237 239
238 240
239protected slots: 241protected slots:
240 /** 242 /**
241 * Called when the button is pressed to open the filedialog. 243 * Called when the button is pressed to open the filedialog.
242 * Also called when @ref KStdAccel::Open (default is Ctrl-O) is pressed. 244 * Also called when @ref KStdAccel::Open (default is Ctrl-O) is pressed.