[keyboard] Removed unnecessary repacking in xkbmap_layout_args
This commit is contained in:
parent
09b5e42734
commit
354dc1613a
@ -50,15 +50,12 @@ xkbmap_layout_args( const QString& layout, const QString& variant )
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline QStringList
|
static inline QStringList
|
||||||
xkbmap_layout_args( const QList<QPair<QString, QString>> layoutsAndVariantsList, const QString& switchOption = "grp:alt_shift_toggle")
|
xkbmap_layout_args( const QStringList& layouts, const QStringList& variants, const QString& switchOption = "grp:alt_shift_toggle")
|
||||||
{
|
{
|
||||||
QStringList layouts;
|
if ( layouts.size() != variants.size() )
|
||||||
QStringList variants;
|
|
||||||
|
|
||||||
for( auto& [layout,variant] : layoutsAndVariantsList )
|
|
||||||
{
|
{
|
||||||
layouts.append(layout);
|
cError() << "Number of layouts and variants must be equal (empty string should be used if there is no corresponding variant)";
|
||||||
variants.append(variant);
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList r{ "-layout", layouts.join( "," ) };
|
QStringList r{ "-layout", layouts.join( "," ) };
|
||||||
@ -183,10 +180,9 @@ Config::Config( QObject* parent )
|
|||||||
m_selectedLayoutsAdditionalLayoutInfo = info;
|
m_selectedLayoutsAdditionalLayoutInfo = info;
|
||||||
QString switchOption = xkbmap_query_grp_option();
|
QString switchOption = xkbmap_query_grp_option();
|
||||||
|
|
||||||
QProcess::execute( "setxkbmap", xkbmap_layout_args( {
|
QProcess::execute( "setxkbmap", xkbmap_layout_args(
|
||||||
{m_selectedLayout, m_selectedVariant},
|
{ m_selectedLayout, info.additionalLayout },
|
||||||
{info.additionalLayout, info.additionalVariant}
|
{ m_selectedVariant, info.additionalVariant },
|
||||||
},
|
|
||||||
switchOption.isEmpty()?"grp:alt_shift_toggle":QString() )
|
switchOption.isEmpty()?"grp:alt_shift_toggle":QString() )
|
||||||
);
|
);
|
||||||
cDebug() << "xkbmap selection changed to: " << m_selectedLayout << '-' << m_selectedVariant
|
cDebug() << "xkbmap selection changed to: " << m_selectedLayout << '-' << m_selectedVariant
|
||||||
|
Loading…
Reference in New Issue
Block a user