[keyboard] Improve debug-logging for writing etc/default

This commit is contained in:
Adriaan de Groot 2020-11-04 16:31:35 +01:00
parent cbc376a206
commit 705e6dd8d6

View File

@ -310,8 +310,14 @@ SetKeyboardLayoutJob::writeX11Data( const QString& keyboardConfPath ) const
bool
SetKeyboardLayoutJob::writeDefaultKeyboardData( const QString& defaultKeyboardPath ) const
{
cDebug() << "Writing default keyboard data to" << defaultKeyboardPath;
QFile file( defaultKeyboardPath );
file.open( QIODevice::WriteOnly | QIODevice::Text );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
cError() << "Could not open" << defaultKeyboardPath << "for writing";
return false;
}
QTextStream stream( &file );
stream << "# KEYBOARD CONFIGURATION FILE\n\n"
@ -326,8 +332,8 @@ SetKeyboardLayoutJob::writeDefaultKeyboardData( const QString& defaultKeyboardPa
file.close();
cDebug() << "Written XKBMODEL" << m_model << "; XKBLAYOUT" << m_layout << "; XKBVARIANT" << m_variant
<< "to /etc/default/keyboard file" << defaultKeyboardPath;
cDebug() << Logger::SubEntry << "Written XKBMODEL" << m_model << "; XKBLAYOUT" << m_layout << "; XKBVARIANT" << m_variant
<< "to /etc/default/keyboard file" << defaultKeyboardPath << stream.status();
return ( stream.status() == QTextStream::Ok );
}