Commit 4f40f34a authored by Ronan's avatar Ronan

feat(MainDb): add const qualifier on some parameters

parent 144790b4
......@@ -1269,8 +1269,8 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return false;
}
bool MainDb::deleteEvent (const shared_ptr<EventLog> &eventLog) {
EventLogPrivate *dEventLog = eventLog->getPrivate();
bool MainDb::deleteEvent (const shared_ptr<const EventLog> &eventLog) {
const EventLogPrivate *dEventLog = eventLog->getPrivate();
if (!dEventLog->dbKey.isValid()) {
lWarning() << "Unable to delete invalid event.";
return false;
......@@ -1294,7 +1294,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
dEventLog->dbKey = MainDbEventKey();
if (eventLog->getType() == EventLog::Type::ConferenceChatMessage)
static_pointer_cast<ConferenceChatMessageEvent>(
static_pointer_cast<const ConferenceChatMessageEvent>(
eventLog
)->getChatMessage()->getPrivate()->dbKey = MainDbChatMessageKey();
......@@ -2144,7 +2144,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return false;
}
bool MainDb::deleteEvent (const shared_ptr<EventLog> &) {
bool MainDb::deleteEvent (const shared_ptr<const EventLog> &) {
return false;
}
......
......@@ -59,7 +59,7 @@ public:
bool addEvent (const std::shared_ptr<EventLog> &eventLog);
bool updateEvent (const std::shared_ptr<EventLog> &eventLog);
static bool deleteEvent (const std::shared_ptr<EventLog> &eventLog);
static bool deleteEvent (const std::shared_ptr<const EventLog> &eventLog);
int getEventsCount (FilterMask mask = NoFilter) const;
static std::shared_ptr<EventLog> getEventFromKey (const MainDbKey &dbKey);
......
......@@ -44,7 +44,7 @@ time_t EventLog::getCreationTime () const {
return d->creationTime;
}
void EventLog::deleteFromDatabase (const shared_ptr<EventLog> &eventLog) {
void EventLog::deleteFromDatabase (const shared_ptr<const EventLog> &eventLog) {
MainDb::deleteEvent(eventLog);
}
......
......@@ -46,7 +46,7 @@ public:
Type getType () const;
time_t getCreationTime () const;
static void deleteFromDatabase (const std::shared_ptr<EventLog> &eventLog);
static void deleteFromDatabase (const std::shared_ptr<const EventLog> &eventLog);
protected:
EventLog (EventLogPrivate &p, Type type, time_t creationTime);
......
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