Style fixes
Run calamaresstyle over new classes
This commit is contained in:
parent
4a4dc74f5c
commit
a0a3b4dc49
@ -25,15 +25,15 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
SetHostNameJob::SetHostNameJob(const QString& hostname)
|
SetHostNameJob::SetHostNameJob( const QString& hostname )
|
||||||
: Calamares::Job()
|
: Calamares::Job()
|
||||||
, m_hostname(hostname)
|
, m_hostname( hostname )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SetHostNameJob::prettyName() const
|
QString SetHostNameJob::prettyName() const
|
||||||
{
|
{
|
||||||
return tr( "Set hostname %1" ).arg( m_hostname );
|
return tr( "Set hostname %1" ).arg( m_hostname );
|
||||||
}
|
}
|
||||||
|
|
||||||
Calamares::JobResult SetHostNameJob::exec()
|
Calamares::JobResult SetHostNameJob::exec()
|
||||||
@ -53,14 +53,14 @@ Calamares::JobResult SetHostNameJob::exec()
|
|||||||
return Calamares::JobResult::error( tr( "Internal Error" ) );
|
return Calamares::JobResult::error( tr( "Internal Error" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile hostfile(destDir + "/etc/hostname");
|
QFile hostfile( destDir + "/etc/hostname" );
|
||||||
if (!hostfile.open(QFile::WriteOnly))
|
if ( !hostfile.open( QFile::WriteOnly ) )
|
||||||
{
|
{
|
||||||
cLog() << "Can't write to hostname file";
|
cLog() << "Can't write to hostname file";
|
||||||
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream out(&hostfile);
|
QTextStream out( &hostfile );
|
||||||
out << m_hostname << "\n";
|
out << m_hostname << "\n";
|
||||||
hostfile.close();
|
hostfile.close();
|
||||||
|
|
||||||
|
@ -23,13 +23,13 @@
|
|||||||
|
|
||||||
class SetHostNameJob : public Calamares::Job
|
class SetHostNameJob : public Calamares::Job
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
SetHostNameJob(const QString &hostname);
|
SetHostNameJob( const QString& hostname );
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
Calamares::JobResult exec() override;
|
Calamares::JobResult exec() override;
|
||||||
private:
|
private:
|
||||||
const QString m_hostname;
|
const QString m_hostname;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user