Move pollhandler to ContentProvider
Move `PollHandler` to `ContentProvider`, this also breaks the dependency on `PollHandler` for `NeoChatRoom`
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "models/messagecontentmodel.h"
|
||||
#include "models/threadmodel.h"
|
||||
#include "neochatroom.h"
|
||||
#include "pollhandler.h"
|
||||
|
||||
/**
|
||||
* @class ContentProvider
|
||||
@@ -70,9 +71,20 @@ public:
|
||||
*/
|
||||
ThreadModel *modelForThread(NeoChatRoom *room, const QString &threadRootId);
|
||||
|
||||
/**
|
||||
* @brief Get a PollHandler object for the given event Id.
|
||||
*
|
||||
* Will return an existing PollHandler if one already exists for the event ID.
|
||||
* A new PollHandler will be created if one doesn't exist.
|
||||
*
|
||||
* @sa PollHandler
|
||||
*/
|
||||
PollHandler *handlerForPoll(NeoChatRoom *room, const QString &eventId);
|
||||
|
||||
private:
|
||||
explicit ContentProvider(QObject *parent = nullptr);
|
||||
|
||||
QCache<QString, MessageContentModel> m_eventContentModels;
|
||||
QCache<QString, ThreadModel> m_threadModels;
|
||||
QCache<QString, PollHandler> m_pollHandlers;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user