Support both QString and QIcon for dragHelper pixmap
ClosedPublic

Authored by broulik on Aug 2 2018, 8:43 AM.

Details

Summary

The model was changed a while ago to return a QString if possible to have icon processing done in the delegate QML on-demand. This broke the drag helper's drag pixmap, however, as the QML would pass in model.decoration which might be a string.

Test Plan

5.12

  • Have proper drag pixmaps for all entries again
  • Custom icons (e.g. favicon) still work

Diff Detail

Repository
R112 Milou
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Aug 2 2018, 8:43 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 2 2018, 8:43 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Aug 2 2018, 8:43 AM
apol added a subscriber: apol.Aug 2 2018, 10:35 AM
apol added inline comments.
lib/draghelper.h
47–48

This is an exported method, is this not a public library? :/

broulik added inline comments.Aug 2 2018, 10:40 AM
lib/draghelper.h
47–48

Milou is released as part of plasma and this class is only for QML use, don't recall why it's exported anymore but there's also no header installed for it. As far as QML is concerned, a function call will still work as before.

apol accepted this revision.Aug 2 2018, 10:50 AM

Meh, then go for it.
Remove the unneeded exports? (In a separate patch, if you want)

This revision is now accepted and ready to land.Aug 2 2018, 10:50 AM
broulik updated this revision to Diff 39285.Aug 8 2018, 7:12 AM

Turns out the library is really exported and the qml plugin just links to it rather than "be" that library.

  • Add another overload instead
davidedmundson accepted this revision.Aug 8 2018, 10:29 AM
This revision was automatically updated to reflect the committed changes.