Style fixes
Run calamaresstyle over new classes
This commit is contained in:
parent
4a4dc74f5c
commit
a0a3b4dc49
@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2014 Rohan Garg <rohan@kde.org>
|
* Copyright (C) 2014 Rohan Garg <rohan@kde.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "SetHostNameJob.h"
|
#include "SetHostNameJob.h"
|
||||||
@ -25,21 +25,21 @@
|
|||||||
#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()
|
||||||
{
|
{
|
||||||
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
|
||||||
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
||||||
{
|
{
|
||||||
cLog() << "No rootMountPoint in global storage";
|
cLog() << "No rootMountPoint in global storage";
|
||||||
@ -53,16 +53,16 @@ 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();
|
||||||
|
|
||||||
return Calamares::JobResult::ok();
|
return Calamares::JobResult::ok();
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2014 Rohan Garg <rohan@kde.org>
|
* Copyright (C) 2014 Rohan Garg <rohan@kde.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SETHOSTNAMEJOB_CPP_H
|
#ifndef SETHOSTNAMEJOB_CPP_H
|
||||||
@ -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