[libcalamares] TZRegion is hard to copy

- delete the copy and move constructors
 - adjust tests (which were just interested in simple tr() behavior) to use TZZone instead
This commit is contained in:
Adriaan de Groot 2020-01-07 10:41:14 +01:00
parent 5fbd0169ca
commit 2dff2d9d70
2 changed files with 4 additions and 3 deletions

View file

@ -215,12 +215,12 @@ LocaleTests::testSimpleZones()
QVERIFY( n.tr().isEmpty() );
}
{
TZRegion r0( "xAmsterdam" );
TZZone r0( "xAmsterdam" );
QCOMPARE( r0.tr(), QStringLiteral( "xAmsterdam" ) );
TZRegion r1( r0 );
TZZone r1( r0 );
QCOMPARE( r0.tr(), QStringLiteral( "xAmsterdam" ) );
QCOMPARE( r1.tr(), QStringLiteral( "xAmsterdam" ) );
TZRegion r2( std::move( r0 ) );
TZZone r2( std::move( r0 ) );
QCOMPARE( r2.tr(), QStringLiteral( "xAmsterdam" ) );
QCOMPARE( r0.tr(), QString() );
}

View file

@ -89,6 +89,7 @@ class TZRegion : public CStringPair
public:
using CStringPair::CStringPair;
virtual ~TZRegion() override;
TZRegion( const TZRegion& ) = delete;
QString tr() const override;
QString region() const { return key(); }