[libcalamares] Moc warnings--

- don't have a NOTIFY CONSTANT property
 - the data is constant, so drop NOTIFY
 - remove redundant signals
 - remove setLabels() now it's only needed from one constructor
This commit is contained in:
Adriaan de Groot 2020-02-11 16:40:36 +01:00
parent b4b1bf5de2
commit 684c5f477c
2 changed files with 3 additions and 19 deletions

View File

@ -35,13 +35,6 @@ Label::Label( const QString& locale, LabelFormat format, QObject* parent )
, m_localeId( locale.isEmpty() ? m_locale.name() : locale )
{
setLabels( locale, format );
}
void
Label::setLabels( const QString& locale, LabelFormat format )
{
emit localeIdChanged( m_localeId );
//: language[name] (country[name])
QString longFormat = QObject::tr( "%1 (%2)" );
@ -62,10 +55,8 @@ Label::setLabels( const QString& locale, LabelFormat format )
countryName = m_locale.nativeCountryName();
}
m_label = needsCountryName ? longFormat.arg( languageName, countryName ) : languageName;
emit labelChanged( m_label );
m_englishLabel = needsCountryName ? longFormat.arg( englishName, QLocale::countryToString( m_locale.country() ) )
: englishName;
emit englishLabelChanged( m_englishLabel );
}
QLocale

View File

@ -40,9 +40,9 @@ class Label : public QObject
{
Q_OBJECT
Q_PROPERTY( QString label READ label NOTIFY labelChanged CONSTANT FINAL )
Q_PROPERTY( QString englishLabel READ englishLabel NOTIFY englishLabelChanged CONSTANT FINAL )
Q_PROPERTY( QString localeId MEMBER m_localeId NOTIFY localeIdChanged CONSTANT FINAL )
Q_PROPERTY( QString label READ label CONSTANT FINAL )
Q_PROPERTY( QString englishLabel READ englishLabel CONSTANT FINAL )
Q_PROPERTY( QString localeId MEMBER m_localeId CONSTANT FINAL )
public:
/** @brief Formatting option for label -- add (country) to label. */
@ -103,17 +103,10 @@ public:
static QLocale getLocale( const QString& localeName );
protected:
void setLabels( const QString& name, LabelFormat format );
QLocale m_locale;
QString m_localeId; // the locale identifier, e.g. "en_GB"
QString m_label; // the native name of the locale
QString m_englishLabel;
signals:
void labelChanged( QString label );
void englishLabelChanged( QString englishLabel );
void localeIdChanged( QString localeIdChanged );
};
} // namespace Locale