Skip to content
Snippets Groups Projects
Commit c70be7ed authored by Adriaan de Groot's avatar Adriaan de Groot
Browse files

[partition] Use the doNotClose setting

parent d3db2ba7
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,23 @@ isSpecial( const QString& baseName )
return specialForFedora || specialMapperControl || specialVentoy;
}
static inline bool
matchesExceptions( const QStringList& mapperExceptions, const QString& basename )
{
for ( const auto& e : mapperExceptions )
{
if ( basename == e )
{
return true;
}
if ( e.endsWith( '*' ) && basename.startsWith( e.left( e.length() - 1 ) ) )
{
return true;
}
}
return false;
}
/** @brief Returns a list of unneeded crypto devices
*
* These are the crypto devices to unmount and close; some are "needed"
......@@ -139,7 +156,7 @@ getCryptoDevices( const QStringList& mapperExceptions )
for ( const QFileInfo& fi : fiList )
{
QString baseName = fi.baseName();
if ( isSpecial( baseName ) || mapperExceptions.contains( baseName ) )
if ( isSpecial( baseName ) || matchesExceptions( mapperExceptions, baseName ) )
{
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment