Konsole Runner: optimize and simplify
ClosedPublic

Authored by alex on Feb 2 2020, 10:56 AM.

Details

Summary

The match method has been rewritten and the profiles are only loaded when the plugin
is initialized or the config folder changes.

Test Plan

Create different profiles and start the runner using the keyword "konsole", all profiles should show
up, if one is selected, konsole launches with this profile.
To filter the profiles you can type "konsole KEYWORD" and only the profiles that contain the keyword show up.
Furthermore you can create/edit/delete new profiles after the runner is initailized and they still show up.

Diff Detail

Repository
R114 Plasma Addons
Branch
arcpatch-D27098
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25432
Build 25450: arc lint + arc unit
alex created this revision.Feb 2 2020, 10:56 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 2 2020, 10:56 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
alex requested review of this revision.Feb 2 2020, 10:56 AM
alex updated this revision to Diff 74853.Feb 2 2020, 11:12 AM

Allow search for profiles without "konsole" prefix

alex added a reviewer: Plasma.Feb 2 2020, 7:45 PM
alex updated this revision to Diff 75724.Feb 14 2020, 6:32 PM

Remove unnecessary include, simplify

Can you rebase this patch now?

alex updated this revision to Diff 75930.Feb 18 2020, 4:45 PM

Rebase patch as requested

ngraham accepted this revision.Feb 18 2020, 5:27 PM

Looks like a sane clean-up to me. Konsole and.or Plasma folks?

This revision is now accepted and ready to land.Feb 18 2020, 5:27 PM
apol added a subscriber: apol.Mar 23 2020, 1:08 AM

If you ask me, this patch does many things:

  • fixes an issue
  • changes coding style
  • does some code bits a bit more differently.

It's hard to review for me, I hope someone else more familiar with the codebase can.

runners/konsoleprofiles/konsoleprofiles.cpp
155 ↗(On Diff #80485)

Why has the relevance code been removed?

alex added inline comments.Mar 23 2020, 6:02 AM
runners/konsoleprofiles/konsoleprofiles.cpp
155 ↗(On Diff #80485)

It has been refactored and is now in line 132/188:
match.setRelevance((float) term.length() / (float) data.displayName.length());

alex edited the summary of this revision. (Show Details)Mar 23 2020, 6:02 AM
alex retitled this revision from Bugfix: Konsole does not launch, optimize and simplify runner to Konsole Runner: optimize and simplify.
alex added inline comments.Mar 23 2020, 8:05 AM
runners/konsoleprofiles/konsoleprofiles.cpp
155 ↗(On Diff #80485)

Ups, 118 not 188

alex updated this revision to Diff 79560.Apr 7 2020, 10:45 AM

Suspend matching if the profiles are empty

alex updated this revision to Diff 80484.Apr 18 2020, 6:26 PM

Rebase

alex updated this revision to Diff 80485.Apr 18 2020, 6:30 PM

Minor issue when rebasing

alex added a comment.Apr 19 2020, 5:45 PM

@ngraham and others, may I ship this?

alex added a reviewer: meven.Apr 27 2020, 2:46 PM
alex marked 3 inline comments as done.
meven accepted this revision.May 2 2020, 6:08 AM

So yo won't be able to type "konsole myprofile" but I guess this is just fine.

alex added a comment.May 2 2020, 6:13 AM
This comment was removed by alex.
This revision was automatically updated to reflect the committed changes.