check path

This commit is contained in:
Raul Rodrigo Segura 2018-05-20 16:47:20 +02:00
parent 1636f665c3
commit e2801daf33

View File

@ -53,7 +53,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
this->setObjectName("mainApp");
cDebug() << "Available size" << availableSize;
if ( ( availableSize.width() < windowPreferredWidth ) || ( availableSize.height() < windowPreferredHeight ) )
@ -148,10 +148,27 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge );
mainLayout->addWidget( m_viewManager->centralWidget() );
QFile File("/etc/calamares/stylesheet.qss");
File.open(QFile::ReadOnly);
QString StyleSheet = QLatin1String(File.readAll());
this->setStyleSheet(StyleSheet);
QString brandingComponentName = Calamares::Settings::instance()->brandingComponentName();
if ( brandingComponentName.simplified().isEmpty() )
{
cError() << "FATAL: branding component not set in settings.conf";
::exit( EXIT_FAILURE );
}
QString brandingQSSDescriptorPath = QString( "/etc/calamares/branding/%1/stylesheet.qss" )
.arg( brandingComponentName );
importQSSPath = QFileInfo( brandingQSSDescriptorPath );
if ( importQSSPath.exists() && importQSSPath.isReadable() )
{
QFile File(importQSSPath);
File.open(QFile::ReadOnly);
QString StyleSheet = QLatin1String(File.readAll());
this->setStyleSheet(StyleSheet);
}
}