patch: create non existent directories

David Faure faure at kde.org
Sat Jan 8 02:51:03 GMT 2005


On Thursday 30 December 2004 01:20, Felix Berger wrote:
> Hi,
> 
> the applied patch is basically copy-paste from konq_diroperations.cc.
> 
> It enables KDiroperator::mkdir() and KDirSelectDialog::slotMkdir() to suggest 
> a non existent folder name for local files.
> 
> The only thing I replaced in the konq_diroperations code was:
> 
> -          if (access(QFile::encodeName(url.path()), F_OK) == -1)
> +          if (!KIO::NetAccess::exists( url, false, 0 ))
> 
> I didn't want to include <unistd.h>, I don't know if it's ok to depend on it 
> there.
> 
> I don't really like the code duplication, at least KFileDialog and 
> KDirSelectDialog could/should share some code there. What do you think?

How about using KIO::RenameDlg::suggestName() ? It does exactly this.
See kdelibs/kio/kio/renamedlg.h

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list