Remove unnecessary code and function calls
ClosedPublic

Authored by alex on Feb 19 2020, 8:03 AM.

Details

Summary

The ShellConfig class has been deleted. This config class was in KDE4 for the runOptions widget used and the class/the settings are not used anymore.
Additionally the context type check has been removed, because this is already solved using the ignore types.
Futhermore the match icon and the list of actions can be reused.

Test Plan

Should compile and execute shell commands as before.

Diff Detail

Repository
R120 Plasma Workspace
Branch
shellrunner_cleanup
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22687
Build 22705: arc lint + arc unit
alex created this revision.Feb 19 2020, 8:03 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 19 2020, 8:03 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
alex requested review of this revision.Feb 19 2020, 8:03 AM
meven added a subscriber: meven.Feb 19 2020, 2:34 PM
meven added inline comments.
runners/shell/shellrunner.cpp
67–68

you can remove this line

alex updated this revision to Diff 76009.Feb 19 2020, 5:13 PM

Remove unnecessary Q_UNUSED macro

alex marked an inline comment as done.
meven accepted this revision.Feb 20 2020, 8:09 AM

Seems good to me, please give time to other reviewers.

This revision is now accepted and ready to land.Feb 20 2020, 8:09 AM

Cleanup is good.

Futhermore the match icon and the list of actions can be reused.

I don't think these changes really bring anything.
Icon's are cached at the layer beneath (with a proper QCache with expunging) and actionsForMatch is called so rarely that doing:

return actions().values();

Will be just as performant in practical terms.

alex added a comment.Feb 20 2020, 2:15 PM

Thanks for the feedback.

The actionsForMatch method gets actually called very often, I debugged this by adding qWarning() << match.text(); as a debug statement in the method.

But I guess that I can keep the changes.

This revision was automatically updated to reflect the committed changes.