D11304: Fix bug where dolphin fails to select any item where a path is created using "Create New | Folder"
Elvis Angelaccio
noreply at phabricator.kde.org
Sun Mar 18 10:44:02 GMT 2018
elvisangelaccio requested changes to this revision.
elvisangelaccio added inline comments.
This revision now requires changes to proceed.
INLINE COMMENTS
> emateli wrote in dolphinview.cpp:1340
> From the looks of it the trailing path delimiter is stripped at KIO's KCoreDirLister, which is what KFileItemModel uses to get the url.
>
> https://cgit.kde.org/kio.git/tree/src/core/kcoredirlister.cpp#n118
Ok. Then please let's do it like this:
const QString dir = QStringLiteral("%1/").arg(m_model->directory().toString());
Also, which dir? Maybe if we call it `modelDir` it's a bit clearer.
> dolphinview.cpp:1343
> + const QString urlStr = url.toString();
> + const QString name = dir + urlStr.mid(dirLen, urlStr.indexOf(QDir::separator(), dirLen + 1) - dirLen);
> +
name of what? Maybe we can call it `ancestorName` ?
Also, don't use `QDir::separator()`, I think it might not work on Windows. From the its doc:
You do not need to use this function to build file paths. If you always use "/", Qt will translate your paths to conform to the underlying operating system. If you want to display paths to the user using their operating system's separator use toNativeSeparators().
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D11304
To: emateli, rkflx, ngraham, elvisangelaccio
Cc: #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180318/9738ab81/attachment.htm>
More information about the kfm-devel
mailing list