From cf8c6dfe32580d2d93cb67f496f50fa14c572f5c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 31 Jan 2016 11:21:48 +0100 Subject: Enabled and fixed a bunch of warnings --- common/domain/applicationdomaintype.cpp | 30 ++++++++++++++++++++++++++++++ common/domain/applicationdomaintype.h | 7 +++++++ common/genericresource.cpp | 1 - common/log.cpp | 14 ++++++++++---- common/propertymapper.h | 4 ++++ common/resourceaccess.cpp | 3 +++ common/resultprovider.h | 13 ++++++++----- common/storage_lmdb.cpp | 2 +- 8 files changed, 63 insertions(+), 11 deletions(-) (limited to 'common') diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index b0433be..fccf082 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp @@ -100,6 +100,36 @@ QByteArray ApplicationDomainType::identifier() const return mIdentifier; } +Entity::~Entity() +{ + +} + +Event::~Event() +{ + +} + +Todo::~Todo() +{ + +} + +Mail::~Mail() +{ + +} + +Folder::~Folder() +{ + +} + +SinkResource::~SinkResource() +{ + +} + template<> QByteArray getTypeName() { diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 63f030c..88f094a 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -85,31 +85,37 @@ inline bool operator==(const ApplicationDomainType& lhs, const ApplicationDomain struct Entity : public ApplicationDomainType { typedef QSharedPointer Ptr; using ApplicationDomainType::ApplicationDomainType; + virtual ~Entity(); }; struct Event : public Entity { typedef QSharedPointer Ptr; using Entity::Entity; + virtual ~Event(); }; struct Todo : public Entity { typedef QSharedPointer Ptr; using Entity::Entity; + virtual ~Todo(); }; struct Calendar : public Entity { typedef QSharedPointer Ptr; using Entity::Entity; + virtual ~Calendar(); }; struct Mail : public Entity { typedef QSharedPointer Ptr; using Entity::Entity; + virtual ~Mail(); }; struct Folder : public Entity { typedef QSharedPointer Ptr; using Entity::Entity; + virtual ~Folder(); }; /** @@ -121,6 +127,7 @@ struct Folder : public Entity { struct SinkResource : public ApplicationDomainType { typedef QSharedPointer Ptr; using ApplicationDomainType::ApplicationDomainType; + virtual ~SinkResource(); }; /** diff --git a/common/genericresource.cpp b/common/genericresource.cpp index c7326d3..758ea0d 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp @@ -197,7 +197,6 @@ private slots: default: return KAsync::error(-1, "Unhandled command"); } - return KAsync::null(); } KAsync::Job processQueuedCommand(const QByteArray &data) diff --git a/common/log.cpp b/common/log.cpp index 45bbec1..316031d 100644 --- a/common/log.cpp +++ b/common/log.cpp @@ -17,7 +17,7 @@ public: { open(WriteOnly); } - virtual ~DebugStream(){}; + virtual ~DebugStream(); bool isSequential() const { return true; } qint64 readData(char *, qint64) { return 0; /* eof */ } @@ -35,6 +35,10 @@ private: Q_DISABLE_COPY(DebugStream) }; +//Virtual method anchor +DebugStream::~DebugStream() +{} + class NullStream: public QIODevice { public: @@ -43,7 +47,7 @@ public: { open(WriteOnly); } - virtual ~NullStream(){}; + virtual ~NullStream(); bool isSequential() const { return true; } qint64 readData(char *, qint64) { return 0; /* eof */ } @@ -56,6 +60,10 @@ private: Q_DISABLE_COPY(NullStream) }; +//Virtual method anchor +NullStream::~NullStream() +{} + /* * ANSI color codes: * 0: reset colors/style @@ -175,8 +183,6 @@ QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char* file, prefix = "Error: "; prefixColorCode = ANSI_Colors::Red; break; - default: - break; }; bool showLocation = false; diff --git a/common/propertymapper.h b/common/propertymapper.h index efde72c..94c9224 100644 --- a/common/propertymapper.h +++ b/common/propertymapper.h @@ -52,6 +52,8 @@ template class ReadPropertyMapper { public: + virtual ~ReadPropertyMapper(){}; + virtual QVariant getProperty(const QByteArray &key, BufferType const *buffer) const { if (mReadAccessors.contains(key)) { @@ -106,6 +108,8 @@ template class WritePropertyMapper { public: + virtual ~WritePropertyMapper(){}; + virtual void setProperty(const QByteArray &key, const QVariant &value, QList > &builderCalls, flatbuffers::FlatBufferBuilder &fbb) const { if (mWriteAccessors.contains(key)) { diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 0c435c9..8296f1d 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp @@ -566,6 +566,9 @@ bool ResourceAccess::processMessageBuffer() }, this); } break; + case Sink::Commands::NotificationType::NotificationType_Status: + case Sink::Commands::NotificationType::NotificationType_Warning: + case Sink::Commands::NotificationType::NotificationType_Progress: default: Warning() << "Received unknown notification: " << buffer->type(); break; diff --git a/common/resultprovider.h b/common/resultprovider.h index 6958dbf..2d6efbe 100644 --- a/common/resultprovider.h +++ b/common/resultprovider.h @@ -27,8 +27,6 @@ #include "resultset.h" #include "log.h" -using namespace async; - namespace Sink { /** @@ -47,6 +45,11 @@ public: } + virtual ~ResultProviderInterface() + { + + } + virtual void add(const T &value) = 0; virtual void modify(const T &value) = 0; virtual void remove(const T &value) = 0; @@ -183,7 +186,7 @@ public: void onDone(const std::function &callback) { - mThreadBoundary = QSharedPointer::create(); + mThreadBoundary = QSharedPointer::create(); mOnDoneCallback = callback; } @@ -212,7 +215,7 @@ private: QWeakPointer > mResultEmitter; std::function mOnDoneCallback; - QSharedPointer mThreadBoundary; + QSharedPointer mThreadBoundary; std::function mFetcher; }; @@ -327,7 +330,7 @@ private: std::function clearHandler; std::function mFetcher; - ThreadBoundary mThreadBoundary; + async::ThreadBoundary mThreadBoundary; }; template diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 893c37c..e2c623e 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp @@ -443,8 +443,8 @@ Storage::NamedDatabase Storage::Transaction::openDatabase(const QByteArray &db, d->implicitCommit = true; auto p = new Storage::NamedDatabase::Private(db, allowDuplicates, d->defaultErrorHandler, d->name, d->transaction); if (!p->openDatabase(d->requestedRead, errorHandler)) { - return Storage::NamedDatabase(); delete p; + return Storage::NamedDatabase(); } return Storage::NamedDatabase(p); } -- cgit v1.2.3