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

main
Adriaan de Groot 4 years ago
parent cbc376a206
commit 705e6dd8d6

@ -310,8 +310,14 @@ SetKeyboardLayoutJob::writeX11Data( const QString& keyboardConfPath ) const
bool bool
SetKeyboardLayoutJob::writeDefaultKeyboardData( const QString& defaultKeyboardPath ) const SetKeyboardLayoutJob::writeDefaultKeyboardData( const QString& defaultKeyboardPath ) const
{ {
cDebug() << "Writing default keyboard data to" << defaultKeyboardPath;
QFile file( 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 ); QTextStream stream( &file );
stream << "# KEYBOARD CONFIGURATION FILE\n\n" stream << "# KEYBOARD CONFIGURATION FILE\n\n"
@ -326,8 +332,8 @@ SetKeyboardLayoutJob::writeDefaultKeyboardData( const QString& defaultKeyboardPa
file.close(); file.close();
cDebug() << "Written XKBMODEL" << m_model << "; XKBLAYOUT" << m_layout << "; XKBVARIANT" << m_variant cDebug() << Logger::SubEntry << "Written XKBMODEL" << m_model << "; XKBLAYOUT" << m_layout << "; XKBVARIANT" << m_variant
<< "to /etc/default/keyboard file" << defaultKeyboardPath; << "to /etc/default/keyboard file" << defaultKeyboardPath << stream.status();
return ( stream.status() == QTextStream::Ok ); return ( stream.status() == QTextStream::Ok );
} }

Loading…
Cancel
Save