Bug 377411 - Created Items Are Not Selected In Parent Folder
Summary: Created Items Are Not Selected In Parent Folder
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (other bugs)
Version First Reported In: 18.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-09 05:41 UTC by Tsu Jan
Modified: 2023-12-15 09:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tsu Jan 2017-03-09 05:41:13 UTC
This is about dolphin-16.12.2-1 in Arch.

Created items are selected correctly at first. However, after going up from a folder to its parent, created items aren't selected in the parent folder anymore.

I played with the code and found the cause. After going up, for some reason unknown to me, the url argument of "DolphinView::observeCreatedItem(const QUrl& url)" gets a double slash before its last part, like this:

QUrl("file:///home/pedram/Documents//Text File") 

The issue can be fixed (worked around) by using "QUrl::adjusted()", like this:

void DolphinView::observeCreatedItem(const QUrl& url)
{
    if (m_active) {
        QUrl realUrl = url.adjusted(QUrl::NormalizePathSegments);
        clearSelection();
        markUrlAsCurrent(realUrl);
        markUrlsAsSelected({realUrl});
    }
}
Comment 1 Elvis Angelaccio 2017-03-09 10:29:02 UTC
Hi, can you please provide a patch and submit it at https://phabricator.kde.org/differential/diff/create/ ?
Comment 2 Tsu Jan 2017-03-09 17:02:09 UTC
There's no registration button at https://phabricator.kde.org/differential/diff/create/ (for now?)
Comment 3 Tsu Jan 2017-03-09 17:03:12 UTC
BTW, this is a just workaround; why that double slash, in the first place?
Comment 4 Tsu Jan 2017-03-09 18:26:55 UTC
Added the patch at https://git.reviewboard.kde.org/r/130001/
Comment 5 Tsu Jan 2017-03-14 06:53:45 UTC
The problem of url's with double slashed is more fundamental than https://git.reviewboard.kde.org/r/130001/. For example, Folder View creates such url's easily. I think something basic in KDE's url handling is a little buggy.
Comment 6 Julian Steinmann 2018-05-18 18:11:01 UTC
This does still happen with Dolphin 18.04 -> confirmed. As @Tsu Jan said, the issue lies deeper than within observeCreatedItem() - if somebody want to investigate this then please go ahead.
Comment 7 Akseli Lahtinen 2023-12-15 09:37:47 UTC
Cant reproduce, seems to be fixed.