feat(MainDb): add const qualifier on some parameters

This commit is contained in:
Ronan Abhamon 2017-12-04 10:10:10 +01:00
parent 144790b41f
commit 4f40f34a16
4 changed files with 7 additions and 7 deletions

View file

@ -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;
}

View file

@ -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);

View file

@ -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);
}

View file

@ -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);