Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116642

Provide a refresh mechanism for system locale data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.6, 6.7
    • Core: Locales (i18n)
    • None
    • All
    • 13

      System L10n queries can be expensive, making it desirable to cache the responses.
      However, we also want to be able to respond to changes to the system L10n settings, which we'll miss if we consult a cached value that predates the change.
      This would require some mechanism, on each platform, for detecting when L10n settings have changed so as to trigger clearing the caches, for which QLocale would need to provide a static method.

      We can then arrange for QLocale to take care of cacheing things it gets back from QSystemLocale::query() calls; it would then clear those caches (and trigger an updateSystemPrivate(), e.g. by instantiating a transient QSystemLocale instance) when the new mechanism alerts it to the need to change.
      In so far as backends need to cache anything else internally, they can respond to QSystemLocale::query(QSystemLocale::LocaleChanged) by clearing that cached data; this happens during updateSystemPrivate().

      There is an existing QEvent::LocaleChange emitted by platform integrations that are able to detect such changes, we could potentially hook into somehow. The logical place for that would be Q{Core|Gui)Application, having it connect a QLocale system-data cache refresh slot to the signal.

      We should, separately, also consider having QLocale::setDefault() trigger emission of a signal.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Eddy Edward Welbourne
            Eddy Edward Welbourne
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes