mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 18:35:37 -04:00
[keyboard] Check for successful file-write
This commit is contained in:
parent
2535d8ccbd
commit
3e51d77782
1 changed files with 10 additions and 2 deletions
|
@ -210,7 +210,11 @@ SetKeyboardLayoutJob::writeVConsoleData( const QString& vconsoleConfPath, const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write out the existing lines and replace the KEYMAP= line
|
// Write out the existing lines and replace the KEYMAP= line
|
||||||
file.open( QIODevice::WriteOnly | QIODevice::Text );
|
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||||
|
{
|
||||||
|
cError() << "Could not open" << file.fileName() << "for writing.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach ( const QString& existingLine, existingLines )
|
foreach ( const QString& existingLine, existingLines )
|
||||||
|
@ -243,7 +247,11 @@ bool
|
||||||
SetKeyboardLayoutJob::writeX11Data( const QString& keyboardConfPath ) const
|
SetKeyboardLayoutJob::writeX11Data( const QString& keyboardConfPath ) const
|
||||||
{
|
{
|
||||||
QFile file( keyboardConfPath );
|
QFile file( keyboardConfPath );
|
||||||
file.open( QIODevice::WriteOnly | QIODevice::Text );
|
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||||
|
{
|
||||||
|
cError() << "Could not open" << file.fileName() << "for writing.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
|
|
||||||
stream << "# Read and parsed by systemd-localed. It's probably wise not to edit this file\n"
|
stream << "# Read and parsed by systemd-localed. It's probably wise not to edit this file\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue