[pim/trojita] src/Imap: Move TaskPresentationModel nonslots to public

Espen Sandøy Hustad <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit eab115f3da034a222692329b29616ac36806b49a by Espen Sandøy Hustad.
Committed on 03/08/2026 at 19:00.
Pushed by ehustad into branch 'master'.

Move TaskPresentationModel nonslots to public

And rename them to reflect that they are no
longer slots. Nothing connects to them, so
there is no need for them to be slots in the first
place.

Fix a bunch of Clazy warning: slot arguments need
to be fully-qualified [-Wclazy-fully-qualified-moc-types].

M  +2    -2    src/Imap/Model/Model.cpp
M  +1    -1    src/Imap/Model/TaskFactory.cpp
M  +5    -5    src/Imap/Model/TaskPresentationModel.cpp
M  +5    -6    src/Imap/Model/TaskPresentationModel.h
M  +3    -3    src/Imap/Tasks/ImapTask.cpp
M  +2    -2    src/Imap/Tasks/KeepMailboxOpenTask.cpp
M  +2    -2    src/Imap/Tasks/OfflineConnectionTask.cpp
M  +1    -1    src/Imap/Tasks/OpenConnectionTask.cpp
M  +3    -3    src/Imap/Tasks/SortTask.cpp

https://invent.kde.org/pim/trojita/-/commit/eab115f3da034a222692329b29616ac36806b49a

diff --git a/src/Imap/Model/Model.cpp b/src/Imap/Model/Model.cpp
index 2da7699d9..58f40fa93 100644
--- a/src/Imap/Model/Model.cpp
+++ b/src/Imap/Model/Model.cpp
@@ -1555,7 +1555,7 @@ void Model::removeDeletedTasks(const QList<ImapTask *> &deletedTasks, QList<Imap
         (*deletedIt)->deleteLater();
         activeTasks.removeOne(*deletedIt);
         // It isn't destroyed yet, but should be removed from the model nonetheless
-        m_taskModel->slotSomeTaskDestroyed();
+        m_taskModel->taskDestroyed();
     }
 }
 
@@ -1670,7 +1670,7 @@ void Model::slotTaskDying(QObject *obj)
     std::for_each(m_parsers.begin(), m_parsers.end(), [obj](ParserState &state) {
         state.activeTasks.removeOne(reinterpret_cast<ImapTask*>(obj));
     });
-    m_taskModel->slotSomeTaskDestroyed();
+    m_taskModel->taskDestroyed();
 }
 
 TreeItemMailbox *Model::mailboxForSomeItem(QModelIndex index)
diff --git a/src/Imap/Model/TaskFactory.cpp b/src/Imap/Model/TaskFactory.cpp
index f465f776f..74ee9fdd8 100644
--- a/src/Imap/Model/TaskFactory.cpp
+++ b/src/Imap/Model/TaskFactory.cpp
@@ -222,7 +222,7 @@ Parser *TestingTaskFactory::newParser(Model *model)
     QObject::connect(parser, &Parser::lineReceived, model, &Model::slotParserLineReceived);
     QObject::connect(parser, &Parser::lineSent, model, &Model::slotParserLineSent);
     model->m_parsers[ parser ] = parserState;
-    model->m_taskModel->slotParserCreated(parser);
+    model->m_taskModel->parserCreated(parser);
     return parser;
 }
 
diff --git a/src/Imap/Model/TaskPresentationModel.cpp b/src/Imap/Model/TaskPresentationModel.cpp
index 5f9ff93fe..ad04ed774 100644
--- a/src/Imap/Model/TaskPresentationModel.cpp
+++ b/src/Imap/Model/TaskPresentationModel.cpp
@@ -216,7 +216,7 @@ QVariant TaskPresentationModel::data(const QModelIndex &index, int role) const
 The ImapTask might be in various stages of destruction at this point, so it is not advisable to access its contents from
 this function.
 */
