Commit 1a5ae7cb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use =default + use {}

parent 31f62905
Pipeline #100216 passed with stage
in 50 minutes and 48 seconds
......@@ -21,9 +21,7 @@ Evolutionv1ImportData::Evolutionv1ImportData(QObject *parent, const QList<QVaria
mPath = MailImporter::FilterEvolution::defaultSettingsPath();
}
Evolutionv1ImportData::~Evolutionv1ImportData()
{
}
Evolutionv1ImportData::~Evolutionv1ImportData() = default;
bool Evolutionv1ImportData::foundMailer() const
{
......
......@@ -21,9 +21,7 @@ Evolutionv2ImportData::Evolutionv2ImportData(QObject *parent, const QList<QVaria
mPath = MailImporter::FilterEvolution_v2::defaultSettingsPath();
}
Evolutionv2ImportData::~Evolutionv2ImportData()
{
}
Evolutionv2ImportData::~Evolutionv2ImportData() = default;
bool Evolutionv2ImportData::foundMailer() const
{
......
......@@ -10,9 +10,7 @@ GearyAddressBook::GearyAddressBook(const QString &filename)
{
}
GearyAddressBook::~GearyAddressBook()
{
}
GearyAddressBook::~GearyAddressBook() = default;
void GearyAddressBook::importAddressBook()
{
......
......@@ -22,9 +22,7 @@ GearyImportData::GearyImportData(QObject *parent, const QList<QVariant> &)
mPath = MailImporter::OtherMailerUtil::gearyDefaultPath();
}
GearyImportData::~GearyImportData()
{
}
GearyImportData::~GearyImportData() = default;
bool GearyImportData::foundMailer() const
{
......
......@@ -21,9 +21,7 @@ NylasMailImportData::NylasMailImportData(QObject *parent, const QList<QVariant>
mPath = MailImporter::OtherMailerUtil::nylasMailDefaultPath();
}
NylasMailImportData::~NylasMailImportData()
{
}
NylasMailImportData::~NylasMailImportData() = default;
bool NylasMailImportData::foundMailer() const
{
......
......@@ -16,9 +16,7 @@ NylasMailSettings::NylasMailSettings(const QString &filename)
{
}
NylasMailSettings::~NylasMailSettings()
{
}
NylasMailSettings::~NylasMailSettings() = default;
void NylasMailSettings::importSettings()
{
......
......@@ -69,9 +69,7 @@ void OperaAddressBook::importAddressBook()
appendContact(contact);
}
OperaAddressBook::~OperaAddressBook()
{
}
OperaAddressBook::~OperaAddressBook() = default;
void OperaAddressBook::appendContact(KContacts::Addressee *contact)
{
......
......@@ -22,9 +22,7 @@ OperaImportData::OperaImportData(QObject *parent, const QList<QVariant> &)
mPath = MailImporter::FilterOpera::defaultSettingsPath();
}
OperaImportData::~OperaImportData()
{
}
OperaImportData::~OperaImportData() = default;
bool OperaImportData::foundMailer() const
{
......
......@@ -41,9 +41,7 @@ void OperaSettings::importSettings()
}
}
OperaSettings::~OperaSettings()
{
}
OperaSettings::~OperaSettings() = default;
void OperaSettings::readAccount(const KConfigGroup &grp)
{
......
......@@ -102,9 +102,7 @@ CryptoPagePlugin::CryptoPagePlugin()
box->setLayout(boxLayout);
}
CryptoPagePlugin::~CryptoPagePlugin()
{
}
CryptoPagePlugin::~CryptoPagePlugin() = default;
QString CryptoPagePlugin::title() const
{
......
......@@ -252,7 +252,7 @@ KContacts::AddresseeList CSVImportDialog::contacts() const
qApp->processEvents();
if (progressDialog.wasCanceled()) {
return KContacts::AddresseeList();
return {};
}
progressDialog.setValue(progressDialog.value() + 1);
......
......@@ -12,9 +12,7 @@ DateParser::DateParser(const QString &pattern)
{
}
DateParser::~DateParser()
{
}
DateParser::~DateParser() = default;
QDateTime DateParser::parse(const QString &dateStr) const
{
......@@ -33,14 +31,14 @@ QDateTime DateParser::parse(const QString &dateStr) const
currPos += 2;
} else {
return QDateTime();
return {};
}
} else if (mPattern[i] == QLatin1Char('Y')) { // YYYY
if (currPos + 3 < dateStr.length()) {
year = QStringView(dateStr).mid(currPos, 4).toInt();
currPos += 4;
} else {
return QDateTime();
return {};
}
} else if (mPattern[i] == QLatin1Char('m')) { // M or MM
if (currPos + 1 < dateStr.length()) {
......@@ -62,13 +60,13 @@ QDateTime DateParser::parse(const QString &dateStr) const
}
}
return QDateTime();
return {};
} else if (mPattern[i] == QLatin1Char('M')) { // 0M or MM
if (currPos + 1 < dateStr.length()) {
month = QStringView(dateStr).mid(currPos, 2).toInt();
currPos += 2;
} else {
return QDateTime();
return {};
}
} else if (mPattern[i] == QLatin1Char('d')) { // D or DD
if (currPos + 1 < dateStr.length()) {
......@@ -88,34 +86,34 @@ QDateTime DateParser::parse(const QString &dateStr) const
}
}
return QDateTime();
return {};
} else if (mPattern[i] == QLatin1Char('D')) { // 0D or DD
if (currPos + 1 < dateStr.length()) {
day = QStringView(dateStr).mid(currPos, 2).toInt();
currPos += 2;
} else {
return QDateTime();
return {};
}
} else if (mPattern[i] == QLatin1Char('H')) { // 0H or HH
if (currPos + 1 < dateStr.length()) {
hour = QStringView(dateStr).mid(currPos, 2).toInt();
currPos += 2;
} else {
return QDateTime();
return {};
}
} else if (mPattern[i] == QLatin1Char('I')) { // 0I or II
if (currPos + 1 < dateStr.length()) {
minute = QStringView(dateStr).mid(currPos, 2).toInt();
currPos += 2;
} else {
return QDateTime();
return {};
}
} else if (mPattern[i] == QLatin1Char('S')) { // 0S or SS
if (currPos + 1 < dateStr.length()) {
second = QStringView(dateStr).mid(currPos, 2).toInt();
currPos += 2;
} else {
return QDateTime();
return {};
}
} else {
currPos++;
......
......@@ -110,9 +110,7 @@ QCsvModel::QCsvModel(QObject *parent)
connect(mParser, &CsvParser::ended, this, &QCsvModel::finishedLoading);
}
QCsvModel::~QCsvModel()
{
}
QCsvModel::~QCsvModel() = default;
bool QCsvModel::load(QIODevice *device)
{
......@@ -232,24 +230,24 @@ int QCsvModel::rowCount(const QModelIndex &parent) const
QVariant QCsvModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid()) {
return QVariant();
return {};
}
if (index.row() == 0) {
if (index.column() >= mFieldIdentifiers.count()) {
return QVariant();
return {};
}
if (role == Qt::DisplayRole || role == Qt::EditRole) {
return mFieldIdentifiers.at(index.column());
}
return QVariant();
return {};
}
const QPair<int, int> pair(index.row() - 1, index.column());
if (!mFields.contains(pair)) {
return QVariant();
return {};
}
const QString data = mFields.value(pair);
......@@ -257,7 +255,7 @@ QVariant QCsvModel::data(const QModelIndex &index, int role) const
if (role == Qt::DisplayRole) {
return data;
} else {
return QVariant();
return {};
}
}
......
......@@ -12,9 +12,7 @@
#include <QTextStream>
#include <QVector>
QCsvBuilderInterface::~QCsvBuilderInterface()
{
}
QCsvBuilderInterface::~QCsvBuilderInterface() = default;
class QCsvReaderPrivate
{
......@@ -340,7 +338,7 @@ uint QCsvStandardBuilder::columnCount() const
QString QCsvStandardBuilder::data(uint row, uint column) const
{
if (row > d->mRowCount || column > d->mColumnCount || column >= (uint)d->mRows[row].count()) {
return QString();
return {};
}
return d->mRows[row][column];
......
......@@ -63,7 +63,7 @@ public:
Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
{
if (!index.isValid() || index.row() >= mTemplates.count() || index.column() >= 2) {
return QVariant();
return {};
}
if (role == Qt::DisplayRole) {
......@@ -78,7 +78,7 @@ public:
return mTemplates[index.row()].isDeletable;
}
return QVariant();
return {};
}
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override
......
......@@ -13,13 +13,9 @@
// https://docs.microsoft.com/en-us/previous-versions//ms735869(v=vs.85)
ImportWindowContact::ImportWindowContact()
{
}
ImportWindowContact::ImportWindowContact() = default;
ImportWindowContact::~ImportWindowContact()
{
}
ImportWindowContact::~ImportWindowContact() = default;
KContacts::Addressee::List ImportWindowContact::importFile(const QString &fileName)
{
......
......@@ -15,9 +15,7 @@ CheckGravatarPlugin::CheckGravatarPlugin(QObject *parent, const QList<QVariant>
{
}
CheckGravatarPlugin::~CheckGravatarPlugin()
{
}
CheckGravatarPlugin::~CheckGravatarPlugin() = default;
PimCommon::GenericPluginInterface *CheckGravatarPlugin::createInterface(QObject *parent)
{
......
......@@ -21,9 +21,7 @@ CheckGravatarPluginInterface::CheckGravatarPluginInterface(QObject *parent)
{
}
CheckGravatarPluginInterface::~CheckGravatarPluginInterface()
{
}
CheckGravatarPluginInterface::~CheckGravatarPluginInterface() = default;
void CheckGravatarPluginInterface::updateActions(int numberOfSelectedItems, int numberOfSelectedCollections)
{
......
......@@ -15,9 +15,7 @@ GravatarUpdateDialogTest::GravatarUpdateDialogTest(QObject *parent)
{
}
GravatarUpdateDialogTest::~GravatarUpdateDialogTest()
{
}
GravatarUpdateDialogTest::~GravatarUpdateDialogTest() = default;
void GravatarUpdateDialogTest::shouldHaveDefaultValue()
{
......
......@@ -13,9 +13,7 @@ GravatarUpdateJobTest::GravatarUpdateJobTest(QObject *parent)
{
}
GravatarUpdateJobTest::~GravatarUpdateJobTest()
{
}
GravatarUpdateJobTest::~GravatarUpdateJobTest() = default;
void GravatarUpdateJobTest::shouldHaveDefaultValue()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment