Merge pull request #1243 from stikonas/master

QLatin1Literal->QLatin1String.
This commit is contained in:
Adriaan de Groot 2019-09-30 10:30:02 +02:00 committed by GitHub
commit 5d0a5c035d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 19 additions and 19 deletions

View File

@ -67,7 +67,7 @@ public:
* en_US and en (American English) is defined as English. The Queen's * en_US and en (American English) is defined as English. The Queen's
* English -- proper English -- is relegated to non-English status. * English -- proper English -- is relegated to non-English status.
*/ */
bool isEnglish() const { return m_localeId == QLatin1Literal( "en_US" ) || m_localeId == QLatin1Literal( "en" ); } bool isEnglish() const { return m_localeId == QLatin1String( "en_US" ) || m_localeId == QLatin1String( "en" ); }
/** @brief Get the human-readable name for this locale. */ /** @brief Get the human-readable name for this locale. */
QString label() const { return m_label; } QString label() const { return m_label; }

View File

@ -131,8 +131,8 @@ findInCommands( const CommandList& l, const QString& needle )
Calamares::JobResult Calamares::JobResult
CommandList::run() CommandList::run()
{ {
QLatin1Literal rootMagic( "@@ROOT@@" ); QLatin1String rootMagic( "@@ROOT@@" );
QLatin1Literal userMagic( "@@USER@@" ); QLatin1String userMagic( "@@USER@@" );
System::RunLocation location = m_doChroot ? System::RunLocation::RunInTarget : System::RunLocation::RunInHost; System::RunLocation location = m_doChroot ? System::RunLocation::RunInTarget : System::RunLocation::RunInHost;

View File

@ -275,12 +275,12 @@ ViewManager::onInitFailed( const QStringList& modules )
{ {
description.append( tr( "<br/>The following modules could not be loaded:" ) ); description.append( tr( "<br/>The following modules could not be loaded:" ) );
QStringList details; QStringList details;
details << QLatin1Literal( "<ul>" ); details << QLatin1String( "<ul>" );
for ( const auto& m : modules ) for ( const auto& m : modules )
{ {
details << QLatin1Literal( "<li>" ) << m << QLatin1Literal( "</li>" ); details << QLatin1String( "<li>" ) << m << QLatin1String( "</li>" );
} }
details << QLatin1Literal( "</ul>" ); details << QLatin1String( "</ul>" );
detailString = details.join( QString() ); detailString = details.join( QString() );
} }

View File

@ -91,7 +91,7 @@ ModuleManager::doInit()
bool success = currentDir.cd( subdir ); bool success = currentDir.cd( subdir );
if ( success ) if ( success )
{ {
QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc" ) ) ); QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1String( "module.desc" ) ) );
if ( !descriptorFileInfo.exists() ) if ( !descriptorFileInfo.exists() )
{ {
cDebug() << "ModuleManager expected descriptor is missing:" cDebug() << "ModuleManager expected descriptor is missing:"

View File

@ -137,7 +137,7 @@ PythonQtViewModule::loadSelf()
return; return;
} }
static const QLatin1Literal calamares_module_annotation( static const QLatin1String calamares_module_annotation(
"_calamares_module_typename = ''\n" "_calamares_module_typename = ''\n"
"def calamares_module(viewmodule_type):\n" "def calamares_module(viewmodule_type):\n"
" global _calamares_module_typename\n" " global _calamares_module_typename\n"

View File

@ -30,7 +30,7 @@
#include "utils/Logger.h" #include "utils/Logger.h"
// static // static
const QLatin1Literal DracutLuksCfgJob::CONFIG_FILE( "/etc/dracut.conf.d/calamares-luks.conf" ); const QLatin1String DracutLuksCfgJob::CONFIG_FILE( "/etc/dracut.conf.d/calamares-luks.conf" );
// static // static
const char *DracutLuksCfgJob::CONFIG_FILE_HEADER = const char *DracutLuksCfgJob::CONFIG_FILE_HEADER =
@ -50,7 +50,7 @@ const char *DracutLuksCfgJob::CONFIG_FILE_CRYPTTAB_LINE =
"install_items+=\" /etc/crypttab \"\n"; "install_items+=\" /etc/crypttab \"\n";
// static // static
const QLatin1Literal DracutLuksCfgJob::CONFIG_FILE_SWAPLINE( "# enable automatic resume from swap\nadd_device+=\" /dev/disk/by-uuid/%1 \"\n" ); const QLatin1String DracutLuksCfgJob::CONFIG_FILE_SWAPLINE( "# enable automatic resume from swap\nadd_device+=\" /dev/disk/by-uuid/%1 \"\n" );
// static // static
QString QString

View File

@ -42,11 +42,11 @@ public:
Calamares::JobResult exec() override; Calamares::JobResult exec() override;
private: private:
static const QLatin1Literal CONFIG_FILE; static const QLatin1String CONFIG_FILE;
static const char *CONFIG_FILE_HEADER; static const char *CONFIG_FILE_HEADER;
static const char *CONFIG_FILE_CRYPTTAB_KEYFILE_LINE; static const char *CONFIG_FILE_CRYPTTAB_KEYFILE_LINE;
static const char *CONFIG_FILE_CRYPTTAB_LINE; static const char *CONFIG_FILE_CRYPTTAB_LINE;
static const QLatin1Literal CONFIG_FILE_SWAPLINE; static const QLatin1String CONFIG_FILE_SWAPLINE;
static QString rootMountPoint(); static QString rootMountPoint();
static QVariantList partitions(); static QVariantList partitions();

View File

@ -241,7 +241,7 @@ LocalePage::init( const QString& initialRegion, const QString& initialZone, cons
<< "\n\t " << "\n\t "
<< "* a well-formed" << supported.fileName() << "\n\tOR" << "* a well-formed" << supported.fileName() << "\n\tOR"
<< "* a well-formed" << "* a well-formed"
<< ( localeGenPath.isEmpty() ? QLatin1Literal( "/etc/locale.gen" ) : localeGenPath ) << "\n\tOR" << ( localeGenPath.isEmpty() ? QLatin1String( "/etc/locale.gen" ) : localeGenPath ) << "\n\tOR"
<< "* a complete pre-compiled locale-gen database which allows complete locale -a output."; << "* a complete pre-compiled locale-gen database which allows complete locale -a output.";
return; // something went wrong and there's nothing we can do about it. return; // something went wrong and there's nothing we can do about it.
} }

View File

@ -34,7 +34,7 @@ constexpr static double MATH_PI = 3.14159265;
#ifdef DEBUG_TIMEZONES #ifdef DEBUG_TIMEZONES
// Adds a label to the timezone with this name // Adds a label to the timezone with this name
constexpr static QLatin1Literal ZONE_NAME( "zone" ); constexpr static QLatin1String ZONE_NAME( "zone" );
#endif #endif
TimeZoneWidget::TimeZoneWidget( QWidget* parent ) : TimeZoneWidget::TimeZoneWidget( QWidget* parent ) :

View File

@ -45,7 +45,7 @@ PackageTreeItem::PackageTreeItem::PackageTreeItem() :
PackageTreeItem( QString(), nullptr ) PackageTreeItem( QString(), nullptr )
{ {
m_data.selected = Qt::Checked; m_data.selected = Qt::Checked;
m_data.name = QLatin1Literal( "<root>" ); m_data.name = QLatin1String( "<root>" );
} }
PackageTreeItem::~PackageTreeItem() PackageTreeItem::~PackageTreeItem()

View File

@ -450,7 +450,7 @@ isEfiBootable( const Partition* candidate )
QString QString
findFS( QString fsName, FileSystem::Type* fsType ) findFS( QString fsName, FileSystem::Type* fsType )
{ {
QStringList fsLanguage { QLatin1Literal( "C" ) }; // Required language list to turn off localization QStringList fsLanguage { QLatin1String( "C" ) }; // Required language list to turn off localization
if ( fsName.isEmpty() ) if ( fsName.isEmpty() )
fsName = QStringLiteral( "ext4" ); fsName = QStringLiteral( "ext4" );

View File

@ -646,7 +646,7 @@ PartitionViewStep::checkRequirements()
Calamares::RequirementsList l; Calamares::RequirementsList l;
l.append( l.append(
{ {
QLatin1Literal( "partitions" ), QLatin1String( "partitions" ),
[]{ return tr( "has at least one disk device available." ); }, []{ return tr( "has at least one disk device available." ); },
[]{ return tr( "There are no partitons to install on." ); }, []{ return tr( "There are no partitons to install on." ); },
m_core->deviceModel()->rowCount() > 0, // satisfied m_core->deviceModel()->rowCount() > 0, // satisfied

View File

@ -52,7 +52,7 @@ QString targetPrefix()
} }
} }
return QLatin1Literal( "/" ); return QLatin1String( "/" );
} }
QString atReplacements( QString s ) QString atReplacements( QString s )

View File

@ -173,7 +173,7 @@ UsersViewStep::setConfigurationMap( const QVariantMap& configurationMap )
} }
} }
QString shell( QLatin1Literal( "/bin/bash" ) ); // as if it's not set at all QString shell( QLatin1String( "/bin/bash" ) ); // as if it's not set at all
if ( configurationMap.contains( "userShell" ) ) if ( configurationMap.contains( "userShell" ) )
shell = CalamaresUtils::getString( configurationMap, "userShell" ); shell = CalamaresUtils::getString( configurationMap, "userShell" );
// Now it might be explicitly set to empty, which is ok // Now it might be explicitly set to empty, which is ok