From 64aea4541d7bc4aa8e23b144d3873bbc9d959d17 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 18 May 2012 17:39:42 -0400 Subject: [PATCH] Begone QSharedPointer destructor warnings! --- src/libtomahawk/Album.h | 1 + src/libtomahawk/Artist.h | 3 +-- src/libtomahawk/Query.cpp | 35 +++++++++++++++++++++++++++++++++++ src/libtomahawk/Query.h | 14 ++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/Album.h b/src/libtomahawk/Album.h index baef2b235..bda5036c5 100644 --- a/src/libtomahawk/Album.h +++ b/src/libtomahawk/Album.h @@ -31,6 +31,7 @@ #include "Typedefs.h" #include "PlaylistInterface.h" #include "DllMacro.h" +#include "Collection.h" #include "infosystem/InfoSystem.h" namespace Tomahawk diff --git a/src/libtomahawk/Artist.h b/src/libtomahawk/Artist.h index 30179a979..484c17aad 100644 --- a/src/libtomahawk/Artist.h +++ b/src/libtomahawk/Artist.h @@ -23,7 +23,6 @@ #include "config.h" #include -#include #ifndef ENABLE_HEADLESS #include #endif @@ -87,7 +86,7 @@ private slots: void infoSystemFinished( QString target ); private: - Q_DISABLE_COPY( Artist ) + Artist(); unsigned int m_id; QString m_name; diff --git a/src/libtomahawk/Query.cpp b/src/libtomahawk/Query.cpp index 6e9c284a3..8f321aca7 100644 --- a/src/libtomahawk/Query.cpp +++ b/src/libtomahawk/Query.cpp @@ -39,6 +39,41 @@ using namespace Tomahawk; +SocialAction::SocialAction() {} +SocialAction::~SocialAction() {} + +SocialAction& SocialAction::operator=( const SocialAction& other ) +{ + action = other.action; + value = other.value; + timestamp = other.timestamp; + source = other.source; + + return *this; +} + +SocialAction::SocialAction( const SocialAction& other ) +{ + *this = other; +} + +PlaybackLog::PlaybackLog() {} +PlaybackLog::~PlaybackLog() {} + +PlaybackLog& PlaybackLog::operator=( const PlaybackLog& other ) +{ + source = other.source; + timestamp = other.timestamp; + secsPlayed = other.secsPlayed; + + return *this; +} + +PlaybackLog::PlaybackLog( const PlaybackLog& other ) +{ + *this = other; +} + query_ptr Query::get( const QString& artist, const QString& track, const QString& album, const QID& qid, bool autoResolve ) { diff --git a/src/libtomahawk/Query.h b/src/libtomahawk/Query.h index a2656684e..77ca466c8 100644 --- a/src/libtomahawk/Query.h +++ b/src/libtomahawk/Query.h @@ -46,6 +46,13 @@ struct SocialAction QVariant value; QVariant timestamp; Tomahawk::source_ptr source; + + // Make explicit so compiler won't auto-generate, since destructor of + // source_ptr is not defined yet (only typedef included in header) + SocialAction(); + ~SocialAction(); + SocialAction& operator=( const SocialAction& other ); + SocialAction( const SocialAction& other ); }; struct PlaybackLog @@ -53,6 +60,13 @@ struct PlaybackLog Tomahawk::source_ptr source; unsigned int timestamp; unsigned int secsPlayed; + + // Make explicit so compiler won't auto-generate, since destructor of + // source_ptr is not defined yet (only typedef included in header) + PlaybackLog(); + ~PlaybackLog(); + PlaybackLog& operator=( const PlaybackLog& other ); + PlaybackLog( const PlaybackLog& other ); };