[welcome] Chase renaming of files

- Rename the classes to match
 - Drop some unused includes
main
Adriaan de Groot 6 years ago
parent c1cd88d5fa
commit a19d81e38c

@ -18,7 +18,7 @@ set( CHECKER_SOURCES
checker/CheckerContainer.cpp
checker/CheckerWidget.cpp
checker/CheckItemWidget.cpp
checker/RequirementsChecker.cpp
checker/GeneralRequirements.cpp
${PARTMAN_SRC}
)

@ -23,7 +23,6 @@
#include "ui_WelcomePage.h"
#include "CalamaresVersion.h"
#include "checker/CheckerContainer.h"
#include "checker/RequirementsChecker.h"
#include "utils/Logger.h"
#include "utils/CalamaresUtilsGui.h"
#include "utils/Retranslator.h"

@ -20,7 +20,7 @@
#include "WelcomeViewStep.h"
#include "WelcomePage.h"
#include "checker/RequirementsChecker.h"
#include "checker/GeneralRequirements.h"
#include "utils/Logger.h"
@ -30,7 +30,7 @@ CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeViewStepFactory, registerPlugin<Welc
WelcomeViewStep::WelcomeViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_requirementsChecker( new RequirementsChecker( this ) )
, m_requirementsChecker( new GeneralRequirements( this ) )
{
emit nextStatusChanged( true );
m_widget = new WelcomePage();

@ -30,7 +30,7 @@
#include <QVariantMap>
class WelcomePage;
class RequirementsChecker;
class GeneralRequirements;
class PLUGINDLLEXPORT WelcomeViewStep : public Calamares::ViewStep
{
@ -61,7 +61,7 @@ public:
private:
WelcomePage* m_widget;
RequirementsChecker* m_requirementsChecker;
GeneralRequirements* m_requirementsChecker;
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeViewStepFactory )

@ -20,7 +20,6 @@
#define CHECKERWIDGET_H
#include "modulesystem/Requirement.h"
#include "RequirementsChecker.h"
#include <QBoxLayout>
#include <QWidget>

@ -18,7 +18,7 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "RequirementsChecker.h"
#include "GeneralRequirements.h"
#include "CheckerContainer.h"
#include "partman_devices.h"
@ -53,14 +53,14 @@
#include <unistd.h> //geteuid
RequirementsChecker::RequirementsChecker( QObject* parent )
GeneralRequirements::GeneralRequirements( QObject* parent )
: QObject( parent )
, m_requiredStorageGB( -1 )
, m_requiredRamGB( -1 )
{
}
Calamares::RequirementsList RequirementsChecker::checkRequirements()
Calamares::RequirementsList GeneralRequirements::checkRequirements()
{
QSize availableSize = qApp->desktop()->availableGeometry().size();
@ -91,7 +91,7 @@ Calamares::RequirementsList RequirementsChecker::checkRequirements()
isRoot = checkIsRoot();
using TR = Logger::DebugRow<const char *, bool>;
cDebug() << "RequirementsChecker output:"
cDebug() << "GeneralRequirements output:"
<< TR("enoughStorage", enoughStorage)
<< TR("enoughRam", enoughRam)
<< TR("hasPower", hasPower)
@ -159,7 +159,7 @@ Calamares::RequirementsList RequirementsChecker::checkRequirements()
void
RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
GeneralRequirements::setConfigurationMap( const QVariantMap& configurationMap )
{
bool incompleteConfiguration = false;
@ -171,7 +171,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
}
else
{
cWarning() << "RequirementsChecker entry 'check' is incomplete.";
cWarning() << "GeneralRequirements entry 'check' is incomplete.";
incompleteConfiguration = true;
}
@ -183,14 +183,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
}
else
{
cWarning() << "RequirementsChecker entry 'required' is incomplete.";
cWarning() << "GeneralRequirements entry 'required' is incomplete.";
incompleteConfiguration = true;
}
// Help out with consistency, but don't fix
for ( const auto& r : m_entriesToRequire )
if ( !m_entriesToCheck.contains( r ) )
cWarning() << "RequirementsChecker requires" << r << "but does not check it.";
cWarning() << "GeneralRequirements requires" << r << "but does not check it.";
if ( configurationMap.contains( "requiredStorage" ) &&
( configurationMap.value( "requiredStorage" ).type() == QVariant::Double ||
@ -200,7 +200,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
m_requiredStorageGB = configurationMap.value( "requiredStorage" ).toDouble( &ok );
if ( !ok )
{
cWarning() << "RequirementsChecker entry 'requiredStorage' is invalid.";
cWarning() << "GeneralRequirements entry 'requiredStorage' is invalid.";
m_requiredStorageGB = 3.;
}
@ -208,7 +208,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
}
else
{
cWarning() << "RequirementsChecker entry 'requiredStorage' is missing.";
cWarning() << "GeneralRequirements entry 'requiredStorage' is missing.";
m_requiredStorageGB = 3.;
incompleteConfiguration = true;
}
@ -221,14 +221,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok );
if ( !ok )
{
cWarning() << "RequirementsChecker entry 'requiredRam' is invalid.";
cWarning() << "GeneralRequirements entry 'requiredRam' is invalid.";
m_requiredRamGB = 1.;
incompleteConfiguration = true;
}
}
else
{
cWarning() << "RequirementsChecker entry 'requiredRam' is missing.";
cWarning() << "GeneralRequirements entry 'requiredRam' is missing.";
m_requiredRamGB = 1.;
incompleteConfiguration = true;
}
@ -240,7 +240,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
if ( m_checkHasInternetUrl.isEmpty() ||
!QUrl( m_checkHasInternetUrl ).isValid() )
{
cWarning() << "RequirementsChecker entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl
cWarning() << "GeneralRequirements entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl
<< "reverting to default (http://example.com).";
m_checkHasInternetUrl = "http://example.com";
incompleteConfiguration = true;
@ -248,7 +248,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
}
else
{
cWarning() << "RequirementsChecker entry 'internetCheckUrl' is undefined in welcome.conf,"
cWarning() << "GeneralRequirements entry 'internetCheckUrl' is undefined in welcome.conf,"
"reverting to default (http://example.com).";
m_checkHasInternetUrl = "http://example.com";
@ -257,17 +257,17 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
if ( incompleteConfiguration )
{
cWarning() << "RequirementsChecker configuration map:" << Logger::DebugMap( configurationMap );
cWarning() << "GeneralRequirements configuration map:" << Logger::DebugMap( configurationMap );
}
}
bool
RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
GeneralRequirements::checkEnoughStorage( qint64 requiredSpace )
{
#ifdef WITHOUT_LIBPARTED
Q_UNUSED( requiredSpace );
cWarning() << "RequirementsChecker is configured without libparted.";
cWarning() << "GeneralRequirements is configured without libparted.";
return false;
#else
return check_big_enough( requiredSpace );
@ -276,7 +276,7 @@ RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
bool
RequirementsChecker::checkEnoughRam( qint64 requiredRam )
GeneralRequirements::checkEnoughRam( qint64 requiredRam )
{
// Ignore the guesstimate-factor; we get an under-estimate
// which is probably the usable RAM for programs.
@ -286,7 +286,7 @@ RequirementsChecker::checkEnoughRam( qint64 requiredRam )
bool
RequirementsChecker::checkBatteryExists()
GeneralRequirements::checkBatteryExists()
{
const QFileInfo basePath( "/sys/class/power_supply" );
@ -312,7 +312,7 @@ RequirementsChecker::checkBatteryExists()
bool
RequirementsChecker::checkHasPower()
GeneralRequirements::checkHasPower()
{
const QString UPOWER_SVC_NAME( "org.freedesktop.UPower" );
const QString UPOWER_INTF_NAME( "org.freedesktop.UPower" );
@ -343,7 +343,7 @@ RequirementsChecker::checkHasPower()
bool
RequirementsChecker::checkHasInternet()
GeneralRequirements::checkHasInternet()
{
// default to true in the QNetworkAccessManager::UnknownAccessibility case
QNetworkAccessManager qnam( this );
@ -367,14 +367,14 @@ RequirementsChecker::checkHasInternet()
bool
RequirementsChecker::checkIsRoot()
GeneralRequirements::checkIsRoot()
{
return !geteuid();
}
void
RequirementsChecker::detectFirmwareType()
GeneralRequirements::detectFirmwareType()
{
QString fwType = QFile::exists( "/sys/firmware/efi/efivars" ) ? "efi" : "bios";
Calamares::JobQueue::instance()->globalStorage()->insert( "firmwareType", fwType );

@ -17,19 +17,19 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef REQUIREMENTSCHECKER_H
#define REQUIREMENTSCHECKER_H
#ifndef GENERALREQUIREMENTS_H
#define GENERALREQUIREMENTS_H
#include <QObject>
#include <QStringList>
#include "modulesystem/Requirement.h"
class RequirementsChecker : public QObject
class GeneralRequirements : public QObject
{
Q_OBJECT
public:
explicit RequirementsChecker( QObject* parent = nullptr );
explicit GeneralRequirements( QObject* parent = nullptr );
void setConfigurationMap( const QVariantMap& configurationMap );

Loading…
Cancel
Save