dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kopenwithdialog.cpp:463
>  
> -    if (d->appModel && !d->appModel->isDirectory(current)) {
> -        QString exec = d->appModel->execFor(current);
> +    QModelIndex sourceCurrent = static_cast<QTreeViewProxyFilter 
> *>(model())->mapToSource(current);
> +

Use the member var instead of casting.

> kopenwithdialog.cpp:830
> +    //Update the filter regexp with the new text in the lineedit
> +    static_cast<QTreeViewProxyFilter 
> *>(d->view->model())->setFilterFixedString(d->edit->text());
> +

Could the view have a method that returns the proxymodel (possibly as a 
QSortFilterProxyModel* if we don't actually need a subclass-typed pointer), to 
avoid this cast?
Such casts make refactoring more difficult, moving problems from compile-time 
to runtime.

> kopenwithdialog.cpp:1108
> +                }
> +                return false;
> +            }

All this "return false" cascade isn't really needed, a single return false at 
the end would do the job, or even better, calling the eventFilter method of the 
base class, just in case that's implemented for other reasons.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D8056

To: simgunz, dfaure, #frameworks, #vdg, ngraham, rkflx
Cc: rkflx, subdiff, fabianr, abetts, ngraham, alexeymin, #frameworks

Reply via email to