D11012: Add Trash (empty, isEmpty, emptinessChanged)

Mark Gaiser noreply at phabricator.kde.org
Sat Mar 10 14:31:23 GMT 2018


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

INLINE COMMENTS

> dolphintrash.cpp:58-68
> +    m_trashDirLister = new KDirLister();
> +    m_trashDirLister->setAutoErrorHandlingEnabled(false, nullptr);
> +    m_trashDirLister->setDelayedMimeTypes(true);
> +    auto trashDirContentChanged = [this]() {
> +        bool isTrashEmpty = m_trashDirLister->items().isEmpty();
> +        emit emptinessChanged(isTrashEmpty);
> +    };

This is slightly odd.
You made it in a separate function probably to keep the constructor clean, but this is all just constructor stuff.

Also, the m_trashDirLister should be initialized in the constructor like so:

  Trash::Trash()
    : m_trashDirLister(new KDirLister())
  {
    // ..
  }

In my opinion it's fine to move everything in the constructor.

REPOSITORY
  R318 Dolphin

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

To: rominf, #dolphin, elvisangelaccio, #kde_applications, markg
Cc: markg, rkflx, elvisangelaccio, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180310/16156604/attachment.htm>


More information about the kfm-devel mailing list