[libcalamaresui] Document accessors in Branding
- document accessors - put all path and directory accessors together - make simple accessors inline - rename "pathprefix" to "directory" to be consistent with others
This commit is contained in:
parent
47805209c6
commit
975004fc63
@ -81,7 +81,6 @@ Branding::Branding( const QString& brandingFilePath,
|
||||
QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_descriptorPath( brandingFilePath )
|
||||
, m_componentName()
|
||||
, m_welcomeStyleCalamares( false )
|
||||
, m_welcomeExpandingLogo( true )
|
||||
{
|
||||
@ -207,20 +206,6 @@ Branding::Branding( const QString& brandingFilePath,
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Branding::descriptorPath() const
|
||||
{
|
||||
return m_descriptorPath;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Branding::componentName() const
|
||||
{
|
||||
return m_componentName;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Branding::componentDirectory() const
|
||||
{
|
||||
@ -229,13 +214,6 @@ Branding::componentDirectory() const
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Branding::translationsPathPrefix() const
|
||||
{
|
||||
return m_translationsPathPrefix;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Branding::string( Branding::StringEntry stringEntry ) const
|
||||
{
|
||||
@ -272,12 +250,6 @@ Branding::image( Branding::ImageEntry imageEntry, const QSize& size ) const
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Branding::slideshowPath() const
|
||||
{
|
||||
return m_slideshowPath;
|
||||
}
|
||||
|
||||
void
|
||||
Branding::setGlobals( GlobalStorage* globalStorage ) const
|
||||
{
|
||||
|
@ -77,16 +77,27 @@ public:
|
||||
explicit Branding( const QString& brandingFilePath,
|
||||
QObject* parent = nullptr );
|
||||
|
||||
QString descriptorPath() const;
|
||||
QString componentName() const;
|
||||
/** @brief Complete path of the branding descriptor file. */
|
||||
QString descriptorPath() const { return m_descriptorPath; }
|
||||
/** @brief The component name found in the descriptor file.
|
||||
*
|
||||
* The component name always matches the last directory name in the path.
|
||||
*/
|
||||
QString componentName() const { return m_componentName; }
|
||||
/** @brief The directory holding all of the branding assets. */
|
||||
QString componentDirectory() const;
|
||||
QString translationsPathPrefix() const;
|
||||
/** @brief The directory where branding translations live.
|
||||
*
|
||||
* This is componentDir + "/lang".
|
||||
*/
|
||||
QString translationsDirectory() const { return m_translationsPathPrefix; }
|
||||
/** @brief Path to the slideshow QML file, if any. */
|
||||
QString slideshowPath() const { return m_slideshowPath; }
|
||||
|
||||
QString string( Branding::StringEntry stringEntry ) const;
|
||||
QString styleString( Branding::StyleEntry styleEntry ) const;
|
||||
QString imagePath( Branding::ImageEntry imageEntry ) const;
|
||||
QPixmap image( Branding::ImageEntry imageEntry, const QSize& size ) const;
|
||||
QString slideshowPath() const;
|
||||
|
||||
bool welcomeStyleCalamares() const { return m_welcomeStyleCalamares; }
|
||||
bool welcomeExpandingLogo() const { return m_welcomeExpandingLogo; }
|
||||
|
@ -257,7 +257,7 @@ WelcomePage::initLanguages()
|
||||
|
||||
if ( isTranslationAvailable )
|
||||
CalamaresUtils::installTranslator( matchedLocale.name(),
|
||||
Calamares::Branding::instance()->translationsPathPrefix(),
|
||||
Calamares::Branding::instance()->translationsDirectory(),
|
||||
qApp );
|
||||
else
|
||||
cWarning() << "No available translation matched" << defaultLocale;
|
||||
@ -272,7 +272,7 @@ WelcomePage::initLanguages()
|
||||
|
||||
QLocale::setDefault( selectedLocale );
|
||||
CalamaresUtils::installTranslator( selectedLocale,
|
||||
Calamares::Branding::instance()->translationsPathPrefix(),
|
||||
Calamares::Branding::instance()->translationsDirectory(),
|
||||
qApp );
|
||||
} );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user