libcalamares: use namespace Calamares::Packages consistently
This commit is contained in:
parent
a9ef587705
commit
641e186b7c
@ -66,7 +66,7 @@ additions( Calamares::GlobalStorage* gs,
|
||||
}
|
||||
|
||||
bool
|
||||
CalamaresUtils::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs,
|
||||
Calamares::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs,
|
||||
const Calamares::ModuleSystem::InstanceKey& module,
|
||||
const QVariantList& installPackages,
|
||||
const QVariantList& tryInstallPackages )
|
||||
@ -75,7 +75,7 @@ CalamaresUtils::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs,
|
||||
}
|
||||
|
||||
bool
|
||||
CalamaresUtils::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs,
|
||||
Calamares::Packages::setGSPackageAdditions( Calamares::GlobalStorage* gs,
|
||||
const Calamares::ModuleSystem::InstanceKey& module,
|
||||
const QStringList& installPackages )
|
||||
{
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "GlobalStorage.h"
|
||||
#include "modulesystem/InstanceKey.h"
|
||||
|
||||
namespace CalamaresUtils
|
||||
namespace Calamares
|
||||
{
|
||||
namespace Packages
|
||||
{
|
||||
@ -38,7 +38,7 @@ bool setGSPackageAdditions( Calamares::GlobalStorage* gs,
|
||||
const QStringList& installPackages );
|
||||
// void setGSPackageRemovals( const Calamares::ModuleSystem::InstanceKey& key, const QVariantList& removePackages );
|
||||
} // namespace Packages
|
||||
} // namespace CalamaresUtils
|
||||
} // namespace Calamares
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -52,10 +52,10 @@ PackagesTests::testEmpty()
|
||||
QCOMPARE( k.toString(), "this@that" );
|
||||
|
||||
// Adding nothing at all does nothing
|
||||
QVERIFY( !CalamaresUtils::Packages::setGSPackageAdditions( &gs, k, QVariantList(), QVariantList() ) );
|
||||
QVERIFY( !Calamares::Packages::setGSPackageAdditions( &gs, k, QVariantList(), QVariantList() ) );
|
||||
QVERIFY( !gs.contains( topKey ) );
|
||||
|
||||
QVERIFY( !CalamaresUtils::Packages::setGSPackageAdditions( &gs, k, QStringList() ) );
|
||||
QVERIFY( !Calamares::Packages::setGSPackageAdditions( &gs, k, QStringList() ) );
|
||||
QVERIFY( !gs.contains( topKey ) );
|
||||
}
|
||||
|
||||
@ -88,8 +88,7 @@ PackagesTests::testAdd()
|
||||
|
||||
{
|
||||
QVERIFY( !gs.contains( topKey ) );
|
||||
QVERIFY(
|
||||
CalamaresUtils::Packages::setGSPackageAdditions( &gs, k, QVariant( packages ).toList(), QVariantList() ) );
|
||||
QVERIFY( Calamares::Packages::setGSPackageAdditions( &gs, k, QVariant( packages ).toList(), QVariantList() ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
QCOMPARE( actionList.length(), 1 );
|
||||
@ -104,7 +103,7 @@ PackagesTests::testAdd()
|
||||
cDebug() << op;
|
||||
}
|
||||
{
|
||||
QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions( &gs, otherInstance, packages ) );
|
||||
QVERIFY( Calamares::Packages::setGSPackageAdditions( &gs, otherInstance, packages ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
QCOMPARE( actionList.length(), 2 ); // One for each instance key!
|
||||
@ -118,7 +117,7 @@ PackagesTests::testAdd()
|
||||
{
|
||||
// Replace one and expect differences
|
||||
packages << extraEditor;
|
||||
QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions( &gs, otherInstance, packages ) );
|
||||
QVERIFY( Calamares::Packages::setGSPackageAdditions( &gs, otherInstance, packages ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
QCOMPARE( actionList.length(), 2 ); // One for each instance key!
|
||||
@ -160,8 +159,8 @@ PackagesTests::testAddMixed()
|
||||
// Just one
|
||||
{
|
||||
QVERIFY( !gs.contains( topKey ) );
|
||||
QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions(
|
||||
&gs, k, QVariantList { QString( "vim" ) }, QVariantList() ) );
|
||||
QVERIFY(
|
||||
Calamares::Packages::setGSPackageAdditions( &gs, k, QVariantList { QString( "vim" ) }, QVariantList() ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
QCOMPARE( actionList.length(), 1 );
|
||||
@ -175,7 +174,7 @@ PackagesTests::testAddMixed()
|
||||
|
||||
// Replace with two packages
|
||||
{
|
||||
QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions(
|
||||
QVERIFY( Calamares::Packages::setGSPackageAdditions(
|
||||
&gs, k, QVariantList { QString( "vim" ), QString( "emacs" ) }, QVariantList() ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
@ -192,8 +191,8 @@ PackagesTests::testAddMixed()
|
||||
|
||||
// Replace with one (different) package
|
||||
{
|
||||
QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions(
|
||||
&gs, k, QVariantList { QString( "nano" ) }, QVariantList() ) );
|
||||
QVERIFY(
|
||||
Calamares::Packages::setGSPackageAdditions( &gs, k, QVariantList { QString( "nano" ) }, QVariantList() ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
QCOMPARE( actionList.length(), 1 );
|
||||
@ -208,7 +207,7 @@ PackagesTests::testAddMixed()
|
||||
|
||||
// Now we have two sources
|
||||
{
|
||||
QVERIFY( CalamaresUtils::Packages::setGSPackageAdditions( &gs, otherInstance, QStringList( extraEditor ) ) );
|
||||
QVERIFY( Calamares::Packages::setGSPackageAdditions( &gs, otherInstance, QStringList( extraEditor ) ) );
|
||||
QVERIFY( gs.contains( topKey ) );
|
||||
auto actionList = gs.value( topKey ).toList();
|
||||
QCOMPARE( actionList.length(), 2 );
|
||||
|
@ -178,6 +178,6 @@ Config::finalizeGlobalStorage( const Calamares::ModuleSystem::InstanceKey& key )
|
||||
}
|
||||
}
|
||||
|
||||
CalamaresUtils::Packages::setGSPackageAdditions(
|
||||
Calamares::Packages::setGSPackageAdditions(
|
||||
Calamares::JobQueue::instance()->globalStorage(), key, installPackages, tryInstallPackages );
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ Config::updateGlobalStorage( const QStringList& selected ) const
|
||||
{
|
||||
QStringList packageNames = m_model->getInstallPackagesForNames( selected );
|
||||
cDebug() << m_defaultId << "packages to install" << packageNames;
|
||||
CalamaresUtils::Packages::setGSPackageAdditions(
|
||||
Calamares::Packages::setGSPackageAdditions(
|
||||
Calamares::JobQueue::instance()->globalStorage(), m_defaultId, packageNames );
|
||||
}
|
||||
else if ( m_method == PackageChooserMethod::NetAdd )
|
||||
|
Loading…
Reference in New Issue
Block a user