Improve KLanguageButton::insertLanguage when no name is passed
ClosedPublic

Authored by aacid on Feb 11 2018, 12:01 PM.

Details

Summary

Move the reading of kf5_entry.desktop from KLanguageButton::loadAllLanguages
to KLanguageButton::insertLanguage that way all the users can benefit
from it

Use QLocale::languageToString if QLocale::nativeLanguageName is empty,
this comes from KSwitchLanguageDialogPrivate::fillApplicationLanguages

Diff Detail

Repository
R265 KConfigWidgets
Branch
arcpatch-D10444_1
Lint
No Linters Available
Unit
No Unit Test Coverage
aacid created this revision.Feb 11 2018, 12:01 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 11 2018, 12:01 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
aacid requested review of this revision.Feb 11 2018, 12:01 PM
aacid updated this revision to Diff 26924.Feb 11 2018, 12:23 PM

Do not return "without name" in nameFromEntryFile

An empty string is better so the fallback ifs try to get a name for the language code

apol added a subscriber: apol.Feb 12 2018, 1:43 PM
apol added inline comments.
src/klanguagebutton.cpp
148 ↗(On Diff #26924)

Why QStringLiteral("locale") + QLatin1Char('/')?

aacid added inline comments.Feb 12 2018, 10:11 PM
src/klanguagebutton.cpp
148 ↗(On Diff #26924)

Because i wrote that as result of copy&paste, i'll fix it.

aacid updated this revision to Diff 27027.Feb 12 2018, 10:12 PM

fix suggestion by Aleix

apol accepted this revision.Feb 19 2018, 3:58 PM

LGTM

This revision is now accepted and ready to land.Feb 19 2018, 3:58 PM
This revision was automatically updated to reflect the committed changes.