Bug 422155 - Skrooge doesn't use per-locale bank icons
Summary: Skrooge doesn't use per-locale bank icons
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: Trunk from git
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Guillaume DE BURE
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-28 04:46 UTC by skierpage
Modified: 2020-05-28 21:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2020-05-28 04:46:48 UTC
SUMMARY
Skrooge has a US-specific share/skrooge/images/logo/l10n/us/list_bank.txt file, but it doesn't use it.

STEPS TO REPRODUCE
1. Somehow be in the USA.(set System Settings > Regional Settings > Formats > Region? or modify ~/.config/plasma-localerc.)
2. Run Skrooge
3. Click Accounts, then click in the bank icon field.

OBSERVED RESULT
The pop-up shows the full of bank icons in share/skrooge/images/logo/list_bank.txt , not the (much shorter) list of 7 banks in share/skrooge/images/logo/l10n/us/list_bank.txt/us/list_bank.txt

EXPECTED RESULT
Use the localized bank list.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: n/a
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
The code in plugins/skrooge/skrooge_bank/skgbankpluginwidget.cpp attempts to locate
  QStandardPaths::GenericDataLocation, "skrooge/images/logo/l10n/" % QLocale::countryToString(QLocale().country()) % "/list_bank.txt"

but according to SKGStatistic output in ~/.skrooge/ , my current.country is "United States" (prior to May 2019 it has no space). Sure enough, if I copy the "us" file to "United States", e.g. (for my flatpak)
  $ cd /var/lib/flatpak/app/org.kde.skrooge/x86_64/master/active/files/
  $ sudo cp -pir share/skrooge/images/logo/l10n/{us,United\ States}

and restart Skrooge, it does show the short US list of banks. The fix is to use some other Qt logic that returns the shorter country code, maybe QLocale::name()?
Comment 1 Stephane MANKOWSKI 2020-05-28 21:39:19 UTC
Git commit 13053ed78909d2921baa4b87bc54146ee050d788 by Stephane MANKOWSKI.
Committed on 28/05/2020 at 21:39.
Pushed by smankowski into branch 'master'.

Skrooge doesn't use per-locale bank icons

M  +1    -0    CHANGELOG
M  +2    -0    plugins/generic/skg_statistic/skgstatisticplugin.cpp
M  +1    -1    plugins/skrooge/skrooge_bank/skgbankpluginwidget.cpp
M  +1    -1    plugins/skrooge/skrooge_categories/skgcategoriesplugin.cpp

https://invent.kde.org/office/skrooge/commit/13053ed78909d2921baa4b87bc54146ee050d788