libcalamares: use namespace Calamares::Partition consistently

This commit is contained in:
Adriaan de Groot 2023-09-11 00:09:31 +02:00
parent 641e186b7c
commit f4e3964ee5
60 changed files with 135 additions and 134 deletions

View File

@ -79,7 +79,7 @@ mount( const std::string& device_path,
const std::string& filesystem_name,
const std::string& options )
{
return CalamaresUtils::Partition::mount( QString::fromStdString( device_path ),
return Calamares::Partition::mount( QString::fromStdString( device_path ),
QString::fromStdString( mount_point ),
QString::fromStdString( filesystem_name ),
QString::fromStdString( options ) );

View File

@ -15,7 +15,7 @@
#include <optional>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -168,4 +168,4 @@ automountRestore( const std::shared_ptr< AutoMountInfo >& info )
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -15,7 +15,7 @@
#include <memory>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -46,6 +46,6 @@ DLLEXPORT std::shared_ptr< AutoMountInfo > automountDisable( bool disable = true
DLLEXPORT void automountRestore( const std::shared_ptr< AutoMountInfo >& t );
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif

View File

@ -14,7 +14,7 @@
#include <QObject>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -92,4 +92,4 @@ untranslatedFS( FileSystem::Type t )
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -23,7 +23,7 @@
#include <kpmcore/fs/filesystem.h>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -95,6 +95,6 @@ isFilesystemUsedGS( FileSystem::Type filesystem )
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif // PARTITION_PARTITIONQUERY_H

View File

@ -17,7 +17,7 @@
static const QString fsUse_key = QStringLiteral( "filesystem_use" );
bool
CalamaresUtils::Partition::isFilesystemUsedGS( const Calamares::GlobalStorage* gs, const QString& filesystemType )
Calamares::Partition::isFilesystemUsedGS( const Calamares::GlobalStorage* gs, const QString& filesystemType )
{
if ( !gs )
{
@ -34,7 +34,7 @@ CalamaresUtils::Partition::isFilesystemUsedGS( const Calamares::GlobalStorage* g
}
void
CalamaresUtils::Partition::useFilesystemGS( Calamares::GlobalStorage* gs, const QString& filesystemType, bool used )
Calamares::Partition::useFilesystemGS( Calamares::GlobalStorage* gs, const QString& filesystemType, bool used )
{
if ( gs )
{
@ -46,7 +46,7 @@ CalamaresUtils::Partition::useFilesystemGS( Calamares::GlobalStorage* gs, const
}
void
CalamaresUtils::Partition::clearFilesystemGS( Calamares::GlobalStorage* gs )
Calamares::Partition::clearFilesystemGS( Calamares::GlobalStorage* gs )
{
if ( gs )
{

View File

@ -19,7 +19,7 @@
#include "DllMacro.h"
#include "JobQueue.h"
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -73,6 +73,6 @@ isFilesystemUsedGS( const QString& filesystemType )
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif

View File

@ -19,7 +19,7 @@
#include <QObject>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -97,4 +97,4 @@ KPMManager::backend() const
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -20,7 +20,7 @@
class CoreBackend;
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -56,6 +56,6 @@ private:
};
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif // PARTITION_KPMMANAGER_H

View File

@ -89,7 +89,7 @@ KPMTests::testFSNames()
calaFSNames.reserve( fstypes.count() );
for ( const auto t : fstypes )
{
QString s = CalamaresUtils::Partition::untranslatedFS( t );
QString s = Calamares::Partition::untranslatedFS( t );
calaFSNames.append( s );
}

View File

@ -19,7 +19,7 @@
#include <QDir>
#include <QTemporaryDir>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -38,7 +38,7 @@ mount( const QString& devicePath, const QString& mountPoint, const QString& file
cWarning() << "Can't mount on an empty mountpoint.";
}
return static_cast< int >( ProcessResult::Code::NoWorkingDirectory );
return static_cast< int >( CalamaresUtils::ProcessResult::Code::NoWorkingDirectory );
}
QDir mountPointDir( mountPoint );
@ -48,7 +48,7 @@ mount( const QString& devicePath, const QString& mountPoint, const QString& file
if ( !ok )
{
cWarning() << "Could not create mountpoint" << mountPoint;
return static_cast< int >( ProcessResult::Code::NoWorkingDirectory );
return static_cast< int >( CalamaresUtils::ProcessResult::Code::NoWorkingDirectory );
}
}
@ -158,4 +158,4 @@ MtabInfo::fromMtabFilteredByPrefix( const QString& mountPrefix, const QString& m
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -20,7 +20,7 @@
#include <memory>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -107,6 +107,6 @@ struct DLLEXPORT MtabInfo
};
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif

View File

@ -17,7 +17,7 @@
#include <kpmcore/core/partition.h>
#include <kpmcore/core/partitiontable.h>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -136,4 +136,4 @@ PartitionIterator::end( PartitionTable* table )
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -23,7 +23,7 @@ class Device;
class Partition;
class PartitionTable;
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -62,6 +62,6 @@ private:
};
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif // PARTITION_PARTITIONITERATOR_H

View File

@ -18,7 +18,7 @@
#include <kpmcore/core/partition.h>
#include <kpmcore/core/partitiontable.h>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -108,4 +108,4 @@ findPartitions( const QList< Device* >& devices, std::function< bool( Partition*
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -26,7 +26,7 @@ class Device;
class Partition;
class PartitionTable;
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -70,6 +70,6 @@ Partition* findPartitionByPath( const QList< Device* >& devices, const QString&
QList< Partition* > findPartitions( const QList< Device* >& devices,
std::function< bool( Partition* ) > criterionFunction );
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif // PARTITION_PARTITIONQUERY_H

View File

@ -14,7 +14,7 @@
#include "utils/Logger.h"
#include "utils/Units.h"
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -289,4 +289,4 @@ PartitionSize::operator==( const PartitionSize& other ) const
}
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares

View File

@ -18,7 +18,7 @@
// Qt
#include <QString>
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -114,6 +114,6 @@ public:
};
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif // PARTITION_PARTITIONSIZE_H

View File

@ -14,7 +14,7 @@
#include "utils/Logger.h"
void
CalamaresUtils::Partition::sync()
Calamares::Partition::sync()
{
/* I would normally use full paths here, e.g. /sbin/udevadm and /bin/sync,
* but there's enough variation / opinion on where these executables

View File

@ -13,7 +13,7 @@
#include "DllMacro.h"
namespace CalamaresUtils
namespace Calamares
{
namespace Partition
{
@ -35,6 +35,6 @@ struct DLLEXPORT Syncer
};
} // namespace Partition
} // namespace CalamaresUtils
} // namespace Calamares
#endif

View File

@ -17,8 +17,8 @@
#include <QObject>
#include <QtTest/QtTest>
using SizeUnit = CalamaresUtils::Partition::SizeUnit;
using PartitionSize = CalamaresUtils::Partition::PartitionSize;
using SizeUnit = Calamares::Partition::SizeUnit;
using PartitionSize = Calamares::Partition::PartitionSize;
Q_DECLARE_METATYPE( SizeUnit )
@ -161,8 +161,8 @@ PartitionServiceTests::testUnitNormalisation()
void
PartitionServiceTests::testFilesystemGS()
{
using CalamaresUtils::Partition::isFilesystemUsedGS;
using CalamaresUtils::Partition::useFilesystemGS;
using Calamares::Partition::isFilesystemUsedGS;
using Calamares::Partition::useFilesystemGS;
// Some filesystems names, they don't have to be real
const QStringList fsNames { "ext4", "zfs", "berries", "carrot" };
@ -212,7 +212,7 @@ PartitionServiceTests::testFilesystemGS()
useFilesystemGS( &gs, "ext4", true );
QVERIFY( isFilesystemUsedGS( &gs, "EXT4" ) );
CalamaresUtils::Partition::clearFilesystemGS( &gs );
Calamares::Partition::clearFilesystemGS( &gs );
QVERIFY( !isFilesystemUsedGS( &gs, "ZFS" ) );
QVERIFY( !isFilesystemUsedGS( &gs, "EXT4" ) );
QVERIFY( !isFilesystemUsedGS( &gs, "ext4" ) );

View File

@ -46,7 +46,7 @@ main( int argc, char** argv )
Logger::setupLogfile();
Logger::setupLogLevel( Logger::LOGDEBUG );
CalamaresUtils::Partition::automountDisable( argv[ 1 ][ 1 ] == 'd' );
Calamares::Partition::automountDisable( argv[ 1 ][ 1 ] == 'd' );
return 0;
}

View File

@ -27,7 +27,7 @@
#include <kpmcore/ops/resizeoperation.h>
#include <kpmcore/util/report.h>
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::PartitionIterator;
ResizeFSJob::ResizeFSJob( QObject* parent )
: Calamares::CppJob( parent )

View File

@ -25,7 +25,7 @@ class CoreBackend; // From KPMCore
class Device; // From KPMCore
class Partition;
using PartitionSize = CalamaresUtils::Partition::PartitionSize;
using PartitionSize = Calamares::Partition::PartitionSize;
class PLUGINDLLEXPORT ResizeFSJob : public Calamares::CppJob
{
@ -51,7 +51,7 @@ public:
PartitionSize minimumSize() const { return m_atleast; }
private:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
PartitionSize m_size;
PartitionSize m_atleast;
QString m_fsname; // Either this, or devicename, is set, not both

View File

@ -23,7 +23,7 @@
#include <QFileInfo>
#include <QStringList>
using SizeUnit = CalamaresUtils::Partition::SizeUnit;
using SizeUnit = Calamares::Partition::SizeUnit;
QTEST_GUILESS_MAIN( FSResizerTests )

View File

@ -283,7 +283,7 @@ fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configu
if ( configurationMap.contains( "efiSystemPartitionSize" ) )
{
const QString sizeString = CalamaresUtils::getString( configurationMap, "efiSystemPartitionSize" );
CalamaresUtils::Partition::PartitionSize part_size = CalamaresUtils::Partition::PartitionSize( sizeString );
Calamares::Partition::PartitionSize part_size = Calamares::Partition::PartitionSize( sizeString );
if ( part_size.isValid() )
{
// Insert once as string, once as a size-in-bytes;

View File

@ -24,9 +24,9 @@
#include <QColor>
#include <QMap>
using CalamaresUtils::Partition::isPartitionFreeSpace;
using CalamaresUtils::Partition::isPartitionNew;
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::isPartitionFreeSpace;
using Calamares::Partition::isPartitionNew;
using Calamares::Partition::PartitionIterator;
static const int NUM_PARTITION_COLORS = 5;
static const int NUM_NEW_PARTITION_COLORS = 4;

View File

@ -21,7 +21,7 @@
#include <QProcess>
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::PartitionIterator;
namespace PartUtils
{

View File

@ -27,7 +27,7 @@
#include <qregularexpression.h>
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::PartitionIterator;
namespace KPMHelpers
{

View File

@ -32,8 +32,8 @@
#include <QProcess>
#include <QTemporaryDir>
using CalamaresUtils::Partition::isPartitionFreeSpace;
using CalamaresUtils::Partition::isPartitionNew;
using Calamares::Partition::isPartitionFreeSpace;
using Calamares::Partition::isPartitionNew;
namespace PartUtils
{
@ -205,7 +205,7 @@ canBeResized( DeviceModel* dm, const QString& partitionPath, const Logger::Once&
for ( int i = 0; i < dm->rowCount(); ++i )
{
Device* dev = dm->deviceForIndex( dm->index( i ) );
Partition* candidate = CalamaresUtils::Partition::findPartitionByPath( { dev }, partitionPath );
Partition* candidate = Calamares::Partition::findPartitionByPath( { dev }, partitionPath );
if ( candidate )
{
return canBeResized( candidate, o );
@ -246,7 +246,7 @@ lookForFstabEntries( const QString& partitionPath )
FstabEntryList fstabEntries;
CalamaresUtils::Partition::TemporaryMount mount( partitionPath, QString(), mountOptions.join( ',' ) );
Calamares::Partition::TemporaryMount mount( partitionPath, QString(), mountOptions.join( ',' ) );
if ( mount.isValid() )
{
QFile fstabFile( mount.path() + "/etc/fstab" );

View File

@ -63,9 +63,9 @@
#include <QStandardItemModel>
#include <QtConcurrent/QtConcurrent>
using CalamaresUtils::Partition::isPartitionFreeSpace;
using CalamaresUtils::Partition::isPartitionNew;
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::isPartitionFreeSpace;
using Calamares::Partition::isPartitionNew;
using Calamares::Partition::PartitionIterator;
PartitionCoreModule::RefreshHelper::RefreshHelper( PartitionCoreModule* module )
: m_module( module )
@ -807,7 +807,7 @@ PartitionCoreModule::scanForEfiSystemPartitions()
}
QList< Partition* > efiSystemPartitions
= CalamaresUtils::Partition::findPartitions( devices, PartUtils::isEfiBootable );
= Calamares::Partition::findPartitions( devices, PartUtils::isEfiBootable );
if ( efiSystemPartitions.isEmpty() )
{

View File

@ -257,7 +257,7 @@ private:
DeviceInfo* infoForDevice( const Device* ) const;
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
QList< DeviceInfo* > m_deviceInfos;
QList< Partition* > m_efiSystemPartitions;

View File

@ -232,7 +232,7 @@ PartitionLayout::createPartitions( Device* dev,
// warnings to ensure that all the cases are covered below.
// We need to ignore the percent-defined until later
qint64 sectors = 0;
if ( entry.partSize.unit() != CalamaresUtils::Partition::SizeUnit::Percent )
if ( entry.partSize.unit() != Calamares::Partition::SizeUnit::Percent )
{
sectors = entry.partSize.toSectors( totalSectors, dev->logicalSize() );
}
@ -264,7 +264,7 @@ PartitionLayout::createPartitions( Device* dev,
// Assign sectors for percentage-defined partitions.
for ( const auto& entry : qAsConst( m_partLayout ) )
{
if ( entry.partSize.unit() == CalamaresUtils::Partition::SizeUnit::Percent )
if ( entry.partSize.unit() == Calamares::Partition::SizeUnit::Percent )
{
qint64 sectors
= entry.partSize.toSectors( availableSectors + partSectorsMap.value( &entry ), dev->logicalSize() );

View File

@ -38,9 +38,9 @@ public:
QString partMountPoint;
FileSystem::Type partFileSystem = FileSystem::Unknown;
QVariantMap partFeatures;
CalamaresUtils::Partition::PartitionSize partSize;
CalamaresUtils::Partition::PartitionSize partMinSize;
CalamaresUtils::Partition::PartitionSize partMaxSize;
Calamares::Partition::PartitionSize partSize;
Calamares::Partition::PartitionSize partMinSize;
Calamares::Partition::PartitionSize partMaxSize;
/// @brief All-zeroes PartitionEntry
PartitionEntry();

View File

@ -28,8 +28,8 @@
// Qt
#include <QColor>
using CalamaresUtils::Partition::isPartitionFreeSpace;
using CalamaresUtils::Partition::isPartitionNew;
using Calamares::Partition::isPartitionFreeSpace;
using Calamares::Partition::isPartitionNew;
//- ResetHelper --------------------------------------------
PartitionModel::ResetHelper::ResetHelper( PartitionModel* model )
@ -163,7 +163,7 @@ PartitionModel::data( const QModelIndex& index, int role ) const
}
if ( col == FileSystemColumn )
{
return CalamaresUtils::Partition::prettyNameForFileSystemType( partition->fileSystem().type() );
return Calamares::Partition::prettyNameForFileSystemType( partition->fileSystem().type() );
}
if ( col == FileSystemLabelColumn )
{
@ -206,7 +206,7 @@ PartitionModel::data( const QModelIndex& index, int role ) const
}
}
QString prettyFileSystem
= CalamaresUtils::Partition::prettyNameForFileSystemType( partition->fileSystem().type() );
= Calamares::Partition::prettyNameForFileSystemType( partition->fileSystem().type() );
qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize();
QString prettySize = formatByteSize( size );
return QVariant( name + " " + prettyFileSystem + " " + prettySize );

View File

@ -55,9 +55,9 @@
#include <QtConcurrent/QtConcurrent>
using Calamares::Widgets::PrettyRadioButton;
using CalamaresUtils::Partition::findPartitionByPath;
using CalamaresUtils::Partition::isPartitionFreeSpace;
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::findPartitionByPath;
using Calamares::Partition::isPartitionFreeSpace;
using Calamares::Partition::PartitionIterator;
using InstallChoice = Config::InstallChoice;
using SwapChoice = Config::SwapChoice;

View File

@ -43,8 +43,8 @@
#include <QRegularExpressionValidator>
#include <QSet>
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
using Calamares::Partition::untranslatedFS;
using Calamares::Partition::userVisibleFS;
static QSet< FileSystem::Type > s_unmountableFS( { FileSystem::Unformatted,
FileSystem::LinuxSwap,
@ -352,7 +352,7 @@ CreatePartitionDialog::checkMountPointSelection()
void
CreatePartitionDialog::initPartResizerWidget( Partition* partition )
{
QColor color = CalamaresUtils::Partition::isPartitionFreeSpace( partition )
QColor color = Calamares::Partition::isPartitionFreeSpace( partition )
? ColorUtils::colorForPartitionInFreeSpace( partition )
: ColorUtils::colorForPartition( partition );
m_partitionSizeController->init( m_device, partition, color );

View File

@ -42,8 +42,8 @@
#include <QProcess>
#include <QPushButton>
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
using Calamares::Partition::untranslatedFS;
using Calamares::Partition::userVisibleFS;
EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device,
Partition* partition,

View File

@ -134,7 +134,7 @@ PartitionPage::updateButtons()
Q_ASSERT( model );
Partition* partition = model->partitionForIndex( index );
Q_ASSERT( partition );
const bool isFree = CalamaresUtils::Partition::isPartitionFreeSpace( partition );
const bool isFree = Calamares::Partition::isPartitionFreeSpace( partition );
const bool isExtended = partition->roles().has( PartitionRole::Extended );
// An extended partition can have a "free space" child; that one does
@ -144,7 +144,7 @@ PartitionPage::updateButtons()
const bool hasChildren = isExtended
&& ( partition->children().length() > 1
|| ( partition->children().length() == 1
&& !CalamaresUtils::Partition::isPartitionFreeSpace( partition->children().at( 0 ) ) ) );
&& !Calamares::Partition::isPartitionFreeSpace( partition->children().at( 0 ) ) ) );
const bool isInVG = m_core->isInVG( partition );
@ -419,7 +419,7 @@ PartitionPage::onEditClicked()
Partition* partition = model->partitionForIndex( index );
Q_ASSERT( partition );
if ( CalamaresUtils::Partition::isPartitionNew( partition ) )
if ( Calamares::Partition::isPartitionNew( partition ) )
{
updatePartitionToCreate( model->device(), partition );
}
@ -487,7 +487,7 @@ PartitionPage::onPartitionViewActivated()
// but I don't expect there will be other occurences of triggering the same
// action from multiple UI elements in this page, so it does not feel worth
// the price.
if ( CalamaresUtils::Partition::isPartitionFreeSpace( partition ) )
if ( Calamares::Partition::isPartitionFreeSpace( partition ) )
{
m_ui->createButton->click();
}

View File

@ -27,7 +27,7 @@
#include <QPainterPath>
#include <QStyleOption>
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::PartitionIterator;
static const int VIEW_HEIGHT
= qMax( CalamaresUtils::defaultFontHeight() + 8, // wins out with big fonts
@ -103,7 +103,7 @@ PartitionSplitterWidget::init( Device* dev, bool drawNestedPartitions )
{
PartitionSplitterItem newItem = { ( *it )->partitionPath(),
ColorUtils::colorForPartition( *it ),
CalamaresUtils::Partition::isPartitionFreeSpace( *it ),
Calamares::Partition::isPartitionFreeSpace( *it ),
( *it )->capacity(),
PartitionSplitterItem::Normal,
{} };

View File

@ -28,13 +28,13 @@ AutoMountManagementJob::exec()
if ( m_stored )
{
cDebug() << "Restore automount settings";
CalamaresUtils::Partition::automountRestore( m_stored );
Calamares::Partition::automountRestore( m_stored );
m_stored.reset();
}
else
{
cDebug() << "Set automount to" << ( m_disable ? "disable" : "enable" );
m_stored = CalamaresUtils::Partition::automountDisable( m_disable );
m_stored = Calamares::Partition::automountDisable( m_disable );
}
return Calamares::JobResult::ok();
}

View File

@ -17,7 +17,7 @@
/**
* This job sets automounting to a specific value, and when run a
* second time, **re**sets to the original value. See the documentation
* for CalamaresUtils::Partition::automountDisable() for details.
* for Calamares::Partition::automountDisable() for details.
* Use @c true to **disable** automounting.
*
* Effectively: queue the **same** job twice; the first time it runs
@ -36,7 +36,7 @@ public:
private:
bool m_disable;
decltype( CalamaresUtils::Partition::automountDisable( true ) ) m_stored;
decltype( Calamares::Partition::automountDisable( true ) ) m_stored;
};
#endif /* PARTITION_AUTOMOUNTMANAGEMENTJOB_H */

View File

@ -28,7 +28,7 @@
#include <QProcess>
#include <QStringList>
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::PartitionIterator;
/** @brief Returns list of partitions on a given @p deviceName
@ -381,7 +381,7 @@ Calamares::JobResult
ClearMountsJob::exec()
{
const QString deviceName = m_deviceNode.split( '/' ).last();
CalamaresUtils::Partition::Syncer s;
Calamares::Partition::Syncer s;
QList< MessageAndPath > goodNews;
apply( getCryptoDevices( m_mapperExceptions ), tryCryptoClose, goodNews );

View File

@ -46,7 +46,7 @@ ClearTempMountsJob::exec()
{
Logger::Once o;
// Fetch a list of current mounts to Calamares temporary directories.
using MtabInfo = CalamaresUtils::Partition::MtabInfo;
using MtabInfo = Calamares::Partition::MtabInfo;
auto targetMounts = MtabInfo::fromMtabFilteredByPrefix( QStringLiteral( "/tmp/calamares-" ) );
if ( targetMounts.isEmpty() )
@ -59,7 +59,7 @@ ClearTempMountsJob::exec()
for ( const auto& m : qAsConst( targetMounts ) )
{
cDebug() << o << "Will try to umount path" << m.mountPoint;
if ( CalamaresUtils::Partition::unmount( m.mountPoint, { "-lv" } ) == 0 )
if ( Calamares::Partition::unmount( m.mountPoint, { "-lv" } ) == 0 )
{
// Returns the program's exit code, so 0 is success
goodNews.append( QString( "Successfully unmounted %1." ).arg( m.mountPoint ) );

View File

@ -31,8 +31,8 @@
#include <qcoreapplication.h>
#include <qregularexpression.h>
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
using Calamares::Partition::untranslatedFS;
using Calamares::Partition::userVisibleFS;
/** @brief Create
*
@ -174,7 +174,7 @@ prettyGptEntries( const Partition* partition )
QString
CreatePartitionJob::prettyName() const
{
const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( m_partition );
const PartitionTable* table = Calamares::Partition::getPartitionTable( m_partition );
if ( table && table->type() == PartitionTable::TableType::gpt )
{
QString entries = prettyGptEntries( m_partition );
@ -206,7 +206,7 @@ CreatePartitionJob::prettyName() const
QString
CreatePartitionJob::prettyDescription() const
{
const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( m_partition );
const PartitionTable* table = Calamares::Partition::getPartitionTable( m_partition );
if ( table && table->type() == PartitionTable::TableType::gpt )
{
QString entries = prettyGptEntries( m_partition );
@ -240,7 +240,7 @@ CreatePartitionJob::prettyDescription() const
QString
CreatePartitionJob::prettyStatusMessage() const
{
const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( m_partition );
const PartitionTable* table = Calamares::Partition::getPartitionTable( m_partition );
if ( table && table->type() == PartitionTable::TableType::gpt )
{
QString type = prettyGptType( m_partition );

View File

@ -27,7 +27,7 @@
// Qt
#include <QProcess>
using CalamaresUtils::Partition::PartitionIterator;
using Calamares::Partition::PartitionIterator;
CreatePartitionTableJob::CreatePartitionTableJob( Device* device, PartitionTable::TableType type )
: m_device( device )

View File

@ -39,7 +39,7 @@ public:
Device* device() const { return m_device; }
private:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
Device* m_device;
PartitionTable::TableType m_type;
PartitionTable* createTable();

View File

@ -33,7 +33,7 @@ public:
void undoPreview();
private:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
QString m_vgName;
QVector< const Partition* > m_pvList;
qint32 m_peSize;

View File

@ -27,7 +27,7 @@ public:
Calamares::JobResult exec() override;
private:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
LvmDevice* m_device;
};

View File

@ -34,9 +34,9 @@
#include <QFileInfo>
#include <QProcess>
using CalamaresUtils::Partition::PartitionIterator;
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
using Calamares::Partition::PartitionIterator;
using Calamares::Partition::untranslatedFS;
using Calamares::Partition::userVisibleFS;
typedef QHash< QString, QString > UuidForPartitionHash;
@ -306,14 +306,14 @@ FillGlobalStorageJob::prettyStatusMessage() const
* .. mark as "2" if it's one of the claimed / in-use FSses
*
* Stores a GS key called "filesystem_use" with this mapping.
* @see CalamaresUtils::Partition::useFilesystemGS()
* @see Calamares::Partition::useFilesystemGS()
*/
static void
storeFSUse( Calamares::GlobalStorage* storage, const QVariantList& partitions )
{
if ( storage )
{
CalamaresUtils::Partition::clearFilesystemGS( storage );
Calamares::Partition::clearFilesystemGS( storage );
for ( const auto& p : partitions )
{
const auto pmap = p.toMap();
@ -325,7 +325,7 @@ storeFSUse( Calamares::GlobalStorage* storage, const QVariantList& partitions )
continue;
}
CalamaresUtils::Partition::useFilesystemGS( storage, fs, true );
Calamares::Partition::useFilesystemGS( storage, fs, true );
}
}
}

View File

@ -24,8 +24,8 @@
#include <kpmcore/ops/createfilesystemoperation.h>
#include <kpmcore/util/report.h>
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
using Calamares::Partition::untranslatedFS;
using Calamares::Partition::userVisibleFS;
FormatPartitionJob::FormatPartitionJob( Device* device, Partition* partition )
: PartitionJob( partition )

View File

@ -36,7 +36,7 @@ public slots:
void iprogress( int percent );
protected:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
Partition* m_partition;
};

View File

@ -28,7 +28,7 @@ public:
Calamares::JobResult exec() override;
private:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
LvmDevice* m_device;
};

View File

@ -35,7 +35,7 @@ private:
QString targetPartitions() const;
private:
CalamaresUtils::Partition::KPMManager m_kpmcore;
Calamares::Partition::KPMManager m_kpmcore;
LvmDevice* m_device;
QVector< const Partition* > m_partitionList;
};

