D18599: Use specific error message if file/folder name contains '/'
Nathaniel Graham
noreply at phabricator.kde.org
Tue Jan 29 17:54:15 GMT 2019
ngraham requested changes to this revision.
ngraham added inline comments.
This revision now requires changes to proceed.
INLINE COMMENTS
> knewfilemenu.cpp:905
> KIO::Job *job;
> - if (name.contains(QLatin1Char('/'))) {
> - // If the name contains any slashes, use mkpath so that a/b/c works.
> - job = KIO::mkpath(url, baseUrl);
> - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Mkpath, QList<QUrl>(), url, job);
> - } else {
> - // If not, use mkdir so it will fail if the name of an existing folder was used
> - job = KIO::mkdir(url);
> - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Mkdir, QList<QUrl>(), url, job);
> - }
> + // UNIX throws error creating directory tree(a/b/c) while WINDOWS creates directory named a/b/c
> + job = KIO::mkdir(url);
You don't need to duplicate the diff from D18563 <https://phabricator.kde.org/D18563> here.
> file.cpp:286
> +
> + // UNIX does not allow identifiers containing /
> + if (path.contains(QLatin1Char('/'))) {
This should not be evaluated on Windows, since as you pointed out, Windows does allow slashes so there's no error here.
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D18599
To: shubham, ngraham
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190129/e4e07256/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list