From e45e7d8594eceadc647df4fb1b2bd86d3909d307 Mon Sep 17 00:00:00 2001 From: David Palacio Date: Thu, 5 May 2011 20:52:46 +0000 Subject: [PATCH] Make the file dialog accept directories if a generator offers to handle them. svn path=/trunk/KDE/kdegraphics/okular/; revision=1230524 --- shell/shell.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/shell.cpp b/shell/shell.cpp index 1eb3e07e9..1a497ffa7 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -252,6 +252,11 @@ void Shell::fileOpen() startDir = m_part->url().toLocalFile(); KFileDialog dlg( startDir, QString(), this ); dlg.setOperationMode( KFileDialog::Opening ); + + // A directory may be a document. E.g. comicbook generator. + if ( m_fileformats.contains( "inode/directory" ) ) + dlg.setMode( dlg.mode() | KFile::Directory ); + if ( m_fileformatsscanned && m_fileformats.isEmpty() ) dlg.setFilter( i18n( "*|All Files" ) ); else