[tracking] Use enum-conveniences
This commit is contained in:
parent
ab6c6a6748
commit
6d744374db
@ -19,11 +19,17 @@
|
||||
#ifndef TRACKINGTYPE_H
|
||||
#define TRACKINGTYPE_H
|
||||
|
||||
#include "utils/NamedEnum.h"
|
||||
|
||||
enum class TrackingType
|
||||
{
|
||||
InstallTracking,
|
||||
MachineTracking,
|
||||
UserTracking
|
||||
NoTracking, // Do not enable tracking at all
|
||||
InstallTracking, // Track that *this* install has happened
|
||||
MachineTracking, // Track the machine, ongoing
|
||||
UserTracking // Track the user, ongoing
|
||||
};
|
||||
|
||||
// Implemented in TrackingViewStep.cpp
|
||||
const NamedEnumTable< TrackingType >& trackingNames();
|
||||
|
||||
#endif //TRACKINGTYPE_H
|
||||
|
@ -189,3 +189,20 @@ TrackingViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
m_widget->setGeneralPolicy( CalamaresUtils::getString( configurationMap, "policy" ) );
|
||||
m_widget->setTrackingLevel( CalamaresUtils::getString( configurationMap, "default" ) );
|
||||
}
|
||||
|
||||
const NamedEnumTable< TrackingType >&
|
||||
trackingNames()
|
||||
{
|
||||
// *INDENT-OFF*
|
||||
// clang-format off
|
||||
static const NamedEnumTable< TrackingType > names {
|
||||
{ QStringLiteral( "none" ), TrackingType::NoTracking },
|
||||
{ QStringLiteral( "install" ), TrackingType::InstallTracking },
|
||||
{ QStringLiteral( "machine" ), TrackingType::MachineTracking },
|
||||
{ QStringLiteral( "user" ), TrackingType::UserTracking }
|
||||
};
|
||||
// clang-format on
|
||||
// *INDENT-ON*
|
||||
|
||||
return names;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user