[libcalamares][modules] Use compatibility for QString::split()
- Use the compatibility value, which has an enum value suitable for the Qt version in use.
This commit is contained in:
parent
d6b0583bad
commit
192263cf9d
@ -1,5 +1,5 @@
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
@ -23,6 +23,7 @@
|
||||
#include "Interface.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/String.h"
|
||||
|
||||
namespace CalamaresUtils
|
||||
{
|
||||
@ -43,7 +44,7 @@ splitTZString( const QString& tz )
|
||||
timezoneString.remove( '\\' );
|
||||
timezoneString.replace( ' ', '_' );
|
||||
|
||||
QStringList tzParts = timezoneString.split( '/', QString::SkipEmptyParts );
|
||||
QStringList tzParts = timezoneString.split( '/', SplitSkipEmptyParts );
|
||||
if ( tzParts.size() >= 2 )
|
||||
{
|
||||
cDebug() << "GeoIP reporting" << timezoneString;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
@ -23,6 +23,7 @@
|
||||
#include "TimeZone.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/String.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QStringList>
|
||||
@ -156,19 +157,19 @@ TZRegion::fromFile( const char* fileName )
|
||||
QTextStream in( &file );
|
||||
while ( !in.atEnd() )
|
||||
{
|
||||
QString line = in.readLine().trimmed().split( '#', QString::KeepEmptyParts ).first().trimmed();
|
||||
QString line = in.readLine().trimmed().split( '#', SplitKeepEmptyParts ).first().trimmed();
|
||||
if ( line.isEmpty() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QStringList list = line.split( QRegExp( "[\t ]" ), QString::SkipEmptyParts );
|
||||
QStringList list = line.split( QRegExp( "[\t ]" ), SplitSkipEmptyParts );
|
||||
if ( list.size() < 3 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QStringList timezoneParts = list.at( 2 ).split( '/', QString::SkipEmptyParts );
|
||||
QStringList timezoneParts = list.at( 2 ).split( '/', SplitSkipEmptyParts );
|
||||
if ( timezoneParts.size() < 2 )
|
||||
{
|
||||
continue;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "JobQueue.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "utils/String.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QProcess>
|
||||
@ -287,7 +288,7 @@ Config::init()
|
||||
|
||||
if ( process.waitForFinished() )
|
||||
{
|
||||
const QStringList list = QString( process.readAll() ).split( "\n", QString::SkipEmptyParts );
|
||||
const QStringList list = QString( process.readAll() ).split( "\n", SplitSkipEmptyParts );
|
||||
|
||||
for ( QString line : list )
|
||||
{
|
||||
@ -300,7 +301,7 @@ Config::init()
|
||||
line = line.remove( "}" ).remove( "{" ).remove( ";" );
|
||||
line = line.mid( line.indexOf( "\"" ) + 1 );
|
||||
|
||||
QStringList split = line.split( "+", QString::SkipEmptyParts );
|
||||
QStringList split = line.split( "+", SplitSkipEmptyParts );
|
||||
if ( split.size() >= 2 )
|
||||
{
|
||||
currentLayout = split.at( 1 );
|
||||
@ -496,7 +497,7 @@ Config::onActivate()
|
||||
}
|
||||
if ( !lang.isEmpty() )
|
||||
{
|
||||
const auto langParts = lang.split( '_', QString::SkipEmptyParts );
|
||||
const auto langParts = lang.split( '_', SplitSkipEmptyParts );
|
||||
|
||||
// Note that this his string is not fit for display purposes!
|
||||
// It doesn't come from QLocale::nativeCountryName.
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "JobQueue.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "utils/String.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QProcess>
|
||||
@ -113,7 +114,7 @@ KeyboardPage::init()
|
||||
|
||||
if ( process.waitForFinished() )
|
||||
{
|
||||
const QStringList list = QString( process.readAll() ).split( "\n", QString::SkipEmptyParts );
|
||||
const QStringList list = QString( process.readAll() ).split( "\n", SplitSkipEmptyParts );
|
||||
|
||||
for ( QString line : list )
|
||||
{
|
||||
@ -126,7 +127,7 @@ KeyboardPage::init()
|
||||
line = line.remove( "}" ).remove( "{" ).remove( ";" );
|
||||
line = line.mid( line.indexOf( "\"" ) + 1 );
|
||||
|
||||
QStringList split = line.split( "+", QString::SkipEmptyParts );
|
||||
QStringList split = line.split( "+", SplitSkipEmptyParts );
|
||||
if ( split.size() >= 2 )
|
||||
{
|
||||
currentLayout = split.at( 1 );
|
||||
@ -366,7 +367,7 @@ KeyboardPage::onActivate()
|
||||
}
|
||||
if ( !lang.isEmpty() )
|
||||
{
|
||||
const auto langParts = lang.split( '_', QString::SkipEmptyParts );
|
||||
const auto langParts = lang.split( '_', SplitSkipEmptyParts );
|
||||
|
||||
// Note that this his string is not fit for display purposes!
|
||||
// It doesn't come from QLocale::nativeCountryName.
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "JobQueue.h"
|
||||
#include "utils/CalamaresUtilsSystem.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/String.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
@ -104,7 +105,7 @@ SetKeyboardLayoutJob::findLegacyKeymap() const
|
||||
continue;
|
||||
}
|
||||
|
||||
QStringList mapping = line.split( '\t', QString::SkipEmptyParts );
|
||||
QStringList mapping = line.split( '\t', SplitSkipEmptyParts );
|
||||
if ( mapping.size() < 5 )
|
||||
{
|
||||
continue;
|
||||
|
@ -21,9 +21,11 @@
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "keyboardpreview.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/String.h"
|
||||
|
||||
KeyBoardPreview::KeyBoardPreview( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, layout( "us" )
|
||||
@ -129,7 +131,7 @@ bool KeyBoardPreview::loadCodes() {
|
||||
// Clear codes
|
||||
codes.clear();
|
||||
|
||||
const QStringList list = QString(process.readAll()).split("\n", QString::SkipEmptyParts);
|
||||
const QStringList list = QString(process.readAll()).split("\n", SplitSkipEmptyParts);
|
||||
|
||||
for (const QString &line : list) {
|
||||
if (!line.startsWith("keycode") || !line.contains('='))
|
||||
|
@ -73,7 +73,7 @@ getPartitionsForDevice( const QString& deviceName )
|
||||
{
|
||||
// The fourth column (index from 0, so index 3) is the name of the device;
|
||||
// keep it if it is followed by something.
|
||||
QStringList columns = in.readLine().split( ' ', QString::SkipEmptyParts );
|
||||
QStringList columns = in.readLine().split( ' ', SplitSkipEmptyParts );
|
||||
if ( ( columns.count() >= 4 ) && ( columns[ 3 ].startsWith( deviceName ) )
|
||||
&& ( columns[ 3 ] != deviceName ) )
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ ClearTempMountsJob::exec()
|
||||
QString lineIn = in.readLine();
|
||||
while ( !lineIn.isNull() )
|
||||
{
|
||||
QStringList line = lineIn.split( ' ', QString::SkipEmptyParts );
|
||||
QStringList line = lineIn.split( ' ', SplitSkipEmptyParts );
|
||||
cDebug() << line.join( ' ' );
|
||||
QString device = line.at( 0 );
|
||||
QString mountPoint = line.at( 1 );
|
||||
|
Loading…
Reference in New Issue
Block a user