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

GIT_SILENT: modernize code

parent 57214013
Pipeline #100561 failed with stage
in 25 minutes and 47 seconds
......@@ -156,9 +156,7 @@ MailDispatcherAgent::MailDispatcherAgent(const QString &id)
setNeedsNetwork(true);
}
MailDispatcherAgent::~MailDispatcherAgent()
{
}
MailDispatcherAgent::~MailDispatcherAgent() = default;
void MailDispatcherAgent::doSetOnline(bool online)
{
......
......@@ -333,9 +333,7 @@ OutboxQueue::OutboxQueue(QObject *parent)
mFutureTimer->start(1h); // 1 hour
}
OutboxQueue::~OutboxQueue()
{
}
OutboxQueue::~OutboxQueue() = default;
bool OutboxQueue::isEmpty() const
{
......
......@@ -386,9 +386,7 @@ SendJob::SendJob(const Item &item, QObject *parent)
{
}
SendJob::~SendJob()
{
}
SendJob::~SendJob() = default;
void SendJob::start()
{
......
......@@ -25,9 +25,7 @@ StoreResultJob::StoreResultJob(const Item &item, bool success, const QString &me
mMessage = message;
}
StoreResultJob::~StoreResultJob()
{
}
StoreResultJob::~StoreResultJob() = default;
void StoreResultJob::doStart()
{
......
......@@ -127,14 +127,14 @@ int MigratorModel::rowCount(const QModelIndex &parent) const
QModelIndex MigratorModel::index(int row, int column, const QModelIndex &parent) const
{
if (row >= rowCount(parent) || row < 0) {
return QModelIndex();
return {};
}
return createIndex(row, column, static_cast<void *>(mMigrators.at(row).data()));
}
QModelIndex MigratorModel::parent(const QModelIndex & /*child*/) const
{
return QModelIndex();
return {};
}
QVariant MigratorModel::headerData(int section, Qt::Orientation /*orientation*/, int role) const
......@@ -151,7 +151,7 @@ QVariant MigratorModel::headerData(int section, Qt::Orientation /*orientation*/,
Q_ASSERT(false);
}
}
return QVariant();
return {};
}
QVariant MigratorModel::data(const QModelIndex &index, int role) const
......@@ -160,7 +160,7 @@ QVariant MigratorModel::data(const QModelIndex &index, int role) const
const QSharedPointer<MigratorBase> migrator(row->mMigrator);
if (!migrator) {
qWarning() << "migrator not found";
return QVariant();
return {};
}
switch (role) {
case Qt::DisplayRole:
......@@ -173,7 +173,7 @@ QVariant MigratorModel::data(const QModelIndex &index, int role) const
return migrator->status();
default:
Q_ASSERT(false);
return QVariant();
return {};
}
case IdentifierRole:
return migrator->identifier();
......@@ -184,7 +184,7 @@ QVariant MigratorModel::data(const QModelIndex &index, int role) const
default:
break;
}
return QVariant();
return {};
}
QSharedPointer<MigratorBase> MigratorModel::migrator(const QString &identifier) const
......@@ -194,7 +194,7 @@ QSharedPointer<MigratorBase> MigratorModel::migrator(const QString &identifier)
return row->mMigrator;
}
}
return QSharedPointer<MigratorBase>();
return {};
}
QList<QSharedPointer<MigratorBase>> MigratorModel::migrators() const
......
......@@ -19,9 +19,7 @@ NewMailNotifierReplyMessageJob::NewMailNotifierReplyMessageJob(Akonadi::Item::Id
{
}
NewMailNotifierReplyMessageJob::~NewMailNotifierReplyMessageJob()
{
}
NewMailNotifierReplyMessageJob::~NewMailNotifierReplyMessageJob() = default;
void NewMailNotifierReplyMessageJob::start()
{
......
......@@ -147,9 +147,7 @@ NewMailNotifierSelectCollectionWidget::NewMailNotifierSelectCollectionWidget(QWi
hbox->addStretch(1);
}
NewMailNotifierSelectCollectionWidget::~NewMailNotifierSelectCollectionWidget()
{
}
NewMailNotifierSelectCollectionWidget::~NewMailNotifierSelectCollectionWidget() = default;
void NewMailNotifierSelectCollectionWidget::slotCollectionTreeFetched()
{
......
......@@ -19,9 +19,7 @@ NewMailNotifierShowMessageJob::NewMailNotifierShowMessageJob(Akonadi::Item::Id i
{
}
NewMailNotifierShowMessageJob::~NewMailNotifierShowMessageJob()
{
}
NewMailNotifierShowMessageJob::~NewMailNotifierShowMessageJob() = default;
void NewMailNotifierShowMessageJob::start()
{
......
......@@ -36,9 +36,7 @@ SpecialNotifierJob::SpecialNotifierJob(const QStringList &listEmails, const QStr
connect(job, &Akonadi::ItemFetchJob::result, this, &SpecialNotifierJob::slotItemFetchJobDone);
}
SpecialNotifierJob::~SpecialNotifierJob()
{
}
SpecialNotifierJob::~SpecialNotifierJob() = default;
void SpecialNotifierJob::setDefaultIconName(const QString &iconName)
{
......
......@@ -39,9 +39,7 @@ KCMLdap::KCMLdap(QWidget *parent, const QVariantList &)
connect(mLdapConfigureWidget, &KLDAP::LdapConfigureWidget::changed, this, qOverload<bool>(&KCMLdap::changed));
}
KCMLdap::~KCMLdap()
{
}
KCMLdap::~KCMLdap() = default;
void KCMLdap::load()
{
......
......@@ -20,9 +20,7 @@ UpdateJob::UpdateJob(const Collection &col, QObject *parent)
{
}
UpdateJob::~UpdateJob()
{
}
UpdateJob::~UpdateJob() = default;
void UpdateJob::doStart()
{
......@@ -87,9 +85,7 @@ GidMigrationJob::GidMigrationJob(const QStringList &mimeTypeFilter, QObject *par
{
}
GidMigrationJob::~GidMigrationJob()
{
}
GidMigrationJob::~GidMigrationJob() = default;
void GidMigrationJob::doStart()
{
......
......@@ -15,9 +15,7 @@ GidMigrator::GidMigrator(const QString &mimeType)
{
}
GidMigrator::~GidMigrator()
{
}
GidMigrator::~GidMigrator() = default;
QString GidMigrator::displayName() const
{
......
......@@ -56,9 +56,7 @@ InfoDialog::InfoDialog(bool closeWhenDone)
mainLayout->addWidget(mButtonBox);
}
InfoDialog::~InfoDialog()
{
}
InfoDialog::~InfoDialog() = default;
static KMigratorBase::MessageType convertType(MigratorBase::MessageType type)
{
......
......@@ -41,7 +41,7 @@ QString messageTypeToString(KMigratorBase::MessageType type)
return QStringLiteral("ERROR ");
}
Q_ASSERT(false);
return QString();
return {};
}
}
......
......@@ -30,7 +30,7 @@ static QString messageTypeToString(MigratorBase::MessageType type)
return QStringLiteral("ERROR ");
}
Q_ASSERT(false);
return QString();
return {};
}
static QMap<QString, MigratorBase::MigrationState> fillMigrationStateMapping()
......@@ -84,9 +84,7 @@ MigratorBase::MigratorBase(const QString &identifier, const QString &configFile,
loadState();
}
MigratorBase::~MigratorBase()
{
}
MigratorBase::~MigratorBase() = default;
void MigratorBase::setLogfile(const QString &logfile)
{
......@@ -108,12 +106,12 @@ QString MigratorBase::identifier() const
QString MigratorBase::displayName() const
{
return QString();
return {};
}
QString MigratorBase::description() const
{
return QString();
return {};
}
QString MigratorBase::logfile() const
......@@ -121,7 +119,7 @@ QString MigratorBase::logfile() const
if (mLogFile) {
return mLogFile->fileName();
}
return QString();
return {};
}
bool MigratorBase::canStart()
......@@ -249,7 +247,7 @@ NullableConfigGroup MigratorBase::config()
if (mConfig) {
return NullableConfigGroup(mConfig->group(mIdentifier));
}
return NullableConfigGroup();
return {};
}
int MigratorBase::progress() const
......@@ -283,5 +281,5 @@ QString MigratorBase::status() const
case Failed:
return i18nc("@info:status", "Failed");
}
return QString();
return {};
}
......@@ -16,9 +16,7 @@
class NullableConfigGroup
{
public:
NullableConfigGroup()
{
}
NullableConfigGroup() = default;
explicit NullableConfigGroup(const KConfigGroup &grp)
: mConfigGroup(grp)
......
......@@ -11,9 +11,7 @@ AkonotesResource::AkonotesResource(const QString &id)
{
}
AkonotesResource::~AkonotesResource()
{
}
AkonotesResource::~AkonotesResource() = default;
QString AkonotesResource::itemMimeType() const
{
......
......@@ -35,9 +35,7 @@ BirthdaysConfigAgentWidget::BirthdaysConfigAgentWidget(const KSharedConfigPtr &c
ui.kcfg_AlarmDays->setSuffix(ki18np(" day", " days"));
}
BirthdaysConfigAgentWidget::~BirthdaysConfigAgentWidget()
{
}
BirthdaysConfigAgentWidget::~BirthdaysConfigAgentWidget() = default;
void BirthdaysConfigAgentWidget::load()
{
......
......@@ -48,9 +48,7 @@ BirthdaysResource::BirthdaysResource(const QString &id)
connect(this, &BirthdaysResource::reloadConfiguration, this, &BirthdaysResource::slotReloadConfig);
}
BirthdaysResource::~BirthdaysResource()
{
}
BirthdaysResource::~BirthdaysResource() = default;
void BirthdaysResource::slotReloadConfig()
{
......@@ -302,7 +300,7 @@ KCalendarCore::Event::Ptr BirthdaysResource::createBirthday(const KContacts::Add
const QString name = contact.realName().isEmpty() ? contact.nickName() : contact.realName();
if (name.isEmpty()) {
qCDebug(BIRTHDAYS_LOG) << "contact " << contact.uid() << itemId << " has no name, skipping.";
return KCalendarCore::Event::Ptr();
return {};
}
const QDate birthdate = contact.birthday().date();
......@@ -321,7 +319,7 @@ KCalendarCore::Event::Ptr BirthdaysResource::createBirthday(const KContacts::Add
checkForUnknownCategories(i18n("Birthday"), ev);
return ev;
}
return KCalendarCore::Event::Ptr();
return {};
}
KCalendarCore::Event::Ptr BirthdaysResource::createAnniversary(const KContacts::Addressee &contact, Akonadi::Item::Id itemId)
......@@ -329,12 +327,12 @@ KCalendarCore::Event::Ptr BirthdaysResource::createAnniversary(const KContacts::
const QString name = contact.realName().isEmpty() ? contact.nickName() : contact.realName();
if (name.isEmpty()) {
qCDebug(BIRTHDAYS_LOG) << "contact " << contact.uid() << itemId << " has no name, skipping.";
return KCalendarCore::Event::Ptr();
return {};
}
const QString anniversary_string = contact.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("X-Anniversary"));
if (anniversary_string.isEmpty()) {
return KCalendarCore::Event::Ptr();
return {};
}
const QDate anniversary = QDate::fromString(anniversary_string, Qt::ISODate);
if (anniversary.isValid()) {
......@@ -373,7 +371,7 @@ KCalendarCore::Event::Ptr BirthdaysResource::createAnniversary(const KContacts::
checkForUnknownCategories(i18n("Anniversary"), event);
return event;
}
return KCalendarCore::Event::Ptr();
return {};
}
KCalendarCore::Event::Ptr BirthdaysResource::createEvent(QDate date)
......
......@@ -499,7 +499,7 @@ QString ContactsResource::directoryForCollection(const Collection &collection) c
{
if (collection.remoteId().isEmpty()) {
qCWarning(CONTACTSRESOURCES_LOG) << "Got incomplete ancestor chain:" << collection;
return QString();
return {};
}
if (collection.parentCollection() == Collection::root()) {
......@@ -511,7 +511,7 @@ QString ContactsResource::directoryForCollection(const Collection &collection) c
const QString parentDirectory = directoryForCollection(collection.parentCollection());
if (parentDirectory.isNull()) { // invalid, != isEmpty() here!
return QString();
return {};
}
QString directory = parentDirectory;
......
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