From e1dbeb4cd6cc5ba7bb57ef0019fef9cee64f5cbe Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Mon, 17 Nov 2014 17:03:35 +0100 Subject: [PATCH] Move all classes in libtomahawk/resolvers to Tomahawk namespace --- src/libtomahawk/accounts/spotify/SpotifyAccount.h | 3 +-- src/libtomahawk/resolvers/ExternalResolver.h | 10 +++++----- src/libtomahawk/resolvers/JSInfoPlugin.cpp | 2 ++ src/libtomahawk/resolvers/JSInfoPlugin.h | 5 +++++ src/libtomahawk/resolvers/JSInfoPlugin_p.h | 6 +++++- src/libtomahawk/resolvers/JSInfoSystemHelper.cpp | 1 + src/libtomahawk/resolvers/JSInfoSystemHelper.h | 5 +++++ src/libtomahawk/resolvers/JSInfoSystemHelper_p.h | 6 +++++- src/libtomahawk/resolvers/JSResolver.cpp | 2 ++ src/libtomahawk/resolvers/JSResolver.h | 6 +++++- src/libtomahawk/resolvers/JSResolverHelper.h | 10 +++++++++- src/libtomahawk/resolvers/JSResolver_p.h | 6 +++++- src/libtomahawk/resolvers/ScriptCommand.h | 5 +++++ src/libtomahawk/resolvers/ScriptCommandQueue.cpp | 2 ++ src/libtomahawk/resolvers/ScriptCommandQueue.h | 7 ++++++- src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp | 2 ++ src/libtomahawk/resolvers/ScriptCommand_AllAlbums.h | 5 +++++ src/libtomahawk/resolvers/ScriptCommand_AllArtists.cpp | 2 ++ src/libtomahawk/resolvers/ScriptCommand_AllArtists.h | 5 +++++ src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp | 2 ++ src/libtomahawk/resolvers/ScriptCommand_AllTracks.h | 5 +++++ src/libtomahawk/resolvers/ScriptCommand_LookupUrl.cpp | 2 ++ src/libtomahawk/resolvers/ScriptCommand_LookupUrl.h | 7 +++---- src/libtomahawk/resolvers/ScriptCommand_LookupUrl_p.h | 5 +++++ src/libtomahawk/resolvers/ScriptEngine.cpp | 2 ++ src/libtomahawk/resolvers/ScriptEngine.h | 8 +++++++- src/libtomahawk/resolvers/ScriptResolver.cpp | 2 ++ src/libtomahawk/resolvers/ScriptResolver.h | 5 +++++ 28 files changed, 110 insertions(+), 18 deletions(-) diff --git a/src/libtomahawk/accounts/spotify/SpotifyAccount.h b/src/libtomahawk/accounts/spotify/SpotifyAccount.h index 1443e3ee4..10da048b9 100644 --- a/src/libtomahawk/accounts/spotify/SpotifyAccount.h +++ b/src/libtomahawk/accounts/spotify/SpotifyAccount.h @@ -33,11 +33,10 @@ //class SpotifyPlaylistUpdater; class QTimer; -class ScriptResolver; - namespace Tomahawk { class SpotifyParser; +class ScriptResolver; namespace InfoSystem { diff --git a/src/libtomahawk/resolvers/ExternalResolver.h b/src/libtomahawk/resolvers/ExternalResolver.h index 10f165369..6c8ff4199 100644 --- a/src/libtomahawk/resolvers/ExternalResolver.h +++ b/src/libtomahawk/resolvers/ExternalResolver.h @@ -48,11 +48,11 @@ class DLLEXPORT ExternalResolver : public Resolver { Q_OBJECT - friend class ::ScriptCommandQueue; - friend class ::ScriptCommand_AllArtists; - friend class ::ScriptCommand_AllAlbums; - friend class ::ScriptCommand_AllTracks; - friend class ::ScriptCommand_LookupUrl; + friend class ScriptCommandQueue; + friend class ScriptCommand_AllArtists; + friend class ScriptCommand_AllAlbums; + friend class ScriptCommand_AllTracks; + friend class ScriptCommand_LookupUrl; public: enum ErrorState { diff --git a/src/libtomahawk/resolvers/JSInfoPlugin.cpp b/src/libtomahawk/resolvers/JSInfoPlugin.cpp index b8669ec99..507d403d9 100644 --- a/src/libtomahawk/resolvers/JSInfoPlugin.cpp +++ b/src/libtomahawk/resolvers/JSInfoPlugin.cpp @@ -24,6 +24,8 @@ #include "../utils/Logger.h" #include "../utils/Json.h" +using namespace Tomahawk; + JSInfoPlugin::JSInfoPlugin( int id, JSResolver *resolver ) : d_ptr( new JSInfoPluginPrivate( this, id, resolver ) ) { diff --git a/src/libtomahawk/resolvers/JSInfoPlugin.h b/src/libtomahawk/resolvers/JSInfoPlugin.h index bb399d288..faf20e146 100644 --- a/src/libtomahawk/resolvers/JSInfoPlugin.h +++ b/src/libtomahawk/resolvers/JSInfoPlugin.h @@ -24,6 +24,9 @@ #include "DllMacro.h" +namespace Tomahawk +{ + class JSResolver; class JSInfoPluginPrivate; @@ -67,4 +70,6 @@ private: QScopedPointer d_ptr; }; +}; // ns: Tomahawk + #endif // TOMAHAWK_JSINFOPLUGIN_H diff --git a/src/libtomahawk/resolvers/JSInfoPlugin_p.h b/src/libtomahawk/resolvers/JSInfoPlugin_p.h index 8d2769cc5..6f9743848 100644 --- a/src/libtomahawk/resolvers/JSInfoPlugin_p.h +++ b/src/libtomahawk/resolvers/JSInfoPlugin_p.h @@ -21,9 +21,12 @@ #include "JSInfoPlugin.h" +namespace Tomahawk +{ + class JSInfoPluginPrivate { - friend class ::JSInfoPlugin; + friend class JSInfoPlugin; public: JSInfoPluginPrivate( JSInfoPlugin* q, int id, JSResolver* resolver ) : q_ptr ( q ) @@ -42,5 +45,6 @@ private: QMap< int, Tomahawk::InfoSystem::InfoStringHash > criteriaCache; }; +} // ns: Tomahawk #endif // TOMAHAWK_JSINFOPLUGIN_P_H diff --git a/src/libtomahawk/resolvers/JSInfoSystemHelper.cpp b/src/libtomahawk/resolvers/JSInfoSystemHelper.cpp index a997e6f08..5cfd053f9 100644 --- a/src/libtomahawk/resolvers/JSInfoSystemHelper.cpp +++ b/src/libtomahawk/resolvers/JSInfoSystemHelper.cpp @@ -21,6 +21,7 @@ #include "../utils/Logger.h" +using namespace Tomahawk; JSInfoSystemHelper::JSInfoSystemHelper( JSResolver* parent ) : QObject( parent ) diff --git a/src/libtomahawk/resolvers/JSInfoSystemHelper.h b/src/libtomahawk/resolvers/JSInfoSystemHelper.h index 01f2e7798..78ca758e6 100644 --- a/src/libtomahawk/resolvers/JSInfoSystemHelper.h +++ b/src/libtomahawk/resolvers/JSInfoSystemHelper.h @@ -21,6 +21,9 @@ #include +namespace Tomahawk +{ + class JSResolver; class JSInfoSystemHelperPrivate; @@ -47,4 +50,6 @@ private: QScopedPointer d_ptr; }; +} // ns: Tomahawk + #endif // TOMAHAWK_JSINFOSYSTEMHELPER_H diff --git a/src/libtomahawk/resolvers/JSInfoSystemHelper_p.h b/src/libtomahawk/resolvers/JSInfoSystemHelper_p.h index 121a84ca5..644d53170 100644 --- a/src/libtomahawk/resolvers/JSInfoSystemHelper_p.h +++ b/src/libtomahawk/resolvers/JSInfoSystemHelper_p.h @@ -22,9 +22,12 @@ #include "JSResolver.h" #include "JSInfoSystemHelper.h" +namespace Tomahawk +{ + class JSInfoSystemHelperPrivate { - friend class ::JSInfoSystemHelper; + friend class JSInfoSystemHelper; public: JSInfoSystemHelperPrivate( JSInfoSystemHelper* q, JSResolver* resolver ) : q_ptr ( q ) @@ -41,5 +44,6 @@ private: }; +} // ns: Tomahawk #endif // TOMAHAWK_JSINFOSYSTEMHELPER_P_H diff --git a/src/libtomahawk/resolvers/JSResolver.cpp b/src/libtomahawk/resolvers/JSResolver.cpp index 765ae3425..82a560a28 100644 --- a/src/libtomahawk/resolvers/JSResolver.cpp +++ b/src/libtomahawk/resolvers/JSResolver.cpp @@ -54,6 +54,8 @@ #include #include +using namespace Tomahawk; + JSResolver::JSResolver( const QString& accountId, const QString& scriptPath, const QStringList& additionalScriptPaths ) : Tomahawk::ExternalResolverGui( scriptPath ) , d_ptr( new JSResolverPrivate( this, accountId, scriptPath, additionalScriptPaths ) ) diff --git a/src/libtomahawk/resolvers/JSResolver.h b/src/libtomahawk/resolvers/JSResolver.h index 9ff8df559..916457ac5 100644 --- a/src/libtomahawk/resolvers/JSResolver.h +++ b/src/libtomahawk/resolvers/JSResolver.h @@ -27,6 +27,9 @@ #include "ExternalResolverGui.h" #include "Typedefs.h" +namespace Tomahawk +{ + class JSInfoPlugin; class JSResolverHelper; class JSResolverPrivate; @@ -36,7 +39,7 @@ class DLLEXPORT JSResolver : public Tomahawk::ExternalResolverGui { Q_OBJECT -friend class ::JSResolverHelper; +friend class JSResolverHelper; public: explicit JSResolver( const QString& accountId, const QString& scriptPath, const QStringList& additionalScriptPaths = QStringList() ); @@ -130,4 +133,5 @@ private: QScopedPointer d_ptr; }; +} // ns: Tomahawk #endif // JSRESOLVER_H diff --git a/src/libtomahawk/resolvers/JSResolverHelper.h b/src/libtomahawk/resolvers/JSResolverHelper.h index fb91847a7..d1439f423 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.h +++ b/src/libtomahawk/resolvers/JSResolverHelper.h @@ -34,9 +34,14 @@ #include -class JSResolver; + Q_DECLARE_METATYPE( std::function< void( QSharedPointer< QIODevice >& ) > ) +namespace Tomahawk +{ + +class JSResolver; + class DLLEXPORT JSResolverHelper : public QObject { Q_OBJECT @@ -161,4 +166,7 @@ private: QString m_pendingUrl; Tomahawk::album_ptr m_pendingAlbum; }; + +} // ns: Tomahawk + #endif // JSRESOLVERHELPER_H diff --git a/src/libtomahawk/resolvers/JSResolver_p.h b/src/libtomahawk/resolvers/JSResolver_p.h index 33729722f..9cf837673 100644 --- a/src/libtomahawk/resolvers/JSResolver_p.h +++ b/src/libtomahawk/resolvers/JSResolver_p.h @@ -28,9 +28,12 @@ #include "JSInfoSystemHelper.h" #include "database/fuzzyindex/FuzzyIndex.h" +namespace Tomahawk +{ + class JSResolverPrivate { - friend class ::JSResolverHelper; + friend class JSResolverHelper; public: JSResolverPrivate( JSResolver* q, const QString& pAccountId, const QString& scriptPath, const QStringList& additionalScriptPaths ) : q_ptr ( q ) @@ -68,5 +71,6 @@ private: QStringList requiredScriptPaths; }; +} // ns: Tomahawk #endif // JSRESOLVER_P_H diff --git a/src/libtomahawk/resolvers/ScriptCommand.h b/src/libtomahawk/resolvers/ScriptCommand.h index 60ae4db7c..0c3df3a51 100644 --- a/src/libtomahawk/resolvers/ScriptCommand.h +++ b/src/libtomahawk/resolvers/ScriptCommand.h @@ -21,6 +21,9 @@ #include +namespace Tomahawk +{ + class ScriptCommand : public QObject { public: @@ -36,4 +39,6 @@ protected: virtual void reportFailure() = 0; }; +} // ns: Tomahawk + #endif // SCRIPTCOMMAND_H diff --git a/src/libtomahawk/resolvers/ScriptCommandQueue.cpp b/src/libtomahawk/resolvers/ScriptCommandQueue.cpp index a0e17e87d..98e11227c 100644 --- a/src/libtomahawk/resolvers/ScriptCommandQueue.cpp +++ b/src/libtomahawk/resolvers/ScriptCommandQueue.cpp @@ -21,6 +21,8 @@ #include #include +using namespace Tomahawk; + ScriptCommandQueue::ScriptCommandQueue( QObject* parent ) : QObject( parent ) , m_timer( new QTimer( this ) ) diff --git a/src/libtomahawk/resolvers/ScriptCommandQueue.h b/src/libtomahawk/resolvers/ScriptCommandQueue.h index aa137ab82..8795ff7aa 100644 --- a/src/libtomahawk/resolvers/ScriptCommandQueue.h +++ b/src/libtomahawk/resolvers/ScriptCommandQueue.h @@ -27,6 +27,9 @@ #include #include +namespace Tomahawk +{ + class ScriptCommandQueue : public QObject { Q_OBJECT @@ -47,6 +50,8 @@ private: QMutex m_mutex; }; -Q_DECLARE_METATYPE( QSharedPointer< ScriptCommand > ) +} // ns: Tomahawk + +Q_DECLARE_METATYPE( QSharedPointer< Tomahawk::ScriptCommand > ) #endif // SCRIPTCOMMANDQUEUE_H diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp b/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp index 06764e5fc..20c2f98f4 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp +++ b/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp @@ -26,6 +26,8 @@ #include "PlaylistEntry.h" #include "ScriptCollection.h" +using namespace Tomahawk; + ScriptCommand_AllAlbums::ScriptCommand_AllAlbums( const Tomahawk::collection_ptr& collection, const Tomahawk::artist_ptr& artist, QObject* parent ) diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.h b/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.h index 13712e7cd..a3c2ff137 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.h +++ b/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.h @@ -24,6 +24,9 @@ #include "collection/Collection.h" #include "resolvers/ScriptCommand.h" +namespace Tomahawk +{ + class ScriptCommand_AllAlbums : public ScriptCommand, public Tomahawk::AlbumsRequest { Q_OBJECT @@ -54,4 +57,6 @@ private: QString m_filter; }; +} // ns: Tomahawk + #endif // SCRIPTCOMMAND_ALLALBUMS_H diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllArtists.cpp b/src/libtomahawk/resolvers/ScriptCommand_AllArtists.cpp index c7cdce6f2..2f31e5462 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllArtists.cpp +++ b/src/libtomahawk/resolvers/ScriptCommand_AllArtists.cpp @@ -24,6 +24,8 @@ #include "utils/Logger.h" +using namespace Tomahawk; + ScriptCommand_AllArtists::ScriptCommand_AllArtists( const Tomahawk::collection_ptr& collection, QObject* parent ) : ScriptCommand( parent ) diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllArtists.h b/src/libtomahawk/resolvers/ScriptCommand_AllArtists.h index 3020d355f..03643956d 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllArtists.h +++ b/src/libtomahawk/resolvers/ScriptCommand_AllArtists.h @@ -24,6 +24,9 @@ #include "collection/Collection.h" #include "resolvers/ScriptCommand.h" +namespace Tomahawk +{ + class ScriptCommand_AllArtists : public ScriptCommand, public Tomahawk::ArtistsRequest { Q_OBJECT @@ -52,4 +55,6 @@ private: QString m_filter; }; +} // ns: Tomahawk + #endif // SCRIPTCOMMAND_ALLARTISTS_H diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp b/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp index aadba4637..81aafdaae 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp +++ b/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp @@ -24,6 +24,8 @@ #include "utils/Logger.h" +using namespace Tomahawk; + ScriptCommand_AllTracks::ScriptCommand_AllTracks( const Tomahawk::collection_ptr& collection, const Tomahawk::album_ptr& album, QObject* parent ) diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllTracks.h b/src/libtomahawk/resolvers/ScriptCommand_AllTracks.h index f7f9f5c9c..845fc75f0 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllTracks.h +++ b/src/libtomahawk/resolvers/ScriptCommand_AllTracks.h @@ -24,6 +24,9 @@ #include "collection/Collection.h" #include "resolvers/ScriptCommand.h" +namespace Tomahawk +{ + class ScriptCommand_AllTracks : public ScriptCommand, public Tomahawk::TracksRequest { Q_OBJECT @@ -51,4 +54,6 @@ private: Tomahawk::album_ptr m_album; }; +} // ns: Tomahawk + #endif // SCRIPTCOMMAND_ALLTRACKS_H diff --git a/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.cpp b/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.cpp index 6ebcf4964..5e91cbe73 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.cpp +++ b/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.cpp @@ -20,6 +20,8 @@ #include "PlaylistEntry.h" +using namespace Tomahawk; + ScriptCommand_LookupUrl::ScriptCommand_LookupUrl( Tomahawk::ExternalResolver* resolver, const QString& url, QObject* parent ) : ScriptCommand( parent ) , d_ptr( new ScriptCommand_LookupUrlPrivate( this, resolver, url ) ) diff --git a/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.h b/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.h index 04cc0513a..7f68e37a1 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.h +++ b/src/libtomahawk/resolvers/ScriptCommand_LookupUrl.h @@ -26,15 +26,12 @@ #include -class ScriptCommand_LookupUrlPrivate; - namespace Tomahawk { +class ScriptCommand_LookupUrlPrivate; class ExternalResolver; -} - class DLLEXPORT ScriptCommand_LookupUrl : public ScriptCommand { Q_OBJECT @@ -62,4 +59,6 @@ private: ScriptCommand_LookupUrlPrivate* d_ptr; }; +} // ns: Tomahawk + #endif // SCRIPTCOMMAND_LOOKUPURL_H diff --git a/src/libtomahawk/resolvers/ScriptCommand_LookupUrl_p.h b/src/libtomahawk/resolvers/ScriptCommand_LookupUrl_p.h index a63f6f5ee..a47f1f5d1 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_LookupUrl_p.h +++ b/src/libtomahawk/resolvers/ScriptCommand_LookupUrl_p.h @@ -23,6 +23,9 @@ #include "ExternalResolver.h" +namespace Tomahawk +{ + class ScriptCommand_LookupUrlPrivate { public: @@ -40,4 +43,6 @@ private: Tomahawk::ExternalResolver* resolver; }; +} // ns: Tomahawk + #endif // SCRIPTCOMMAND_LOOKUPURL_P_H diff --git a/src/libtomahawk/resolvers/ScriptEngine.cpp b/src/libtomahawk/resolvers/ScriptEngine.cpp index a347cd729..28d9af9d2 100644 --- a/src/libtomahawk/resolvers/ScriptEngine.cpp +++ b/src/libtomahawk/resolvers/ScriptEngine.cpp @@ -33,6 +33,8 @@ #include #include +using namespace Tomahawk; + ScriptEngine::ScriptEngine( JSResolver* parent ) : QWebPage( (QObject*) parent ) , m_parent( parent ) diff --git a/src/libtomahawk/resolvers/ScriptEngine.h b/src/libtomahawk/resolvers/ScriptEngine.h index c90377527..33efecec7 100644 --- a/src/libtomahawk/resolvers/ScriptEngine.h +++ b/src/libtomahawk/resolvers/ScriptEngine.h @@ -27,9 +27,13 @@ #include #include -class JSResolver; class QNetworkReply; +namespace Tomahawk +{ + +class JSResolver; + class DLLEXPORT ScriptEngine : public QWebPage { Q_OBJECT @@ -55,4 +59,6 @@ private: QString m_header; }; +} // ns: Tomahawk + #endif // SCRIPTENGINE_H diff --git a/src/libtomahawk/resolvers/ScriptResolver.cpp b/src/libtomahawk/resolvers/ScriptResolver.cpp index 99e4c62b1..090ecbbab 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.cpp +++ b/src/libtomahawk/resolvers/ScriptResolver.cpp @@ -44,6 +44,8 @@ #include #endif +using namespace Tomahawk; + ScriptResolver::ScriptResolver( const QString& exe ) : Tomahawk::ExternalResolverGui( exe ) , m_num_restarts( 0 ) diff --git a/src/libtomahawk/resolvers/ScriptResolver.h b/src/libtomahawk/resolvers/ScriptResolver.h index 090a914a0..403cbcf89 100644 --- a/src/libtomahawk/resolvers/ScriptResolver.h +++ b/src/libtomahawk/resolvers/ScriptResolver.h @@ -32,6 +32,9 @@ class QWidget; +namespace Tomahawk +{ + class DLLEXPORT ScriptResolver : public Tomahawk::ExternalResolverGui { Q_OBJECT @@ -107,4 +110,6 @@ private: ExternalResolver::ErrorState m_error; }; +} + #endif // SCRIPTRESOLVER_H