diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index 584d85c0b..f9f66a9fc 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -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 { diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index fe9a83979..a3253e500 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -63,7 +63,7 @@ public: ProductIcon, ProductWelcome }; - + enum StyleEntry : short { SidebarBackground, @@ -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; } diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 0a1d2fb7d..c7a30c4f2 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -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 ); } ); }