-void TaskPresentationModel::slotSomeTaskDestroyed()
+void TaskPresentationModel::taskDestroyed()
 {
     CHECK_TASK_TREE
     beginResetModel();
@@ -228,7 +228,7 @@ void TaskPresentationModel::slotSomeTaskDestroyed()
 
 We don't bother with proper fine-grained signals here.
 */
-void TaskPresentationModel::slotParserCreated(Parser *parser)
+void TaskPresentationModel::parserCreated(Parser *parser)
 {
     Q_UNUSED(parser);
     CHECK_TASK_TREE
@@ -241,7 +241,7 @@ void TaskPresentationModel::slotParserCreated(Parser *parser)
 
 We don't bother with proper fine-grained signals here.
 */
-void TaskPresentationModel::slotParserDeleted(Parser *parser)
+void TaskPresentationModel::parserDeleted(Parser *parser)
 {
     Q_UNUSED(parser);
     CHECK_TASK_TREE
@@ -254,7 +254,7 @@ void TaskPresentationModel::slotParserDeleted(Parser *parser)
 
 The task might or might not have been present in the model before.  We don't know.
 */
-void TaskPresentationModel::slotTaskGotReparented(const ImapTask *const task)
+void TaskPresentationModel::taskGotReparented(const ImapTask *const task)
 {
     Q_UNUSED(task);
     CHECK_TASK_TREE
@@ -264,7 +264,7 @@ void TaskPresentationModel::slotTaskGotReparented(const ImapTask *const task)
 }
 
 /** @short The textual description, the state or something else related to this task might have changed */
-void TaskPresentationModel::slotTaskMighHaveChanged(ImapTask *task)
+void TaskPresentationModel::taskMighHaveChanged(ImapTask *task)
 {
     CHECK_TASK_TREE
     if (task->isFinished()) {
diff --git a/src/Imap/Model/TaskPresentationModel.h b/src/Imap/Model/TaskPresentationModel.h
index 389ecf207..2f74133b9 100644
--- a/src/Imap/Model/TaskPresentationModel.h
+++ b/src/Imap/Model/TaskPresentationModel.h
@@ -57,13 +57,12 @@ public:
     int columnCount(const QModelIndex &parent) const override;
     QVariant data(const QModelIndex &index, int role) const override;
 
-public slots:
-    void slotSomeTaskDestroyed();
-    void slotTaskGotReparented(const Imap::Mailbox::ImapTask *const task);
-    void slotTaskMighHaveChanged(Imap::Mailbox::ImapTask *task);
+    void taskDestroyed();
+    void taskGotReparented(const Imap::Mailbox::ImapTask *const task);
+    void taskMighHaveChanged(Imap::Mailbox::ImapTask *task);
 
-    void slotParserCreated(Imap::Parser *parser);
-    void slotParserDeleted(Imap::Parser *parser);
+    void parserCreated(Imap::Parser *parser);
+    void parserDeleted(Imap::Parser *parser);
 
 private:
     Model *m_model;
diff --git a/src/Imap/Tasks/ImapTask.cpp b/src/Imap/Tasks/ImapTask.cpp
index bedd692da..1c5906d9e 100644
--- a/src/Imap/Tasks/ImapTask.cpp
+++ b/src/Imap/Tasks/ImapTask.cpp
@@ -64,7 +64,7 @@ void ImapTask::updateParentTask(ImapTask *newParent)
     Q_ASSERT(newParent);
     parentTask = newParent;
     CHECK_TASK_TREE
-    model->m_taskModel->slotTaskGotReparented(this);
+    model->m_taskModel->taskGotReparented(this);
     if (parser) {
         Q_ASSERT(!model->accessParser(parser).activeTasks.contains(this));
         //log(tr("Reparented to %1").arg(newParent->debugIdentification()));
@@ -90,7 +90,7 @@ void ImapTask::markAsActiveTask(const TaskActivatingPosition place)
     }
     // As we're an active task, we no longer have a parent task
     parentTask = nullptr;
-    model->m_taskModel->slotTaskGotReparented(this);
+    model->m_taskModel->taskGotReparented(this);
 
     if (model->accessParser(parser).maintainingTask && model->accessParser(parser).maintainingTask != this) {
         // Got to inform the currently responsible maintaining task about our demise
@@ -306,7 +306,7 @@ void ImapTask::log(const QString &message, const Common::LogKind kind)
         dbg.prepend(QLatin1Char(' '));
     }
     model->logTrace(parser ? parser->parserId() : 0, kind, QString::fromUtf8(metaObject()->className()) + dbg, message);
-    model->m_taskModel->slotTaskMighHaveChanged(this);
+    model->m_taskModel->taskMighHaveChanged(this);
 }
 
 }
diff --git a/src/Imap/Tasks/KeepMailboxOpenTask.cpp b/src/Imap/Tasks/KeepMailboxOpenTask.cpp
index eabea5a5b..e00aff6b8 100644
--- a/src/Imap/Tasks/KeepMailboxOpenTask.cpp
+++ b/src/Imap/Tasks/KeepMailboxOpenTask.cpp
@@ -472,7 +472,7 @@ bool KeepMailboxOpenTask::handleNumberResponse(const Imap::Responses::NumberResp
                                                 // but prevent a possible invalid 0:*
                                                 qMax(mailbox->syncState.uidNext(), 1u)
                                             ), QList<QByteArray>() << "FLAGS"));
-        model->m_taskModel->slotTaskMighHaveChanged(this);
+        model->m_taskModel->taskMighHaveChanged(this);
         return true;
     } else if (resp->kind == Imap::Responses::RECENT) {
         mailbox->syncState.setRecent(resp->number);
@@ -600,7 +600,7 @@ bool KeepMailboxOpenTask::handleStateHelper(const Imap::Responses::State *const
         }
         // Don't forget to resume IDLE, if desired; that's easiest by simply behaving as if a "task" has just finished
         slotTaskDeleted(nullptr);
-        model->m_taskModel->slotTaskMighHaveChanged(this);
+        model->m_taskModel->taskMighHaveChanged(this);
         return true;
     } else if (resp->tag == tagClose) {
         tagClose.clear();
diff --git a/src/Imap/Tasks/OfflineConnectionTask.cpp b/src/Imap/Tasks/OfflineConnectionTask.cpp
index 1966cb426..8918265f2 100644
--- a/src/Imap/Tasks/OfflineConnectionTask.cpp
+++ b/src/Imap/Tasks/OfflineConnectionTask.cpp
@@ -38,7 +38,7 @@ OfflineConnectionTask::OfflineConnectionTask(Model *model) : ImapTask(model)
     ParserState parserState(parser);
     parserState.connState = CONN_STATE_LOGOUT;
     model->m_parsers[parser] = parserState;
-    model->m_taskModel->slotParserCreated(parser);
+    model->m_taskModel->parserCreated(parser);
     markAsActiveTask();
     QTimer::singleShot(0, this, SLOT(slotPerform()));
 }
