mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 00:41:23 +00:00
Fix startDir when passing an existing directory
BUG: 273822
This commit is contained in:
parent
b4a1440a98
commit
c182bc3060
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue