MythTV  master
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MythLocale Class Reference

#include <mythlocale.h>

Public Member Functions

 MythLocale (const QString &localeName=QString())
 
 ~MythLocale ()=default
 
void ReInit ()
 
QString GetCountryCode () const
 
QString GetCountry () const
 ISO3166 2-letter. More...
 
QString GetNativeCountry () const
 Name of country in English. More...
 
QString GetLanguageCode () const
 Name of country in the native language. More...
 
QString GetLanguage () const
 ISO639 2-letter. More...
 
QString GetNativeLanguage () const
 Name of language in English. More...
 
QString GetLocaleCode () const
 Name of language in that language. More...
 
const QLocale ToQLocale () const
 
bool LoadDefaultsFromXML (void)
 
void SaveLocaleDefaults (bool overwrite=false)
 
void ResetToLocaleDefaults (void)
 
void ResetToStandardDefaults (void)
 
QString GetLocaleSetting (const QString &key)
 

Private Types

typedef QMap< QString, QString > SettingsMap
 

Private Member Functions

void Init (const QString &localeName=QString())
 

Private Attributes

QString m_localeCode
 
bool m_defaultsLoaded {false}
 
QLocale m_qtLocale
 
SettingsMap m_globalSettings
 
SettingsMap m_hostSettings
 

Detailed Description

Definition at line 12 of file mythlocale.h.

Member Typedef Documentation

◆ SettingsMap

typedef QMap<QString, QString> MythLocale::SettingsMap
private

Definition at line 46 of file mythlocale.h.

Constructor & Destructor Documentation

◆ MythLocale()

MythLocale::MythLocale ( const QString &  localeName = QString())
explicit

Definition at line 16 of file mythlocale.cpp.

◆ ~MythLocale()

MythLocale::~MythLocale ( )
default

Member Function Documentation

◆ ReInit()

void MythLocale::ReInit ( )

Definition at line 53 of file mythlocale.cpp.

Referenced by MythCoreContext::ReInitLocale().

◆ GetCountryCode()

QString MythLocale::GetCountryCode ( void  ) const

◆ GetCountry()

QString MythLocale::GetCountry ( ) const

ISO3166 2-letter.

Definition at line 65 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetNativeCountry()

QString MythLocale::GetNativeCountry ( void  ) const

Name of country in English.

Definition at line 70 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetLanguageCode()

QString MythLocale::GetLanguageCode ( void  ) const

Name of country in the native language.

Definition at line 75 of file mythlocale.cpp.

Referenced by GetLanguage(), GetNativeLanguage(), and LanguageSelection::Load().

◆ GetLanguage()

QString MythLocale::GetLanguage ( void  ) const

ISO639 2-letter.

Definition at line 82 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetNativeLanguage()

QString MythLocale::GetNativeLanguage ( void  ) const

Name of language in English.

Definition at line 87 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetLocaleCode()

QString MythLocale::GetLocaleCode ( ) const
inline

◆ ToQLocale()

const QLocale MythLocale::ToQLocale ( ) const
inline

◆ LoadDefaultsFromXML()

bool MythLocale::LoadDefaultsFromXML ( void  )

Definition at line 92 of file mythlocale.cpp.

Referenced by GetLocaleSetting(), and SaveLocaleDefaults().

◆ SaveLocaleDefaults()

void MythLocale::SaveLocaleDefaults ( bool  overwrite = false)

Definition at line 172 of file mythlocale.cpp.

Referenced by ResetToLocaleDefaults(), and MythCoreContext::SaveLocaleDefaults().

◆ ResetToLocaleDefaults()

void MythLocale::ResetToLocaleDefaults ( void  )

Definition at line 194 of file mythlocale.cpp.

◆ ResetToStandardDefaults()

void MythLocale::ResetToStandardDefaults ( void  )

Definition at line 199 of file mythlocale.cpp.

◆ GetLocaleSetting()

QString MythLocale::GetLocaleSetting ( const QString &  key)

Definition at line 206 of file mythlocale.cpp.

Referenced by LanguageSelection::Load().

◆ Init()

void MythLocale::Init ( const QString &  localeName = QString())
private

Definition at line 21 of file mythlocale.cpp.

Referenced by MythLocale(), and ReInit().

Member Data Documentation

◆ m_localeCode

QString MythLocale::m_localeCode
private

Definition at line 42 of file mythlocale.h.

Referenced by GetCountryCode(), GetLanguageCode(), Init(), and LoadDefaultsFromXML().

◆ m_defaultsLoaded

bool MythLocale::m_defaultsLoaded {false}
private

Definition at line 43 of file mythlocale.h.

Referenced by GetLocaleSetting(), LoadDefaultsFromXML(), and SaveLocaleDefaults().

◆ m_qtLocale

QLocale MythLocale::m_qtLocale
private

Definition at line 44 of file mythlocale.h.

Referenced by Init().

◆ m_globalSettings

SettingsMap MythLocale::m_globalSettings
private

Definition at line 47 of file mythlocale.h.

Referenced by GetLocaleSetting(), LoadDefaultsFromXML(), and SaveLocaleDefaults().

◆ m_hostSettings

SettingsMap MythLocale::m_hostSettings
private

Definition at line 48 of file mythlocale.h.

Referenced by GetLocaleSetting(), LoadDefaultsFromXML(), and SaveLocaleDefaults().


The documentation for this class was generated from the following files: