From 490c14d93df531856c89623aebb2dc2929005afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 8 Sep 2019 21:20:13 +0100 Subject: [PATCH] QLatin1Literal->QLatin1String. --- src/libcalamares/locale/Label.h | 2 +- src/libcalamares/utils/CommandList.cpp | 4 ++-- src/libcalamaresui/ViewManager.cpp | 6 +++--- src/libcalamaresui/modulesystem/ModuleManager.cpp | 2 +- src/libcalamaresui/modulesystem/PythonQtViewModule.cpp | 2 +- src/modules/dracutlukscfg/DracutLuksCfgJob.cpp | 4 ++-- src/modules/dracutlukscfg/DracutLuksCfgJob.h | 4 ++-- src/modules/locale/LocalePage.cpp | 2 +- src/modules/locale/timezonewidget/timezonewidget.cpp | 2 +- src/modules/netinstall/PackageTreeItem.cpp | 2 +- src/modules/partition/core/PartUtils.cpp | 2 +- src/modules/partition/gui/PartitionViewStep.cpp | 2 +- src/modules/preservefiles/PreserveFiles.cpp | 2 +- src/modules/users/UsersViewStep.cpp | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/libcalamares/locale/Label.h b/src/libcalamares/locale/Label.h index 0fe61d909..95129d38c 100644 --- a/src/libcalamares/locale/Label.h +++ b/src/libcalamares/locale/Label.h @@ -67,7 +67,7 @@ public: * en_US and en (American English) is defined as English. The Queen's * 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. */ QString label() const { return m_label; } diff --git a/src/libcalamares/utils/CommandList.cpp b/src/libcalamares/utils/CommandList.cpp index 1a3075a43..8a2f3835b 100644 --- a/src/libcalamares/utils/CommandList.cpp +++ b/src/libcalamares/utils/CommandList.cpp @@ -131,8 +131,8 @@ findInCommands( const CommandList& l, const QString& needle ) Calamares::JobResult CommandList::run() { - QLatin1Literal rootMagic( "@@ROOT@@" ); - QLatin1Literal userMagic( "@@USER@@" ); + QLatin1String rootMagic( "@@ROOT@@" ); + QLatin1String userMagic( "@@USER@@" ); System::RunLocation location = m_doChroot ? System::RunLocation::RunInTarget : System::RunLocation::RunInHost; diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 8fb832369..6da81e7af 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -275,12 +275,12 @@ ViewManager::onInitFailed( const QStringList& modules ) { description.append( tr( "
The following modules could not be loaded:" ) ); QStringList details; - details << QLatin1Literal( "" ); detailString = details.join( QString() ); } diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 78164ae18..53cc1fabb 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -91,7 +91,7 @@ ModuleManager::doInit() bool success = currentDir.cd( subdir ); if ( success ) { - QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc" ) ) ); + QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1String( "module.desc" ) ) ); if ( !descriptorFileInfo.exists() ) { cDebug() << "ModuleManager expected descriptor is missing:" diff --git a/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp b/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp index 0b775e067..08e4c5c08 100644 --- a/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp +++ b/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp @@ -137,7 +137,7 @@ PythonQtViewModule::loadSelf() return; } - static const QLatin1Literal calamares_module_annotation( + static const QLatin1String calamares_module_annotation( "_calamares_module_typename = ''\n" "def calamares_module(viewmodule_type):\n" " global _calamares_module_typename\n" diff --git a/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp b/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp index 9b15ef87c..97b2c9d55 100644 --- a/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp +++ b/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp @@ -30,7 +30,7 @@ #include "utils/Logger.h" // 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 const char *DracutLuksCfgJob::CONFIG_FILE_HEADER = @@ -50,7 +50,7 @@ const char *DracutLuksCfgJob::CONFIG_FILE_CRYPTTAB_LINE = "install_items+=\" /etc/crypttab \"\n"; // 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 QString diff --git a/src/modules/dracutlukscfg/DracutLuksCfgJob.h b/src/modules/dracutlukscfg/DracutLuksCfgJob.h index 15ff24069..5811c34a1 100644 --- a/src/modules/dracutlukscfg/DracutLuksCfgJob.h +++ b/src/modules/dracutlukscfg/DracutLuksCfgJob.h @@ -42,11 +42,11 @@ public: Calamares::JobResult exec() override; private: - static const QLatin1Literal CONFIG_FILE; + static const QLatin1String CONFIG_FILE; static const char *CONFIG_FILE_HEADER; static const char *CONFIG_FILE_CRYPTTAB_KEYFILE_LINE; static const char *CONFIG_FILE_CRYPTTAB_LINE; - static const QLatin1Literal CONFIG_FILE_SWAPLINE; + static const QLatin1String CONFIG_FILE_SWAPLINE; static QString rootMountPoint(); static QVariantList partitions(); diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index d3829aad3..7720a840c 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -241,7 +241,7 @@ LocalePage::init( const QString& initialRegion, const QString& initialZone, cons << "\n\t " << "* a well-formed" << supported.fileName() << "\n\tOR" << "* 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."; return; // something went wrong and there's nothing we can do about it. } diff --git a/src/modules/locale/timezonewidget/timezonewidget.cpp b/src/modules/locale/timezonewidget/timezonewidget.cpp index a228f000c..1553af9bc 100644 --- a/src/modules/locale/timezonewidget/timezonewidget.cpp +++ b/src/modules/locale/timezonewidget/timezonewidget.cpp @@ -34,7 +34,7 @@ constexpr static double MATH_PI = 3.14159265; #ifdef DEBUG_TIMEZONES // Adds a label to the timezone with this name -constexpr static QLatin1Literal ZONE_NAME( "zone" ); +constexpr static QLatin1String ZONE_NAME( "zone" ); #endif TimeZoneWidget::TimeZoneWidget( QWidget* parent ) : diff --git a/src/modules/netinstall/PackageTreeItem.cpp b/src/modules/netinstall/PackageTreeItem.cpp index 80e553d2e..b3dc6fae7 100644 --- a/src/modules/netinstall/PackageTreeItem.cpp +++ b/src/modules/netinstall/PackageTreeItem.cpp @@ -45,7 +45,7 @@ PackageTreeItem::PackageTreeItem::PackageTreeItem() : PackageTreeItem( QString(), nullptr ) { m_data.selected = Qt::Checked; - m_data.name = QLatin1Literal( "" ); + m_data.name = QLatin1String( "" ); } PackageTreeItem::~PackageTreeItem() diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 562474865..94630b472 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -450,7 +450,7 @@ isEfiBootable( const Partition* candidate ) QString 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() ) fsName = QStringLiteral( "ext4" ); diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 8a190b68a..95df5561c 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -646,7 +646,7 @@ PartitionViewStep::checkRequirements() Calamares::RequirementsList l; l.append( { - QLatin1Literal( "partitions" ), + QLatin1String( "partitions" ), []{ return tr( "has at least one disk device available." ); }, []{ return tr( "There are no partitons to install on." ); }, m_core->deviceModel()->rowCount() > 0, // satisfied diff --git a/src/modules/preservefiles/PreserveFiles.cpp b/src/modules/preservefiles/PreserveFiles.cpp index 96d26274c..175f8e4f8 100644 --- a/src/modules/preservefiles/PreserveFiles.cpp +++ b/src/modules/preservefiles/PreserveFiles.cpp @@ -52,7 +52,7 @@ QString targetPrefix() } } - return QLatin1Literal( "/" ); + return QLatin1String( "/" ); } QString atReplacements( QString s ) diff --git a/src/modules/users/UsersViewStep.cpp b/src/modules/users/UsersViewStep.cpp index 4582a9e85..0d1bb593e 100644 --- a/src/modules/users/UsersViewStep.cpp +++ b/src/modules/users/UsersViewStep.cpp @@ -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" ) ) shell = CalamaresUtils::getString( configurationMap, "userShell" ); // Now it might be explicitly set to empty, which is ok