From 35cd90c51f7325c7e95ec1b1fe75469a3c22f0bd Mon Sep 17 00:00:00 2001 From: Sergei Ilinykh Date: Wed, 11 Sep 2024 23:41:50 +0300 Subject: [PATCH] compilation fixes --- src/xmpp/xmpp-im/xmpp_mammanager.cpp | 36 ++++++++++++++-------------- src/xmpp/xmpp-im/xmpp_mammanager.h | 18 +++++++------- src/xmpp/xmpp-im/xmpp_mamtask.h | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/xmpp/xmpp-im/xmpp_mammanager.cpp b/src/xmpp/xmpp-im/xmpp_mammanager.cpp index 04c228fd..a0e686ee 100644 --- a/src/xmpp/xmpp-im/xmpp_mammanager.cpp +++ b/src/xmpp/xmpp-im/xmpp_mammanager.cpp @@ -44,45 +44,45 @@ MAMManager::MAMManager(Client *client, int mamPageSize, int mamMaxMessages, bool MAMManager::~MAMManager() { delete d; } // TODO: review the safety of these methods/object lifetimes -MAMTask MAMManager::getFullArchive(const Jid &j, const bool allowMUCArchives) +MAMTask *MAMManager::getFullArchive(const Jid &j, const bool allowMUCArchives) { - MAMTask task = new MAMTask(d->client->rootTask()); + auto task = new MAMTask(d->client->rootTask()); - task.get(j, QString(), QString(), allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards); + task->get(j, QString(), QString(), allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards); return task; } -MAMTask MAMManager::getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID, - const bool allowMUCArchives) +MAMTask *MAMManager::getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID, + const bool allowMUCArchives) { - MAMTask task = new MAMTask(d->client->rootTask()); + auto task = new MAMTask(d->client->rootTask()); - task.get(j, fromID, toID, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards); + task->get(j, fromID, toID, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards); return task; } -MAMTask MAMManager::getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to, - const bool allowMUCArchives) +MAMTask *MAMManager::getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to, + const bool allowMUCArchives) { - MAMTask task = new MAMTask(d->client->rootTask()); + auto task = new MAMTask(d->client->rootTask()); - task.get(j, from, to, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards); + task->get(j, from, to, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards); return task; } -MAMTask MAMManager::getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives, - int amount) +MAMTask *MAMManager::getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives, + int amount) { - MAMTask task = new MAMTask(d->client->rootTask()); + auto task = new MAMTask(d->client->rootTask()); - task.get(j, fromID, QString(), allowMUCArchives, d->mamPageSize, amount, true, true); + task->get(j, fromID, QString(), allowMUCArchives, d->mamPageSize, amount, true, true); return task; } -MAMTask MAMManager::getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives, int amount) +MAMTask *MAMManager::getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives, int amount) { - MAMTask task = new MAMTask(d->client->rootTask()); + auto task = new MAMTask(d->client->rootTask()); - task.get(j, QString(), toID, allowMUCArchives, d->mamPageSize, amount, true, true); + task->get(j, QString(), toID, allowMUCArchives, d->mamPageSize, amount, true, true); return task; } diff --git a/src/xmpp/xmpp-im/xmpp_mammanager.h b/src/xmpp/xmpp-im/xmpp_mammanager.h index bf80adae..9c87e660 100644 --- a/src/xmpp/xmpp-im/xmpp_mammanager.h +++ b/src/xmpp/xmpp-im/xmpp_mammanager.h @@ -34,15 +34,15 @@ class MAMManager : public QObject { bool backwards = true); ~MAMManager(); - MAMTask getFullArchive(const Jid &j, const bool allowMUCArchives = true); - MAMTask getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID, - const bool allowMUCArchives = true); - MAMTask getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to, - const bool allowMUCArchives = true); - MAMTask getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives = true, - int amount = 100); - MAMTask getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives = true, - int amount = 100); + MAMTask *getFullArchive(const Jid &j, const bool allowMUCArchives = true); + MAMTask *getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID, + const bool allowMUCArchives = true); + MAMTask *getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to, + const bool allowMUCArchives = true); + MAMTask *getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives = true, + int amount = 100); + MAMTask *getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives = true, + int amount = 100); private: class Private; diff --git a/src/xmpp/xmpp-im/xmpp_mamtask.h b/src/xmpp/xmpp-im/xmpp_mamtask.h index d163e50f..63e8535a 100644 --- a/src/xmpp/xmpp-im/xmpp_mamtask.h +++ b/src/xmpp/xmpp-im/xmpp_mamtask.h @@ -39,7 +39,7 @@ class Jid; class MAMTask : public Task { Q_OBJECT public: - MAMTask(Task *); + explicit MAMTask(Task *); MAMTask(const MAMTask &x); ~MAMTask();