From be01b0c36a03efc7d8c1a28d34a1b1a941bf0343 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 4 Sep 2021 20:26:09 +0200 Subject: [PATCH] Rename wxLocaleIdent::IsDefault() to IsEmpty() We don't use empty wxLocaleIdent as default user locale and it doesn't make much sense to do it, as the default locale is already accessible via wxUILocale::GetDefault(). --- include/wx/uilocale.h | 6 +++--- interface/wx/uilocale.h | 10 ++++++---- src/unix/uilocale.cpp | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/wx/uilocale.h b/include/wx/uilocale.h index 9e052c6fe6..4bd9d49ce5 100644 --- a/include/wx/uilocale.h +++ b/include/wx/uilocale.h @@ -33,7 +33,7 @@ enum class WXDLLIMPEXP_BASE wxLocaleIdent { public: - // Leave language empty + // Default ctor creates an empty, invalid identifier. wxLocaleIdent() { } // Construct from language, i.e. a two-letter ISO 639-1 code (or a @@ -69,8 +69,8 @@ public: // Construct platform dependent name wxString GetName() const; - // Empty language represents user's default language - bool IsDefault() const + // Empty locale identifier is invalid. at least Language() must be called. + bool IsEmpty() const { return m_language.empty(); } diff --git a/interface/wx/uilocale.h b/interface/wx/uilocale.h index 063f397c2a..4c6bf8be9b 100644 --- a/interface/wx/uilocale.h +++ b/interface/wx/uilocale.h @@ -214,7 +214,9 @@ class wxLocaleIdent { public: /** - This is the default constructor and it leaves language empty. + Default constructor creates an empty and invalid locale identifier. + + At least Language() must be called to make the identifier valid. */ wxLocaleIdent(); @@ -318,9 +320,9 @@ public: wxString GetName() const; /** - Empty language represents user's default language. + Check if the locale is empty. - @return @true if language is empty, @false otherwise. + @return @true if this is an empty, invalid object. */ - bool IsDefault() const; + bool IsEmpty() const; }; diff --git a/src/unix/uilocale.cpp b/src/unix/uilocale.cpp index 96760b8973..1e6306db9e 100644 --- a/src/unix/uilocale.cpp +++ b/src/unix/uilocale.cpp @@ -261,7 +261,7 @@ wxUILocaleImplUnix::~wxUILocaleImplUnix() void wxUILocaleImplUnix::Use() { - if ( m_locId.IsDefault() ) + if ( m_locId.IsEmpty() ) { // This is the default locale, it is already in use. return;