keyboard: Pass settings directly, not through GlobalStorage.
Pass the settings from keyboard.conf directly to the SetKeyboardLayoutJob rather than through GlobalStorage.
This commit is contained in:
parent
2fec6e3202
commit
86d51b4a9c
@ -190,7 +190,8 @@ KeyboardPage::prettyStatus() const
|
||||
|
||||
|
||||
QList< Calamares::job_ptr >
|
||||
KeyboardPage::createJobs()
|
||||
KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
||||
const QString& convertedKeymapPath )
|
||||
{
|
||||
QList< Calamares::job_ptr > list;
|
||||
QString selectedModel = m_models.value( ui->comboBoxModel->currentText(),
|
||||
@ -198,7 +199,9 @@ KeyboardPage::createJobs()
|
||||
|
||||
Calamares::Job* j = new SetKeyboardLayoutJob( selectedModel,
|
||||
m_selectedLayout,
|
||||
m_selectedVariant );
|
||||
m_selectedVariant,
|
||||
xOrgConfFileName,
|
||||
convertedKeymapPath );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
|
||||
return list;
|
||||
|
@ -48,7 +48,8 @@ public:
|
||||
|
||||
QString prettyStatus() const;
|
||||
|
||||
QList< Calamares::job_ptr > createJobs();
|
||||
QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
|
||||
const QString& convertedKeymapPath );
|
||||
|
||||
void finalize();
|
||||
|
||||
|
@ -108,7 +108,7 @@ void
|
||||
KeyboardViewStep::onLeave()
|
||||
{
|
||||
m_widget->finalize();
|
||||
m_jobs = m_widget->createJobs();
|
||||
m_jobs = m_widget->createJobs( m_xOrgConfFileName, m_convertedKeymapPath );
|
||||
m_prettyStatus = m_widget->prettyStatus();
|
||||
}
|
||||
|
||||
@ -123,23 +123,23 @@ KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
configurationMap.value( "xOrgConfFileName" ).type() == QVariant::String &&
|
||||
!configurationMap.value( "xOrgConfFileName" ).toString().isEmpty() )
|
||||
{
|
||||
gs->insert( "keyboardXOrgConfFileName",
|
||||
configurationMap.value( "xOrgConfFileName" ) );
|
||||
m_xOrgConfFileName = configurationMap.value( "xOrgConfFileName" )
|
||||
.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
gs->insert( "keyboardXOrgConfFileName", "00-keyboard.conf" );
|
||||
m_xOrgConfFileName = "00-keyboard.conf";
|
||||
}
|
||||
|
||||
if ( configurationMap.contains( "convertedKeymapPath" ) &&
|
||||
configurationMap.value( "convertedKeymapPath" ).type() == QVariant::String &&
|
||||
!configurationMap.value( "convertedKeymapPath" ).toString().isEmpty() )
|
||||
{
|
||||
gs->insert( "keyboardConvertedKeymapPath",
|
||||
configurationMap.value( "convertedKeymapPath" ) );
|
||||
m_convertedKeymapPath = configurationMap.value( "convertedKeymapPath" )
|
||||
.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
gs->remove( "keyboardConvertedKeymapPath" );
|
||||
m_convertedKeymapPath = QString();
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,9 @@ private:
|
||||
bool m_nextEnabled;
|
||||
QString m_prettyStatus;
|
||||
|
||||
QString m_xOrgConfFileName;
|
||||
QString m_convertedKeymapPath;
|
||||
|
||||
QList< Calamares::job_ptr > m_jobs;
|
||||
};
|
||||
|
||||
|
@ -37,11 +37,15 @@
|
||||
|
||||
SetKeyboardLayoutJob::SetKeyboardLayoutJob( const QString& model,
|
||||
const QString& layout,
|
||||
const QString& variant )
|
||||
const QString& variant,
|
||||
const QString& xOrgConfFileName,
|
||||
const QString& convertedKeymapPath )
|
||||
: Calamares::Job()
|
||||
, m_model( model )
|
||||
, m_layout( layout )
|
||||
, m_variant( variant )
|
||||
, m_xOrgConfFileName( xOrgConfFileName )
|
||||
, m_convertedKeymapPath( convertedKeymapPath )
|
||||
{
|
||||
}
|
||||
|
||||
@ -243,14 +247,12 @@ SetKeyboardLayoutJob::exec()
|
||||
// Get the path to the destination's /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
QString xorgConfDPath = destDir.absoluteFilePath( "etc/X11/xorg.conf.d" );
|
||||
destDir.mkpath( xorgConfDPath );
|
||||
QString keyboardConfFile = gs->value( "keyboardXOrgConfFileName" ).toString();
|
||||
QString keyboardConfPath = QDir( xorgConfDPath )
|
||||
.absoluteFilePath( keyboardConfFile );
|
||||
.absoluteFilePath( m_xOrgConfFileName );
|
||||
|
||||
// Get the path to the destination's path to the converted key mappings
|
||||
QString convertedKeymapPath;
|
||||
QString convertedKeymapPathSetting
|
||||
= gs->value( "keyboardConvertedKeymapPath" ).toString();
|
||||
QString convertedKeymapPathSetting = m_convertedKeymapPath;
|
||||
if ( !convertedKeymapPathSetting.isEmpty() )
|
||||
{
|
||||
while ( convertedKeymapPathSetting.startsWith( '/' ) )
|
||||
|
@ -29,7 +29,9 @@ class SetKeyboardLayoutJob : public Calamares::Job
|
||||
public:
|
||||
SetKeyboardLayoutJob( const QString& model,
|
||||
const QString& layout,
|
||||
const QString& variant );
|
||||
const QString& variant,
|
||||
const QString& xOrgConfFileName,
|
||||
const QString& convertedKeymapPath );
|
||||
|
||||
QString prettyName() const override;
|
||||
Calamares::JobResult exec() override;
|
||||
@ -44,6 +46,8 @@ private:
|
||||
QString m_model;
|
||||
QString m_layout;
|
||||
QString m_variant;
|
||||
QString m_xOrgConfFileName;
|
||||
QString m_convertedKeymapPath;
|
||||
};
|
||||
|
||||
#endif /* SETKEYBOARDLAYOUTJOB_H */
|
||||
|
Loading…
Reference in New Issue
Block a user