klipper: ignore file previews from network mounts

Reason for the change

A remote desktop application like RustDesk that relies on fuse to support seamless clipboard might leave a local file url in the clipboard but the file is actually a remote file. If there are many urls like that and those remote files are big enough, plasmashell will hang in the end.

QUrl::isLocalFile doesn't check if a file is on a network mount. Instead, use KFileItem::isSlow which has a more comprehensive logic to detect remote files.

Test plan

  1. Use RustDesk to connect to a remote Windows desktop
  2. Enable “Enable file copy and paste” which should be enabled by default
  3. Copy a lot of big files in the remote desktop
  4. plasmashell should not hang after a while

Screenshots or screen recordings

Bugs fixed

Merge request reports

Loading