Write timezone correctly.
This commit is contained in:
parent
3a84c66829
commit
f2a087c348
@ -88,16 +88,17 @@ SetTimezoneJob::exec()
|
||||
.arg( zoneinfoPath )
|
||||
.arg( "/etc/localtime" ) );
|
||||
|
||||
QFile timezoneFile( "/etc/timezone" );
|
||||
if ( timezoneFile.exists() )
|
||||
{
|
||||
if (!timezoneFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
|
||||
return Calamares::JobResult::error( tr( "Cannot set timezone,"),
|
||||
tr( "Cannot open /etc/timezone for writing"));
|
||||
QFile timezoneFile( gs->value( "rootMountPoint" ).toString() + "/etc/timezone" );
|
||||
|
||||
if ( !timezoneFile.open( QIODevice::WriteOnly |
|
||||
QIODevice::Text |
|
||||
QIODevice::Truncate ) )
|
||||
return Calamares::JobResult::error( tr( "Cannot set timezone,"),
|
||||
tr( "Cannot open /etc/timezone for writing"));
|
||||
|
||||
QTextStream out(&timezoneFile);
|
||||
out << m_region << '/' << m_zone << "\n";
|
||||
timezoneFile.close();
|
||||
|
||||
QTextStream out(&timezoneFile);
|
||||
out << m_region << '/' << m_zone << "\n";
|
||||
timezoneFile.close();
|
||||
}
|
||||
return Calamares::JobResult::ok();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user