Bug 369611 - Dolphin cannot create links to files, only directories
Summary: Dolphin cannot create links to files, only directories
Status: RESOLVED DUPLICATE of bug 357171
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-01 16:48 UTC by Guo Yunhe
Modified: 2017-11-20 04:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guo Yunhe 2016-10-01 16:48:29 UTC
Screenshot http://imgur.com/Ze1GYVz



Reproducible: Always

Steps to Reproduce:
1. Write click, open context menu. choose create symbol link to file or directory, open the dialog.
2. Choose New --> Create symbol link to file or directory. Open input dialog.
3. Click the "open" icon, open file dialog.
4. Select file in file dialog.

Actual Results:  
Can only select directory in file dialog. Cannot select not file. So cannot create file link.

Expected Results:  
The file dialog should allows to choose both files and folders.
Comment 1 Nate Graham 2017-08-18 16:17:22 UTC
Confirmed.
Comment 2 Nate Graham 2017-08-18 21:47:26 UTC
Digging into this, the problem is in KIO. In kio/src/filewidgets/knameandurlinputdialog.cpp, the file picker is called with:

d->m_urlRequester->setMode(KFile::File | KFile::Directory);

The intention seems to have been to make it accept both file and directory input, but the actual result appears to be to limit it to directory-only input.
Comment 3 Nate Graham 2017-08-19 19:07:40 UTC
It turns out this is impossible as currently implemented, because the QT file picker does not have a mode that allow the selection of either files or directories--only one at a time (https://bugreports.qt.io/browse/QTBUG-720). We could change it to show files, but then it wouldn't accept directories as input.

Until and unless the QT file dialog gains that ability, we need to rewrite how we handle this use case to account for the lack of this feature.
Comment 4 Guo Yunhe 2017-08-19 21:52:09 UTC
One quick idea:

Have two context menu entries and dialog:

1. Link to a file --> use a file picker
2. Link to a folder --> use a folder picker

This will give users the function they want before Qt support this feature.
Comment 5 Nate Graham 2017-08-19 22:44:04 UTC
Yes, that was my thought as well. However changing it to that approach involves a lot of work given the way this feature is currently implemented, and it also has translation implications (changing one already-translated string to two new ones).
Comment 6 Nate Graham 2017-11-20 04:43:30 UTC

*** This bug has been marked as a duplicate of bug 357171 ***