Skip to content
Snippets Groups Projects
Commit f2a087c3 authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Write timezone correctly.

parent 3a84c668
No related branches found
No related tags found
No related merge requests found
...@@ -88,16 +88,17 @@ SetTimezoneJob::exec() ...@@ -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();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment