[preservefiles] Accessor for item-type (needed for tests)

This commit is contained in:
Adriaan de Groot 2021-12-13 15:44:07 +01:00
parent 8b5e49d980
commit a1b7ba0dc5
2 changed files with 6 additions and 5 deletions

View File

@ -124,7 +124,7 @@ Item::exec( const std::function< QString( QString ) >& replacements ) const
QString full_dest = CalamaresUtils::System::instance()->targetPath( expanded_dest );
bool success = false;
switch ( type )
switch ( m_type )
{
case ItemType::None:
cWarning() << "Invalid item for preservefiles skipped.";

View File

@ -35,23 +35,24 @@ class Item
QString source;
QString dest;
CalamaresUtils::Permissions perm;
ItemType type;
ItemType m_type;
public:
Item( const QString& src, const QString& d, CalamaresUtils::Permissions p, ItemType t )
: source( src )
, dest( d )
, perm( std::move( p ) )
, type( t )
, m_type( t )
{
}
Item()
: type( ItemType::None )
: m_type( ItemType::None )
{
}
operator bool() const { return type != ItemType::None; }
operator bool() const { return m_type != ItemType::None; }
ItemType type() const { return m_type; }
bool exec( const std::function< QString( QString ) >& replacements ) const;