View File

@ -26,8 +26,8 @@
#include <kpmcore/util/report.h>
using CalamaresUtils::BytesToMiB;
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
using Calamares::Partition::untranslatedFS;
using Calamares::Partition::userVisibleFS;
SetPartFlagsJob::SetPartFlagsJob( Device* device, Partition* partition, PartitionTable::Flags flags )
: PartitionJob( partition )

View File

@ -41,7 +41,7 @@ AutoMountJobTests::testRunThrice()
{
Logger::setupLogLevel( Logger::LOGVERBOSE );
auto original = CalamaresUtils::Partition::automountDisable( true );
auto original = Calamares::Partition::automountDisable( true );
cDebug() << "Got automount info" << Logger::Pointer( original );
AutoMountManagementJob j( false );
@ -49,7 +49,7 @@ AutoMountJobTests::testRunThrice()
QVERIFY( j.exec() );
QVERIFY( j.exec() );
CalamaresUtils::Partition::automountRestore( original );
Calamares::Partition::automountRestore( original );
}
void

View File

@ -26,7 +26,7 @@ class SmartStatus;
QTEST_GUILESS_MAIN( CreateLayoutsTests )
static CalamaresUtils::Partition::KPMManager* kpmcore = nullptr;
static Calamares::Partition::KPMManager* kpmcore = nullptr;
static Calamares::JobQueue* jobqueue = nullptr;
#define LOGICAL_SIZE 512
@ -40,7 +40,7 @@ void
CreateLayoutsTests::init()
{
jobqueue = new Calamares::JobQueue( nullptr );
kpmcore = new CalamaresUtils::Partition::KPMManager();
kpmcore = new Calamares::Partition::KPMManager();
}
void

