Optimize code when dropping files into the desktop

Authored by trmdi on Jan 30 2020, 11:36 AM.

Description

Optimize code when dropping files into the desktop

Summary:
Currently, when you have the desktop in the Desktop layout, if you drop 10 jpg files into the desktop, it creates 10 menus at the same position.
When you have the desktop in the Folder layout, if you drop 10 jpg files into the desktop, it calls KIO::setApplicationActions() 10 times.

What does this improve?

  • Do not create KIO::MimetypeJob for each file
  • Do not call DropJob::setApplicationActions() too many times/ create too many menus for each file.

My idea is that, when you drop files into the desktop:

  • If they have the same mimetype -> we add actions support this mimetype.
  • If not -> we only show the action from KIO::DropJob and only actions support different mimetypes at the same time like Add icon...

Require: D26484
CCBUG: 415917

Reviewers: Plasma, mart, broulik, VDG, davidedmundson

Reviewed By: Plasma, davidedmundson

Subscribers: davidedmundson, anthonyfieroni, Plasma, kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D26691

Details