Skip to content

Commit

Permalink
[mkcal] Don't make ExtendedStorageObserver methods pure virtual
Browse files Browse the repository at this point in the history
Provides default implementations that does nothing,
so clients can only implement desired signals.
  • Loading branch information
dcaliste committed Mar 14, 2022
1 parent 56fd4b6 commit d81500e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
13 changes: 0 additions & 13 deletions src/extendedcalendar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,19 +1392,6 @@ void ExtendedCalendar::storageModified(ExtendedStorage *storage, const QString &
close();
}

void ExtendedCalendar::storageProgress(ExtendedStorage *storage, const QString &info)
{
Q_UNUSED(storage);
Q_UNUSED(info);
}

void ExtendedCalendar::storageFinished(ExtendedStorage *storage, bool error, const QString &info)
{
Q_UNUSED(storage);
Q_UNUSED(error);
Q_UNUSED(info);
}

int ExtendedCalendar::eventCount(const QString &notebookUid)
{
Event::List events = rawEvents();
Expand Down
3 changes: 0 additions & 3 deletions src/extendedcalendar.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,6 @@ class MKCAL_EXPORT ExtendedCalendar : public KCalendarCore::MemoryCalendar,
contents on the storage change.
*/
virtual void storageModified(ExtendedStorage *storage, const QString &info);
virtual void storageProgress(ExtendedStorage *storage, const QString &info);
virtual void storageFinished(ExtendedStorage *storage, bool error, const QString &info);


private:
//@cond PRIVATE
Expand Down
15 changes: 7 additions & 8 deletions src/extendedstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@author Cornelius Schumacher \<schumacher@kde.org\>
*/
#include "extendedstorage.h"
#include "extendedstorageobserver.h"
#include "logging_p.h"

#include <KCalendarCore/Exceptions>
Expand Down Expand Up @@ -294,29 +295,27 @@ void ExtendedStorage::setIsInvitationIncidencesLoaded(bool loaded)
d->mIsInvitationIncidencesLoaded = loaded;
}

#if 0
void ExtendedStorage::ExtendedStorageObserver::storageModified(ExtendedStorage *storage,
const QString &info)
void ExtendedStorageObserver::storageModified(ExtendedStorage *storage,
const QString &info)
{
Q_UNUSED(storage);
Q_UNUSED(info);
}

void ExtendedStorage::ExtendedStorageObserver::storageProgress(ExtendedStorage *storage,
const QString &info)
void ExtendedStorageObserver::storageProgress(ExtendedStorage *storage,
const QString &info)
{
Q_UNUSED(storage);
Q_UNUSED(info);
}

void ExtendedStorage::ExtendedStorageObserver::storageFinished(ExtendedStorage *storage,
bool error, const QString &info)
void ExtendedStorageObserver::storageFinished(ExtendedStorage *storage,
bool error, const QString &info)
{
Q_UNUSED(storage);
Q_UNUSED(error);
Q_UNUSED(info);
}
#endif

void ExtendedStorage::registerObserver(ExtendedStorageObserver *observer)
{
Expand Down
6 changes: 3 additions & 3 deletions src/extendedstorageobserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MKCAL_EXPORT ExtendedStorageObserver //krazy:exclude=dpointer
is being observed.
@param info uids inserted/updated/deleted, modified file etc.
*/
virtual void storageModified(ExtendedStorage *storage, const QString &info) = 0;
virtual void storageModified(ExtendedStorage *storage, const QString &info);

/**
Notify the Observer that a Storage is executing an action.
Expand All @@ -68,7 +68,7 @@ class MKCAL_EXPORT ExtendedStorageObserver //krazy:exclude=dpointer
is being observed.
@param info textual information
*/
virtual void storageProgress(ExtendedStorage *storage, const QString &info) = 0;
virtual void storageProgress(ExtendedStorage *storage, const QString &info);

/**
Notify the Observer that a Storage has finished an action.
Expand All @@ -78,7 +78,7 @@ class MKCAL_EXPORT ExtendedStorageObserver //krazy:exclude=dpointer
@param error true if action was unsuccessful; false otherwise
@param info textual information
*/
virtual void storageFinished(ExtendedStorage *storage, bool error, const QString &info) = 0;
virtual void storageFinished(ExtendedStorage *storage, bool error, const QString &info);
};

};
Expand Down

0 comments on commit d81500e

Please sign in to comment.