[spellcheck runner] Make each suggestion copyable as separate item
ClosedPublic

Authored by kossebau on Feb 14 2018, 12:50 AM.

Details

Summary

Before all suggestions are only shown as single item with a text of
comma-separated terms. So one cannot select a single suggested term and e.g.
copy it to the clipboard

And if correct term, the term is not copyable directly as well.

Test Plan

Activate spellcheck runner (disabled by default), enter
"spell Compilcated" or similar
and select spellchecker menu items.

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Feb 14 2018, 12:50 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 14 2018, 12:50 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Feb 14 2018, 12:50 AM
kossebau added inline comments.Feb 14 2018, 12:53 AM
runners/spellchecker/spellcheck.cpp
232

Not sure if HelperMatch is the correct thing here. Similar runners use InformationalMatch here, so on selection the term is copied into the runner.

What is the modern krunner way to support the use-case of someone wanting to know the spelling of some word, and then copy the correct or suggested into the clipboard for further usage?

broulik accepted this revision.Feb 20 2018, 10:37 PM
and then copy the correct or suggested into the clipboard for further usage?

Calculator runner does setText on QClipboard in run, so I guess this is the way.
InformationalMatch causes the data to be set as query when run. Pick your poison.

runners/spellchecker/spellcheck.cpp
235

Add some context, "Correct" could also be a verb

This revision is now accepted and ready to land.Feb 20 2018, 10:37 PM

Thanks for review.

and then copy the correct or suggested into the clipboard for further usage?

Calculator runner does setText on QClipboard in run, so I guess this is the way.

Which seems to not be triggered when chosing the match though, from what I tested incl. extra debug log.

Currently one has to use the action enabled on the match to get the result copied to the clipboard.

So chance is that code is dead code, either due to being copy&paste on plugin creation or due to policy changes in krunner plasma5 porting?

InformationalMatch causes the data to be set as query when run. Pick your poison.

I guess that most use cases with this runner are when someone wants to use to correct term in other places, so on selecting the match people do not intend to have it as new query content for further queries, but have the term straight available for use in that other place (-> clipboard).
So considering to take the HelperMatch pill. Though might also go for extra copy action as with calculator.

This revision was automatically updated to reflect the committed changes.