Verified Commit 701578c0 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix regressions from the clazy cleanup commits

parent d74bbfbc
Pipeline #22671 passed with stage
in 33 minutes and 17 seconds
......@@ -432,7 +432,7 @@ void AgentBasePrivate::init()
QStringLiteral("org.kde.Solid.PowerManagement.Actions.SuspendSession"),
QDBusConnection::sessionBus(), this);
if (mPowerInterface->isValid()) {
connect(mPowerInterface, SIGNAL(resumingFromSuspend()), SLOT(slotResumedFromSuspend())); // clazy:exclude=old-style-connect
connect(mPowerInterface, SIGNAL(resumingFromSuspend()), this, SLOT(slotResumedFromSuspend())); // clazy:exclude=old-style-connect
} else {
delete mPowerInterface;
mPowerInterface = nullptr;
......
......@@ -47,6 +47,7 @@ public:
void init();
virtual void delayedInit();
public Q_SLOTS:
void slotStatus(int status, const QString &message);
void slotPercent(int progress);
void slotWarning(const QString &message);
......@@ -82,6 +83,7 @@ public:
void setProgramName();
public:
AgentBase *q_ptr;
Q_DECLARE_PUBLIC(AgentBase)
......
......@@ -42,16 +42,19 @@ class Akonadi::CollectionFetchJobPrivate : public JobPrivate
public:
CollectionFetchJobPrivate(CollectionFetchJob *parent)
: JobPrivate(parent)
, mType(CollectionFetchJob::Base)
{
mEmitTimer.setSingleShot(true);
mEmitTimer.setInterval(std::chrono::milliseconds{100});
q_ptr->connect(&mEmitTimer, &QTimer::timeout, q_ptr, [this]() { timeout(); });
}
void init()
{
QObject::connect(&mEmitTimer, &QTimer::timeout, q_ptr, [this]() { timeout(); });
}
Q_DECLARE_PUBLIC(CollectionFetchJob)
CollectionFetchJob::Type mType;
CollectionFetchJob::Type mType = CollectionFetchJob::Base;
Collection mBase;
Collection::List mBaseList;
Collection::List mCollections;
......@@ -124,6 +127,7 @@ CollectionFetchJob::CollectionFetchJob(const Collection &collection, Type type,
: Job(new CollectionFetchJobPrivate(this), parent)
{
Q_D(CollectionFetchJob);
d->init();
d->mBase = collection;
d->mType = type;
......@@ -133,6 +137,7 @@ CollectionFetchJob::CollectionFetchJob(const Collection::List &cols, QObject *pa
: Job(new CollectionFetchJobPrivate(this), parent)
{
Q_D(CollectionFetchJob);
d->init();
Q_ASSERT(!cols.isEmpty());
if (cols.size() == 1) {
......@@ -147,6 +152,7 @@ CollectionFetchJob::CollectionFetchJob(const Collection::List &cols, Type type,
: Job(new CollectionFetchJobPrivate(this), parent)
{
Q_D(CollectionFetchJob);
d->init();
Q_ASSERT(!cols.isEmpty());
if (cols.size() == 1) {
......@@ -161,6 +167,7 @@ CollectionFetchJob::CollectionFetchJob(const QList<Collection::Id> &cols, Type t
: Job(new CollectionFetchJobPrivate(this), parent)
{
Q_D(CollectionFetchJob);
d->init();
Q_ASSERT(!cols.isEmpty());
if (cols.size() == 1) {
......@@ -173,9 +180,7 @@ CollectionFetchJob::CollectionFetchJob(const QList<Collection::Id> &cols, Type t
d->mType = type;
}
CollectionFetchJob::~CollectionFetchJob()
{
}
CollectionFetchJob::~CollectionFetchJob() = default;
Akonadi::Collection::List CollectionFetchJob::collections() const
{
......
......@@ -43,7 +43,6 @@ public:
mCollection = Collection::root();
mEmitTimer.setSingleShot(true);
mEmitTimer.setInterval(std::chrono::milliseconds{100});
QObject::connect(&mEmitTimer, &QTimer::timeout, q_ptr, [this]() { timeout(); });
}
~ItemFetchJobPrivate() override
......@@ -51,6 +50,10 @@ public:
delete mValuePool;
}
void init()
{
QObject::connect(&mEmitTimer, &QTimer::timeout, q_ptr, [this]() { timeout(); });
}
void aboutToFinish() override {
timeout();
}
......@@ -119,6 +122,7 @@ ItemFetchJob::ItemFetchJob(const Collection &collection, QObject *parent)
: Job(new ItemFetchJobPrivate(this), parent)
{
Q_D(ItemFetchJob);
d->init();
d->mCollection = collection;
d->mValuePool = new ProtocolHelperValuePool; // only worth it for lots of results
......@@ -128,6 +132,7 @@ ItemFetchJob::ItemFetchJob(const Item &item, QObject *parent)
: Job(new ItemFetchJobPrivate(this), parent)
{
Q_D(ItemFetchJob);
d->init();
d->mRequestedItems.append(item);
}
......@@ -136,6 +141,7 @@ ItemFetchJob::ItemFetchJob(const Item::List &items, QObject *parent)
: Job(new ItemFetchJobPrivate(this), parent)
{
Q_D(ItemFetchJob);
d->init();
d->mRequestedItems = items;
}
......@@ -144,6 +150,7 @@ ItemFetchJob::ItemFetchJob(const QList<Item::Id> &items, QObject *parent)
: Job(new ItemFetchJobPrivate(this), parent)
{
Q_D(ItemFetchJob);
d->init();
d->mRequestedItems.reserve(items.size());
for (auto id : items) {
......@@ -155,6 +162,7 @@ ItemFetchJob::ItemFetchJob(const QVector<Item::Id> &items, QObject *parent)
: Job(new ItemFetchJobPrivate(this), parent)
{
Q_D(ItemFetchJob);
d->init();
d->mRequestedItems.reserve(items.size());
for (auto id : items) {
......@@ -166,14 +174,13 @@ ItemFetchJob::ItemFetchJob(const Tag &tag, QObject *parent)
: Job(new ItemFetchJobPrivate(this), parent)
{
Q_D(ItemFetchJob);
d->init();
d->mCurrentTag = tag;
d->mValuePool = new ProtocolHelperValuePool;
}
ItemFetchJob::~ItemFetchJob()
{
}
ItemFetchJob::~ItemFetchJob() = default;
void ItemFetchJob::doStart()
{
......
......@@ -42,6 +42,10 @@ public:
{
mEmitTimer.setSingleShot(true);
mEmitTimer.setInterval(std::chrono::milliseconds{100});
}
void init()
{
QObject::connect(&mEmitTimer, &QTimer::timeout, q_ptr, [this]() { timeout(); });
}
......@@ -122,11 +126,17 @@ static QObject *sessionForJob(QObject *parent)
ItemSearchJob::ItemSearchJob(QObject *parent)
: Job(new ItemSearchJobPrivate(this, SearchQuery()), sessionForJob(parent))
{}
{
Q_D(ItemSearchJob);
d->init();
}
ItemSearchJob::ItemSearchJob(const SearchQuery &query, QObject *parent)
: Job(new ItemSearchJobPrivate(this, query), sessionForJob(parent))
{}
{
Q_D(ItemSearchJob);
d->init();
}
ItemSearchJob::~ItemSearchJob() = default;
......
......@@ -35,6 +35,10 @@ public:
{
mEmitTimer.setSingleShot(true);
mEmitTimer.setInterval(std::chrono::milliseconds{100});
}
void init()
{
QObject::connect(&mEmitTimer, &QTimer::timeout, q_ptr, [this]() { timeout(); });
}
......@@ -68,6 +72,7 @@ RelationFetchJob::RelationFetchJob(const Relation &relation, QObject *parent)
: Job(new RelationFetchJobPrivate(this), parent)
{
Q_D(RelationFetchJob);
d->init();
d->mRequestedRelation = relation;
}
......@@ -75,6 +80,7 @@ RelationFetchJob::RelationFetchJob(const QVector<QByteArray> &types, QObject *pa
: Job(new RelationFetchJobPrivate(this), parent)
{
Q_D(RelationFetchJob);
d->init();
d->mTypes = types;
}
......
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