fix empty runner list after switching to new locale
Needs RevisionPublic

Authored by shaforostoff on Nov 11 2018, 10:33 PM.

Details

Summary

BUG: 196771
BUG: 366322
BUG: 358435

The actual problem in my case was that 'enabled categories' list was in English, while actual plugin names (which are used as categories for some reason - but that is out of scope of this MR) were in Russian.

Test Plan

my test scenario:
killall krunner && ninja && sudo mv bin/libKF5Runner.so.5.51.0 /usr/lib/x86_64-linux-gnu/libKF5Runner.so.5.51.0 && krunner

alt+f2

enter 'chromium'

finally get results and be able to run chromium after hitting enter

Diff Detail

Repository
R308 KRunner
Lint
Lint Skipped
Unit
Unit Tests Skipped
shaforostoff created this revision.Nov 11 2018, 10:33 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 11 2018, 10:33 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
shaforostoff requested review of this revision.Nov 11 2018, 10:33 PM
shaforostoff added a reviewer: Frameworks.
ngraham edited the summary of this revision. (Show Details)Nov 13 2018, 7:12 PM
kossebau resigned from this revision.Nov 14 2018, 9:31 PM

No time and insight, sorry.

davidedmundson added inline comments.Nov 14 2018, 9:36 PM
src/runnermanager.cpp
274

what does deadRunners have to do with this?

shaforostoff added inline comments.Dec 1 2018, 2:46 PM
src/runnermanager.cpp
274

if deadRunners is empty then there is no sense rerunning this method, and it even could cause endless recursion

davidedmundson requested changes to this revision.Dec 2 2018, 5:29 PM

Dead runners will surely be empty on the first load. You could still have had a locale change then.

Also, now I'm re-reading it you're relying on locales to always have unique strings. It's perfectly plausible that spanish and italian could have 1 word matching. Or two locales having an untranslated value. As long as 1 value remains the same this workaround won't work.

This revision now requires changes to proceed.Dec 2 2018, 5:29 PM