@@ -63,7 +63,7 @@ void OfflineConnectionTask::slotDie()
     deleteLater();
     model->killParser(parser, Model::PARSER_KILL_EXPECTED);
     model->m_parsers.remove(parser);
-    model->m_taskModel->slotParserDeleted(parser);
+    model->m_taskModel->parserDeleted(parser);
 }
 
 /** @short This is an internal task */
diff --git a/src/Imap/Tasks/OpenConnectionTask.cpp b/src/Imap/Tasks/OpenConnectionTask.cpp
index de676ee97..c9afb6ddb 100644
--- a/src/Imap/Tasks/OpenConnectionTask.cpp
+++ b/src/Imap/Tasks/OpenConnectionTask.cpp
@@ -48,7 +48,7 @@ OpenConnectionTask::OpenConnectionTask(Model *model) :
     connect(parser, &Parser::lineReceived, model, &Model::slotParserLineReceived);
     connect(parser, &Parser::lineSent, model, &Model::slotParserLineSent);
     model->m_parsers[ parser ] = parserState;
-    model->m_taskModel->slotParserCreated(parser);
+    model->m_taskModel->parserCreated(parser);
     markAsActiveTask();
 }
 
diff --git a/src/Imap/Tasks/SortTask.cpp b/src/Imap/Tasks/SortTask.cpp
index 47f46d2e9..66ee3b250 100644
--- a/src/Imap/Tasks/SortTask.cpp
+++ b/src/Imap/Tasks/SortTask.cpp
@@ -113,7 +113,7 @@ bool SortTask::handleStateHelper(const Imap::Responses::State *const resp)
             Q_ASSERT(untaggedTag);
             if (untaggedTag->data.toUtf8() == sortTag) {
                 m_persistentSearch = false;
-                model->m_taskModel->slotTaskMighHaveChanged(this);
+                model->m_taskModel->taskMighHaveChanged(this);
 
                 if (m_firstCommandCompleted) {
                     // The server decided that it will no longer inform us about the updated SORT order, and the original
@@ -138,7 +138,7 @@ bool SortTask::handleStateHelper(const Imap::Responses::State *const resp)
                 _completed();
             } else {
                 // got to prod the TaskPresentationModel
-                model->m_taskModel->slotTaskMighHaveChanged(this);
+                model->m_taskModel->taskMighHaveChanged(this);
 
                 // Even though we aren't "finished" at this point, the KeepMailboxOpenTask is now free to issue its IDLE thing,
                 // as that won't interfere with our mode of operation. Let's kick it around.
@@ -152,7 +152,7 @@ bool SortTask::handleStateHelper(const Imap::Responses::State *const resp)
         return true;
     } else if (resp->tag == cancelUpdateTag) {
         m_persistentSearch = false;
-        model->m_taskModel->slotTaskMighHaveChanged(this);
+        model->m_taskModel->taskMighHaveChanged(this);
         _completed();
         return true;
     } else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.