Style fixes

Run calamaresstyle over new classes
This commit is contained in:
Rohan Garg 2014-10-27 16:53:57 +01:00
parent 4a4dc74f5c
commit a0a3b4dc49
2 changed files with 19 additions and 19 deletions

View File

@ -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();

View File

@ -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;
}; };