View File

@ -34,12 +34,12 @@ private Q_SLOTS:
void testPartUtilScanDevices();
private:
std::unique_ptr< CalamaresUtils::Partition::KPMManager > m_d;
std::unique_ptr< Calamares::Partition::KPMManager > m_d;
bool m_isRoot = false;
};
DevicesTests::DevicesTests()
: m_d( std::make_unique< CalamaresUtils::Partition::KPMManager >() )
: m_d( std::make_unique< Calamares::Partition::KPMManager >() )
, m_isRoot( geteuid() == 0 )
{
}

View File

@ -27,7 +27,8 @@
QTEST_GUILESS_MAIN( PartitionJobTests )
using namespace Calamares;
using Calamares::job_ptr;
using Calamares::JobList;
using namespace CalamaresUtils::Units;
class PartitionMounter
@ -99,11 +100,11 @@ writeFile( const QString& path, const QByteArray data )
}
}
static Partition*
static ::Partition*
firstFreePartition( PartitionNode* parent )
{
for ( auto child : parent->children() )
if ( CalamaresUtils::Partition::isPartitionFreeSpace( child ) )
if ( Calamares::Partition::isPartitionFreeSpace( child ) )
{
return child;
}
@ -111,13 +112,13 @@ firstFreePartition( PartitionNode* parent )
}
//- QueueRunner ---------------------------------------------------------------
QueueRunner::QueueRunner( JobQueue* queue )
QueueRunner::QueueRunner( Calamares::JobQueue* queue )
: m_queue( queue )
, m_finished( false ) // Same initalizations as in ::run()
, m_success( true )
{
connect( m_queue, &JobQueue::finished, this, &QueueRunner::onFinished );
connect( m_queue, &JobQueue::failed, this, &QueueRunner::onFailed );
connect( m_queue, &Calamares::JobQueue::finished, this, &QueueRunner::onFinished );
connect( m_queue, &Calamares::JobQueue::failed, this, &QueueRunner::onFailed );
}
QueueRunner::~QueueRunner()
@ -153,7 +154,7 @@ QueueRunner::onFailed( const QString& message, const QString& details )
QFAIL( qPrintable( msg ) );
}
static CalamaresUtils::Partition::KPMManager* kpmcore = nullptr;
static Calamares::Partition::KPMManager* kpmcore = nullptr;
//- PartitionJobTests ------------------------------------------------------------------
PartitionJobTests::PartitionJobTests()
@ -172,7 +173,7 @@ PartitionJobTests::initTestCase()
0 );
}
kpmcore = new CalamaresUtils::Partition::KPMManager();
kpmcore = new Calamares::Partition::KPMManager();
FileSystemFactory::init();
refreshDevice();

View File

@ -58,7 +58,7 @@ unmountTargetMounts( const QString& rootMountPoint )
targetMountPath.append( '/' );
}
using MtabInfo = CalamaresUtils::Partition::MtabInfo;
using MtabInfo = Calamares::Partition::MtabInfo;
auto targetMounts = MtabInfo::fromMtabFilteredByPrefix( targetMountPath );
std::sort( targetMounts.begin(), targetMounts.end(), MtabInfo::mountPointOrder );
@ -67,7 +67,7 @@ unmountTargetMounts( const QString& rootMountPoint )
{
// Returns the program's exit code, so 0 is success and non-0
// (truthy) is a failure.
if ( CalamaresUtils::Partition::unmount( m.mountPoint, { "-lv" } ) )
if ( Calamares::Partition::unmount( m.mountPoint, { "-lv" } ) )
{
return Calamares::JobResult::error(
QCoreApplication::translate( UmountJob::staticMetaObject.className(),