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