<table><tr><td style="">simgunz created this revision.<br />Restricted Application added a project: Frameworks.<br />Restricted Application added a subscriber: Frameworks.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8056" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The current "open with" dialog implementation does not follow the KDE principle "Simple by default, powerful when needed" for the following reasons:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">The current primary goal of the lineedit is to type in a command. Indeed when start typing a drop-down list with command auto-completion appears.</li>
</ul>

<p>Usability problems:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">The mentioned drop-down list covers the application tree</li>
<li class="remarkup-list-item">It's not possible to search in the application tree, so to find a software it is necessary to guess the category every time</li>
</ul>

<p>My patch changes the behavior as follow:</p>

<p>Simple by default:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">The primary goal of the lineedit is to be a search box that allows to filter the applications in the tree</li>
<li class="remarkup-list-item">The command auto-completion is disabled by default</li>
</ul>

<p>Powerful when needed</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">The command autocompletion can be turned on by advanced users by selecting the preferred autocompletion mode in the right click context menu of the lineedit (this behavior is quite hidden, and I guess most of the normal users don't even know it's possible (I didn't know it until I dig into the code))</li>
</ul>

<p>Implementation details:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">The application tree filtering is achieved using a subclass of QSortFilterProxyModel</li>
<li class="remarkup-list-item">When 3 characters are typed in the search box all the tree is expanded (there should be few matching entries at this point)</li>
<li class="remarkup-list-item">When the 3rd character is deleted all the tree is collapsed</li>
<li class="remarkup-list-item">In order to be able to filter, it's necessary to fetch all the tree nodes when the model is created, and not on demand as it was before. This is achieved by adding a fetchAll method. Maybe there is a more elegant way.</li>
</ul>

<p>I've tested the implementation, but I'm pretty sure I haven't covered all the possible cases, so a careful testing is necessary.</p>

<p>Relevant discussions:<br />
<a href="https://bugs.kde.org/show_bug.cgi?id=359233" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=359233</a><br />
<a href="https://forum.kde.org/viewtopic.php?f=285&t=131014" class="remarkup-link" target="_blank" rel="noreferrer">https://forum.kde.org/viewtopic.php?f=285&t=131014</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>BRANCH</strong><div><div>openwithdialog-filter-app-tree</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8056" rel="noreferrer">https://phabricator.kde.org/D8056</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/widgets/kopenwithdialog.cpp<br />
src/widgets/kopenwithdialog_p.h</div></div></div><br /><div><strong>To: </strong>simgunz<br /><strong>Cc: </strong>Frameworks<br /></div>