D20838: Allow to drop one file or one folder on KDirOperator

Aleix Pol Gonzalez noreply at phabricator.kde.org
Fri Apr 26 12:33:02 BST 2019


apol added inline comments.

INLINE COMMENTS

> kdiroperator.cpp:418
>      setFocusPolicy(Qt::WheelFocus);
> +    setAcceptDrops(true);
>  }

This default change should be documented.

> kdiroperator.cpp:1401
> +            } else {
> +                QUrl url = urls.at(0);
> +

.constFirst() maybe reads better?

> kdiroperator.cpp:1419
> +                        QMetaObject::Connection connection;
> +                        auto fun = [this, url, connection](){
> +                            this->setCurrentItem(url);

maybe call the function urlSetter?

> kdiroperator.cpp:1523
> +        if (acceptsDrops) {
> +            this->view()->installEventFilter(this);
> +        } else {

Initial this-> isn't necessary, just `view()`.

> kfilewidgettest_gui.cpp:34
>  
> +    app.connect(fileWidget, &KFileWidget::destroyed, fileWidget, [&app]() {
> +        app.exit();

No need to lambda:
`QObject::connect(fileWidget, &KFileWidget::destroyed, &app, &QCoreApplication::exit);`

REPOSITORY
  R241 KIO

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

To: meven, ngraham
Cc: apol, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190426/ba445e4d/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list