Fix startDir when passing an existing directory

BUG: 273822
This commit is contained in:
Christoph Feck 2011-08-04 04:18:30 +02:00
parent b4a1440a98
commit c182bc3060

View file

@ -31,6 +31,7 @@
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <kfiledialog.h>
#include <kfileitem.h>
#include <kicondialog.h>
#include <kdirselectdialog.h>
#include <kcolordialog.h>
@ -595,6 +596,10 @@ static int directCommand(KCmdLineArgs *args)
}
// copied from KFileDialog::getSaveFileName(), so we can add geometry
bool specialDir = ( startDir.at(0) == ':' );
if ( !specialDir ) {
KFileItem kfi(KFileItem::Unknown, KFileItem::Unknown, KUrl(startDir));
specialDir = kfi.isDir();
}
KFileDialog dlg( specialDir ? startDir : QString(), filter, 0 );
if ( !specialDir )
dlg.setSelection( startDir );