[amarok] /: Biggie: introduce core/meta/forward_declarations.h and use it

Matěj Laitl matej at laitl.cz
Wed May 1 21:02:28 UTC 2013


Git commit c46ed13308ba695ba4027c5344593805d71121e0 by Matěj Laitl.
Committed on 28/04/2013 at 19:53.
Pushed by laitl into branch 'master'.

Biggie: introduce core/meta/forward_declarations.h and use it

We try to include only what is absolutely necessary in header
files to keep compilation times low. This is especially useful not
during the first compilation, but when you touch one (header) file ->
the less this header is (transitively) included, the less files you
need to recompile.

Normally, forward declarations of all-but-direct members of the class
help with this immensely. However, all our meta types use KSharedPtrs
instead of plain pointers (for good reasons); forward-declaring these
is well possible, but tedious to do in each header file that uses them.

Introduce core/meta/forward_declarations.h that contains forward
declarations of all KSharedPtr-managed classes in core/meta/* (and
KSharedPtr include for convenience)

Use the new file where appropriate. Now all header files should include
core/meta/forward_declarations.h instead of Meta.h (and include Meta.h
just in the .cpp file), unless they actually subclass one of those
classes.

Note that forward_declarations.h suffices even when you have
Meta::[Something]Ptr as class attribute; with a small hiccup: your
destructor needs to be implemented (even if empty) in a file that
includes the full class declaration (the compiler catches this
fortunately) of the meta class. That's why this patch add some
seemingly redundant empty destructor implementations.

Another hiccup is when you use Meta::[Something]Ptrs inside Qt
signals/slots - the code that ends up in the .moc (or *_automoc.cpp)
file and will usually need the full class declaration; simple trick is
to add the old-style
 #include "FooClass.moc" at the end of the file.

This is not that important per-se, but it paves the way for more Meta
changes that we sketched in Randa.

CCMAIL: amarok-devel at kde.org

M  +1    -1    playground/src/context/applets/coverbling/CoverBling.h
M  +4    -1    playground/src/context/applets/coverbling/ImageLoader.cpp
M  +3    -1    playground/src/context/applets/coverbling/ImageLoader.h
M  +13   -12   playground/src/context/applets/coverbling/PhotoBrowser.h
M  +4    -0    playground/src/context/applets/coverbling/pictureflow.cpp
M  +2    -1    playground/src/context/applets/coverbling/pictureflow.h
M  +8    -3    playground/src/context/applets/covergrid/AlbumItem.cpp
M  +6    -4    playground/src/context/applets/covergrid/AlbumItem.h
M  +3    -3    playground/src/context/applets/covergrid/CoverGridApplet.h
M  +1    -1    src/AmarokMimeData.h
M  +1    -1    src/DirectoryLoader.h
M  +1    -1    src/GlobalCollectionActions.h
M  +1    -1    src/GlobalCurrentTrackActions.h
M  +1    -1    src/KNotificationBackend.h
M  +1    -1    src/LastfmReadLabelCapability.h
M  +1    -1    src/MainWindow.h
M  +3    -3    src/SvgHandler.h
M  +1    -1    src/TrayIcon.h
M  +1    -1    src/amarokurls/AmarokUrlHandler.h
M  +1    -1    src/amarokurls/BookmarkMetaActions.h
M  +1    -1    src/amarokurls/NavigationUrlGenerator.h
M  +1    -1    src/amarokurls/PlayUrlGenerator.h
M  +1    -1    src/browsers/BrowserCategoryListSortFilterProxyModel.h
M  +2    -1    src/browsers/CollectionSortFilterProxyModel.cpp
M  +1    -1    src/browsers/CollectionSortFilterProxyModel.h
M  +12   -5    src/browsers/CollectionTreeItem.cpp
M  +7    -6    src/browsers/CollectionTreeItem.h
M  +1    -1    src/browsers/CollectionTreeItemModel.h
M  +1    -1    src/browsers/CollectionTreeItemModelBase.h
M  +5    -1    src/browsers/CollectionTreeView.h
M  +6    -5    src/browsers/SingleCollectionTreeItemModel.cpp
M  +1    -1    src/browsers/SingleCollectionTreeItemModel.h
M  +1    -1    src/browsers/filebrowser/FileView.h
M  +1    -1    src/browsers/playlistbrowser/UserPlaylistModel.h
M  +1    -0    src/configdialog/dialogs/ExcludedLabelsDialog.cpp
M  +1    -1    src/configdialog/dialogs/ExcludedLabelsDialog.h
M  +1    -1    src/context/applets/albums/Albums.h
M  +1    -1    src/context/applets/albums/AlbumsModel.h
M  +1    -1    src/context/applets/albums/AlbumsView.h
M  +1    -1    src/context/applets/currenttrack/CurrentTrack.h
M  +4    -3    src/context/applets/similarartists/ArtistWidget.cpp
M  +1    -1    src/context/applets/similarartists/ArtistWidget.h
M  +5    -1    src/context/engines/current/CurrentEngine.h
M  +1    -1    src/context/engines/labels/LabelsEngine.h
M  +1    -1    src/context/engines/lyrics/LyricsEngine.h
M  +1    -1    src/context/engines/similarartists/SimilarArtistsEngine.h
M  +1    -1    src/context/engines/songkick/SongkickEngine.h
M  +1    -1    src/context/engines/tabs/TabsEngine.h
M  +1    -1    src/context/engines/upcomingevents/UpcomingEventsEngine.h
M  +1    -1    src/context/engines/wikipedia/WikipediaEngine.h
M  +1    -1    src/context/widgets/RecentlyPlayedListWidget.h
M  +1    -1    src/context/widgets/TrackWidget.h
M  +2    -1    src/core-impl/capabilities/AlbumActionsCapability.cpp
M  +1    -1    src/core-impl/capabilities/AlbumActionsCapability.h
M  +1    -1    src/core-impl/capabilities/timecode/TimecodeLoadCapability.h
M  +1    -1    src/core-impl/capabilities/timecode/TimecodeWriteCapability.h
M  +1    -1    src/core-impl/collections/db/sql/SqlQueryMakerInternal.h
M  +1    -1    src/core-impl/collections/ipodcollection/IpodCollection.h
M  +1    -1    src/core-impl/collections/ipodcollection/jobs/IpodCopyTracksJob.h
M  +1    -1    src/core-impl/collections/ipodcollection/jobs/IpodDeleteTracksJob.h
M  +1    -1    src/core-impl/collections/ipodcollection/jobs/IpodParseTracksJob.h
M  +1    -1    src/core-impl/collections/nepomukcollection/NepomukConstructMetaJob.h
M  +1    -1    src/core-impl/collections/playdarcollection/PlaydarQueryMaker.h
M  +1    -1    src/core-impl/collections/playdarcollection/support/Query.h
M  +1    -1    src/core-impl/collections/proxycollection/ProxyCollection.h
M  +2    -1    src/core-impl/collections/support/CollectionManager.h
M  +1    -0    src/core-impl/collections/support/MemoryCustomValue.cpp
M  +1    -1    src/core-impl/collections/support/MemoryCustomValue.h
M  +1    -0    src/core-impl/collections/support/MemoryFilter.cpp
M  +1    -1    src/core-impl/collections/support/MemoryFilter.h
M  +1    -1    src/core-impl/collections/support/MemoryMatcher.h
M  +1    -1    src/core-impl/collections/support/MemoryQueryMakerHelper.h
M  +1    -1    src/core-impl/collections/support/MemoryQueryMakerInternal.h
M  +1    -1    src/core-impl/collections/support/TextualQueryFilter.h
M  +1    -1    src/core-impl/collections/upnpcollection/UpnpCache.h
M  +1    -1    src/core-impl/meta/cue/CueFileSupport.h
M  +1    -0    src/core-impl/meta/proxy/MetaProxyWorker.cpp
M  +1    -1    src/core-impl/playlists/types/file/PlaylistFile.h
M  +1    -1    src/core-impl/playlists/types/file/PlaylistFileSupport.h
M  +1    -1    src/core/capabilities/ReadLabelCapability.h
M  +1    -1    src/core/capabilities/SourceInfoCapability.h
M  +1    -1    src/core/capabilities/WriteLabelCapability.h
M  +1    -0    src/core/collections/CollectionLocation.cpp
M  +3    -2    src/core/collections/CollectionLocation.h
M  +1    -1    src/core/collections/CollectionLocationDelegate.h
M  +1    -0    src/core/collections/QueryMaker.cpp
M  +1    -1    src/core/collections/QueryMaker.h
M  +2    -0    src/core/collections/support/TrackForUrlWorker.cpp
M  +1    -1    src/core/collections/support/TrackForUrlWorker.h
M  +4    -34   src/core/meta/Meta.h
C  +39   -28   src/core/meta/forward_declarations.h [from: src/configdialog/dialogs/ExcludedLabelsDialog.h - 052% similarity]
M  +3    -0    src/core/meta/support/MetaConstants.cpp
M  +1    -1    src/core/meta/support/MetaConstants.h
M  +1    -1    src/core/meta/support/MetaKeys.h
M  +1    -1    src/core/meta/support/MetaUtility.h
M  +1    -1    src/core/meta/support/PrivateMetaRegistry.cpp
M  +8    -7    src/core/meta/support/PrivateMetaRegistry.h
M  +1    -0    src/core/playlists/Playlist.cpp
M  +3    -1    src/core/playlists/Playlist.h
M  +1    -2    src/core/playlists/PlaylistProvider.cpp
M  +1    -1    src/core/support/Amarok.h
M  +4    -4    src/core/transcoding/TranscodingConfiguration.h
M  +1    -0    src/covermanager/CoverCache.cpp
M  +7    -5    src/covermanager/CoverCache.h
M  +1    -1    src/covermanager/CoverFetchQueue.h
M  +6    -0    src/covermanager/CoverFetchUnit.cpp
M  +5    -4    src/covermanager/CoverFetchUnit.h
M  +6    -5    src/covermanager/CoverFetcher.cpp
M  +1    -1    src/covermanager/CoverFetcher.h
M  +1    -1    src/covermanager/CoverFetchingActions.h
M  +1    -1    src/covermanager/CoverFoundDialog.h
M  +1    -0    src/covermanager/CoverViewDialog.cpp
M  +1    -1    src/covermanager/CoverViewDialog.h
M  +1    -1    src/databaseimporter/DatabaseImporter.h
M  +1    -1    src/databaseimporter/amarok14/FastForwardWorker.h
M  +4    -0    src/databaseimporter/itunes/ITunesImporterWorker.cpp
M  +8    -8    src/databaseimporter/itunes/ITunesImporterWorker.h
M  +3    -2    src/dbus/DBusQueryHelper.cpp
M  +1    -1    src/dbus/DBusQueryHelper.h
M  +1    -1    src/dbus/mpris1/PlayerHandler.h
M  +1    -1    src/dbus/mpris2/MediaPlayer2Player.h
M  +1    -0    src/dialogs/DatabaseImporterDialog.cpp
M  +1    -1    src/dialogs/DatabaseImporterDialog.h
M  +1    -1    src/dialogs/EditFilterDialog.h
M  +3    -2    src/dialogs/MusicBrainzTagger.cpp
M  +1    -1    src/dialogs/MusicBrainzTagger.h
M  +1    -1    src/dialogs/OrganizeCollectionDialog.h
M  +1    -0    src/dialogs/TrackOrganizer.cpp
M  +2    -1    src/dialogs/TrackOrganizer.h
M  +1    -1    src/dynamic/Bias.h
M  +8    -7    src/dynamic/BiasSolver.cpp
M  +4    -5    src/dynamic/BiasSolver.h
M  +1    -1    src/dynamic/BiasedPlaylist.h
M  +4    -1    src/dynamic/DynamicPlaylist.h
M  +3    -1    src/dynamic/TrackSet.cpp
M  +4    -3    src/dynamic/TrackSet.h
M  +3    -2    src/dynamic/biases/AlbumPlayBias.cpp
M  +3    -2    src/dynamic/biases/EchoNestBias.cpp
M  +1    -1    src/dynamic/biases/EchoNestBias.h
M  +4    -3    src/dynamic/biases/IfElseBias.cpp
M  +3    -2    src/dynamic/biases/PartBias.cpp
M  +3    -3    src/dynamic/biases/QuizPlayBias.cpp
M  +3    -2    src/dynamic/biases/TagMatchBias.cpp
M  +2    -0    src/dynamic/biases/TagMatchBias.h
M  +1    -1    src/mac/GrowlInterface.h
M  +3    -4    src/moodbar/MoodbarManager.cpp
M  +6    -3    src/moodbar/MoodbarManager.h
M  +3    -2    src/musicbrainz/MusicBrainzFinder.cpp
M  +1    -1    src/musicbrainz/MusicBrainzFinder.h
M  +2    -1    src/musicbrainz/MusicBrainzTagsItem.h
M  +1    -1    src/musicbrainz/MusicBrainzTagsModel.h
M  +1    -0    src/musicbrainz/MusicBrainzTagsView.cpp
M  +3    -2    src/musicbrainz/MusicDNSAudioDecoder.cpp
M  +4    -3    src/musicbrainz/MusicDNSAudioDecoder.h
M  +6    -3    src/musicbrainz/MusicDNSFinder.cpp
M  +1    -1    src/musicbrainz/MusicDNSFinder.h
M  +1    -1    src/playlist/PlaylistController.h
M  +19   -3    src/playlist/PlaylistItem.cpp
M  +8    -6    src/playlist/PlaylistItem.h
M  +2    -3    src/playlist/PlaylistModel.h
M  +1    -1    src/playlist/UndoCommands.h
M  +3    -11   src/playlist/layouts/LayoutItemConfig.cpp
M  +1    -1    src/playlist/navigators/AlbumNavigator.h
M  +3    -2    src/playlist/navigators/RandomTrackNavigator.cpp
M  +1    -1    src/playlist/navigators/RepeatAlbumNavigator.h
M  +1    -1    src/playlist/proxymodels/AbstractModel.h
M  +3    -3    src/playlist/proxymodels/GroupingProxy.cpp
M  +1    -1    src/playlist/proxymodels/GroupingProxy.h
M  +4    -1    src/playlist/proxymodels/SortAlgorithms.cpp
M  +3    -2    src/playlist/view/listview/InlineEditorWidget.cpp
M  +1    -1    src/playlist/view/listview/PrettyItemDelegate.h
M  +2    -0    src/playlistgenerator/ConstraintFactory.h
M  +1    -1    src/playlistgenerator/ConstraintGroup.h
M  +1    -1    src/playlistgenerator/ConstraintNode.h
M  +6    -4    src/playlistgenerator/ConstraintSolver.h
M  +9    -8    src/playlistgenerator/Preset.cpp
M  +1    -1    src/playlistgenerator/Preset.h
M  +1    -1    src/playlistgenerator/TreeModel.h
M  +12   -0    src/playlistgenerator/constraints/Checkpoint.cpp
M  +4    -4    src/playlistgenerator/constraints/Checkpoint.h
M  +1    -1    src/playlistgenerator/constraints/Matching.h
M  +4    -3    src/playlistgenerator/constraints/PlaylistDuration.cpp
M  +3    -2    src/playlistgenerator/constraints/PlaylistFileSize.cpp
M  +1    -0    src/playlistgenerator/constraints/TagMatch.cpp
M  +1    -1    src/playlistgenerator/constraints/TagMatch.h
M  +5    -2    src/playlistgenerator/constraints/TrackSpreader.cpp
M  +1    -1    src/playlistgenerator/constraints/TrackSpreader.h
M  +1    -0    src/playlistmanager/SyncedPlaylist.cpp
M  +1    -1    src/playlistmanager/sql/SqlPlaylistGroup.h
M  +1    -1    src/services/DynamicServiceQueryMaker.h
M  +1    -2    src/services/InfoParserBase.cpp
M  +1    -1    src/services/InfoParserBase.h
M  +2    -2    src/services/ServiceCollectionTreeView.cpp
M  +1    -0    src/services/ampache/LastfmInfoParser.cpp
M  +5    -3    src/services/ampache/LastfmInfoParser.h
M  +3    -2    src/services/lastfm/LastFmServiceSettings.cpp
M  +1    -1    src/services/lastfm/LastFmServiceSettings.h
M  +3    -1    src/services/lastfm/LastFmTreeModel.h
M  +1    -0    src/services/lastfm/ScrobblerAdapter.cpp
M  +1    -1    src/services/lastfm/ScrobblerAdapter.h
M  +3    -1    src/services/lastfm/SimilarArtistsAction.cpp
M  +3    -2    src/services/lastfm/biases/LastFmBias.cpp
M  +1    -0    src/services/lastfm/biases/WeeklyTopBias.cpp
M  +1    -1    src/services/lastfm/meta/LastFmMultiPlayableCapability.h
M  +1    -1    src/services/scriptable/ScriptableServiceQueryMaker.h
M  +1    -0    src/statsyncing/collection/CollectionProvider.cpp
M  +5    -1    src/statsyncing/collection/CollectionProvider.h
M  +1    -0    src/statsyncing/collection/CollectionTrack.cpp
M  +1    -1    src/statsyncing/collection/CollectionTrack.h
M  +1    -0    src/statsyncing/jobs/SynchronizeTracksJob.cpp
M  +1    -1    src/statsyncing/jobs/SynchronizeTracksJob.h
M  +2    -1    src/synchronization/SynchronizationBaseJob.cpp
M  +1    -1    src/synchronization/SynchronizationBaseJob.h
M  +1    -1    src/synchronization/UnionJob.h
M  +1    -1    src/toolbar/MainToolbar.h
M  +3    -1    src/widgets/AlbumBreadcrumbWidget.cpp
M  +1    -1    src/widgets/AlbumBreadcrumbWidget.h
M  +1    -1    src/widgets/MetaQueryWidget.h
M  +1    -1    src/widgets/Osd.h
M  +1    -1    src/widgets/ProgressWidget.h
M  +3    -2    src/widgets/TrackSelectWidget.cpp
M  +1    -1    src/widgets/TrackSelectWidget.h
M  +2    -0    tests/MetaNotificationSpy.cpp
M  +1    -1    tests/MetaNotificationSpy.h
M  +1    -1    tests/core-impl/collections/support/TestMemoryQueryMaker.h
M  +2    -1    tests/core-impl/meta/multi/TestMetaMultiTrack.h
M  +3    -0    tests/core/collections/support/TestTrackForUrlWorker.cpp
M  +1    -1    tests/core/collections/support/TestTrackForUrlWorker.h
M  +5    -5    tests/core/meta/TestMetaTrack.cpp
M  +2    -2    tests/core/meta/TestMetaTrack.h
M  +6    -1    tests/core/meta/support/TestMetaAlbumKey.cpp
M  +4    -1    tests/core/meta/support/TestMetaAlbumKey.h
M  +2    -1    tests/core/meta/support/TestMetaTrackKey.cpp
M  +6    -1    tests/core/meta/support/TestPrivateMetaRegistry.cpp
M  +4    -1    tests/core/meta/support/TestPrivateMetaRegistry.h
M  +2    -0    tests/mocks/MockTrackForUrlWorker.cpp
M  +2    -1    tests/scanner/TestGenericScanManager.cpp

http://commits.kde.org/amarok/c46ed13308ba695ba4027c5344593805d71121e0

diff --git a/playground/src/context/applets/coverbling/CoverBling.h b/playground/src/context/applets/coverbling/CoverBling.h
index c2a86d3..2b34075 100644
--- a/playground/src/context/applets/coverbling/CoverBling.h
+++ b/playground/src/context/applets/coverbling/CoverBling.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_COVERBLING_H
 #define AMAROK_COVERBLING_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QGLWidget>
 
diff --git a/playground/src/context/applets/coverbling/ImageLoader.cpp b/playground/src/context/applets/coverbling/ImageLoader.cpp
index 4155c72..197efa0 100644
--- a/playground/src/context/applets/coverbling/ImageLoader.cpp
+++ b/playground/src/context/applets/coverbling/ImageLoader.cpp
@@ -21,12 +21,15 @@
  */
 
 #include "ImageLoader.h"
+
+#include "core/meta/Meta.h"
+
 #include <qimage.h>
 #include <QPixmap>
+
 #include <KStandardDirs>
 // load and resize image
 
-
 ImageLoader::ImageLoader(): QThread(),
         restart( false ), working( false ), idx( -1 )
 {
diff --git a/playground/src/context/applets/coverbling/ImageLoader.h b/playground/src/context/applets/coverbling/ImageLoader.h
index 9a9d51b..87880ae 100644
--- a/playground/src/context/applets/coverbling/ImageLoader.h
+++ b/playground/src/context/applets/coverbling/ImageLoader.h
@@ -22,6 +22,9 @@
 
 #ifndef IMAGE_THUMBNAIL_H
 #define IMAGE_THUMBNAIL_H
+
+#include "core/meta/forward_declarations.h"
+
 #include <qimage.h>
 #include <qobject.h>
 #include <qsize.h>
@@ -30,7 +33,6 @@
 #include <qmutex.h>
 #include <qwaitcondition.h>
 
-#include "core/meta/Meta.h"
 class ImageLoader : public QThread
 {
 public:
diff --git a/playground/src/context/applets/coverbling/PhotoBrowser.h b/playground/src/context/applets/coverbling/PhotoBrowser.h
index eecbe71..569f826 100644
--- a/playground/src/context/applets/coverbling/PhotoBrowser.h
+++ b/playground/src/context/applets/coverbling/PhotoBrowser.h
@@ -24,29 +24,30 @@
 #define PHOTO_BROWSER_H
 
 #include "pictureflow.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 class PhotoBrowser: public PictureFlow
 {
   Q_OBJECT
 
 public:
-  explicit PhotoBrowser(QWidget* parent = 0, bool enableOpenGL = false);
-  virtual ~PhotoBrowser();
+    explicit PhotoBrowser(QWidget* parent = 0, bool enableOpenGL = false);
+    virtual ~PhotoBrowser();
 
-  void fillAlbums(Meta::AlbumList albums);
+    void fillAlbums(Meta::AlbumList albums);
 public slots:
-	void	fastForward();
-	void	fastBackward();
-	void 	skipToSlide(int iSlide); 
+    void fastForward();
+    void fastBackward();
+    void skipToSlide(int iSlide);
+
 private slots:
-  void preload();
-  void updateImageData();
+    void preload();
+    void updateImageData();
 
 private:
-  class Private;
-  Private *d;
-};  
+    class Private;
+    Private *d;
+};
 
 #endif // PHOTO_BROWSER_H
 
diff --git a/playground/src/context/applets/coverbling/pictureflow.cpp b/playground/src/context/applets/coverbling/pictureflow.cpp
index ee784e0..3cfdd29 100644
--- a/playground/src/context/applets/coverbling/pictureflow.cpp
+++ b/playground/src/context/applets/coverbling/pictureflow.cpp
@@ -24,8 +24,11 @@
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   THE SOFTWARE.
 */
+
 #include "pictureflow.h"
 
+#include "core/meta/Meta.h"
+
 #include <QApplication>
 #include <QCache>
 #include <QHash>
@@ -1167,3 +1170,4 @@ void PictureFlow::updateAnimation()
         emit centerIndexChanged( d->state->centerIndex );
 }
 
+#include "pictureflow.moc" // to have actual (non-forward) declaration of Meta::*
diff --git a/playground/src/context/applets/coverbling/pictureflow.h b/playground/src/context/applets/coverbling/pictureflow.h
index a339876..711cdb1 100644
--- a/playground/src/context/applets/coverbling/pictureflow.h
+++ b/playground/src/context/applets/coverbling/pictureflow.h
@@ -28,8 +28,9 @@
 #ifndef PICTUREFLOW_H
 #define PICTUREFLOW_H
 
+#include "core/meta/forward_declarations.h"
+
 #include <qwidget.h>
-#include "core/meta/Meta.h"
 #include <qpainter.h>
 #include <QHBoxLayout>
 //#include "CoverBling.h"
diff --git a/playground/src/context/applets/covergrid/AlbumItem.cpp b/playground/src/context/applets/covergrid/AlbumItem.cpp
index 9d9ac69..7be232d 100644
--- a/playground/src/context/applets/covergrid/AlbumItem.cpp
+++ b/playground/src/context/applets/covergrid/AlbumItem.cpp
@@ -15,18 +15,18 @@
  ****************************************************************************************/
 
 #include "AlbumItem.h"
-// Amarok
+
 #include "playlist/PlaylistModelStack.h"
 #include "core/meta/Meta.h"
 #include "playlist/PlaylistController.h"
-// Qt
+
 #include <QGraphicsPixmapItem>
 #include <QStyleOptionGraphicsItem>
 #include <QPaintEvent>
 #include <QPainter>
 #include <QPalette>
 #include <QImage>
-// Other
+
 #include <math.h>
 
 
@@ -49,6 +49,11 @@ AlbumItem::AlbumItem( const QPixmap & pixmap, Meta::AlbumPtr album , QWidget * p
     }
 }
 
+AlbumItem::~AlbumItem()
+{
+    // emit the destructor here where actual (non-forward) declaration of Meta::* is known
+}
+
 Meta::AlbumPtr AlbumItem::getAlbum()
 {
     return m_album;
diff --git a/playground/src/context/applets/covergrid/AlbumItem.h b/playground/src/context/applets/covergrid/AlbumItem.h
index 1f4df0f..5f1fef6 100644
--- a/playground/src/context/applets/covergrid/AlbumItem.h
+++ b/playground/src/context/applets/covergrid/AlbumItem.h
@@ -14,7 +14,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QLabel>
 
@@ -29,13 +29,15 @@ class AlbumItem : public QLabel
 
 public:
     AlbumItem( const QPixmap & pixmap, Meta::AlbumPtr album, QWidget * parent = 0, Qt::WindowFlags f = 0  );
+    ~AlbumItem();
+
     Meta::AlbumPtr getAlbum();
 
 protected :
     void mousePressEvent( QMouseEvent  * event );
-	void leaveEvent( QEvent * event);
-	void enterEvent( QEvent * event);
-	void mouseDoubleClickEvent( QMouseEvent * event );
+    void leaveEvent( QEvent * event);
+    void enterEvent( QEvent * event);
+    void mouseDoubleClickEvent( QMouseEvent * event );
 
 private:
     Meta::AlbumPtr m_album;
diff --git a/playground/src/context/applets/covergrid/CoverGridApplet.h b/playground/src/context/applets/covergrid/CoverGridApplet.h
index 3e41ca7..c8586c4 100644
--- a/playground/src/context/applets/covergrid/CoverGridApplet.h
+++ b/playground/src/context/applets/covergrid/CoverGridApplet.h
@@ -19,7 +19,7 @@
 
 #include "context/Applet.h"
 #include "ui_CoverGridSettings.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 class KConfigDialog;
 class QGraphicsProxyWidget;
@@ -39,7 +39,7 @@ class CoverGridApplet : public Context::Applet
         ~CoverGridApplet();
 
         void init();
-		bool hasHeightForWidth() const;
+        bool hasHeightForWidth() const;
 
     public slots:
         void slotAlbumQueryResult( Meta::AlbumList albums);
@@ -55,7 +55,7 @@ class CoverGridApplet : public Context::Applet
         QGraphicsProxyWidget * m_proxywidget;
         Plasma::ScrollWidget    *m_scroll;
         QGraphicsGridLayout * m_layout;
-		Meta::AlbumList m_album_list;
+        Meta::AlbumList m_album_list;
         Ui::CoverGridSettings ui_Settings;
         int m_coversize;
 };
diff --git a/src/AmarokMimeData.h b/src/AmarokMimeData.h
index 7638e90..512308b 100644
--- a/src/AmarokMimeData.h
+++ b/src/AmarokMimeData.h
@@ -19,7 +19,7 @@
 
 #include "amarok_export.h"
 #include "amarokurls/BookmarkGroup.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/playlists/Playlist.h"
 #include "core/podcasts/PodcastMeta.h"
 #include "core/collections/QueryMaker.h"
diff --git a/src/DirectoryLoader.h b/src/DirectoryLoader.h
index f227506..9a8d8a7 100644
--- a/src/DirectoryLoader.h
+++ b/src/DirectoryLoader.h
@@ -19,7 +19,7 @@
 #ifndef AMAROK_DIRECTORYLOADER_H
 #define AMAROK_DIRECTORYLOADER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/playlists/Playlist.h"
 
 #include <KFileItem>
diff --git a/src/GlobalCollectionActions.h b/src/GlobalCollectionActions.h
index 1326c7c..d161230 100644
--- a/src/GlobalCollectionActions.h
+++ b/src/GlobalCollectionActions.h
@@ -18,7 +18,7 @@
 #define GLOBALCOLLECTIONACTIONS_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/support/SmartPointerList.h"
 
 #include <QAction>
diff --git a/src/GlobalCurrentTrackActions.h b/src/GlobalCurrentTrackActions.h
index 7cdee2c..77ae954 100644
--- a/src/GlobalCurrentTrackActions.h
+++ b/src/GlobalCurrentTrackActions.h
@@ -18,7 +18,7 @@
 #define GLOBALCURRENTTRACKACTIONS_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/support/SmartPointerList.h"
 
 #include <QAction>
diff --git a/src/KNotificationBackend.h b/src/KNotificationBackend.h
index 856aadc..9f1b85d 100644
--- a/src/KNotificationBackend.h
+++ b/src/KNotificationBackend.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_KNOTIFICATIONBACKEND_H
 #define AMAROK_KNOTIFICATIONBACKEND_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QObject>
 #include <QPixmap>
diff --git a/src/LastfmReadLabelCapability.h b/src/LastfmReadLabelCapability.h
index 1081a9f..72fee35 100644
--- a/src/LastfmReadLabelCapability.h
+++ b/src/LastfmReadLabelCapability.h
@@ -18,7 +18,7 @@
 #ifndef LASTFMREADLABELCAPABILITY_H
 #define LASTFMREADLABELCAPABILITY_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/capabilities/Capability.h"
 #include "core/capabilities/ReadLabelCapability.h"
 
diff --git a/src/MainWindow.h b/src/MainWindow.h
index cd68333..403c669 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -21,7 +21,7 @@
 #include "config.h"
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "browsers/BrowserDock.h"
 
 #include <KMainWindow>
diff --git a/src/SvgHandler.h b/src/SvgHandler.h
index fc4f2d9..7e7cd45 100644
--- a/src/SvgHandler.h
+++ b/src/SvgHandler.h
@@ -19,19 +19,19 @@
 #ifndef SVGHANDLER_H
 #define SVGHANDLER_H
 
-class QStyleOptionSlider;
-
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QReadWriteLock>
 #include <QSvgRenderer>
 #include <KImageCache>
 
+#include <QHash>
 #include <QPixmap>
 #include <QString>
 
 class SvgHandler;
+class QStyleOptionSlider;
 
 namespace The {
     AMAROK_EXPORT SvgHandler* svgHandler();
diff --git a/src/TrayIcon.h b/src/TrayIcon.h
index 3b12c13..50406cc 100644
--- a/src/TrayIcon.h
+++ b/src/TrayIcon.h
@@ -21,7 +21,7 @@
 
 #include <KStatusNotifierItem> // baseclass
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/support/SmartPointerList.h"
 
 #include <QAction>
diff --git a/src/amarokurls/AmarokUrlHandler.h b/src/amarokurls/AmarokUrlHandler.h
index 119e29a..0d79b76 100644
--- a/src/amarokurls/AmarokUrlHandler.h
+++ b/src/amarokurls/AmarokUrlHandler.h
@@ -20,7 +20,7 @@
 #include "amarok_export.h"
 #include "AmarokUrlGenerator.h"
 #include "AmarokUrlRunnerBase.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "playlist/PlaylistViewUrlRunner.h"
 
 #include <KIcon>
diff --git a/src/amarokurls/BookmarkMetaActions.h b/src/amarokurls/BookmarkMetaActions.h
index 9b826e7..bbd3b08 100644
--- a/src/amarokurls/BookmarkMetaActions.h
+++ b/src/amarokurls/BookmarkMetaActions.h
@@ -18,7 +18,7 @@
 #define BOOKMARKMETAACTIONS_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QAction>
 
diff --git a/src/amarokurls/NavigationUrlGenerator.h b/src/amarokurls/NavigationUrlGenerator.h
index 1f76a57..61b7d80 100644
--- a/src/amarokurls/NavigationUrlGenerator.h
+++ b/src/amarokurls/NavigationUrlGenerator.h
@@ -19,7 +19,7 @@
 
 #include "amarok_export.h"
 #include "AmarokUrlGenerator.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 class AmarokUrl;
 
diff --git a/src/amarokurls/PlayUrlGenerator.h b/src/amarokurls/PlayUrlGenerator.h
index 770d714..edb9e6c 100644
--- a/src/amarokurls/PlayUrlGenerator.h
+++ b/src/amarokurls/PlayUrlGenerator.h
@@ -19,7 +19,7 @@
 
 #include "amarok_export.h"
 #include "AmarokUrlGenerator.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QString>
 
diff --git a/src/browsers/BrowserCategoryListSortFilterProxyModel.h b/src/browsers/BrowserCategoryListSortFilterProxyModel.h
index cd6cc2e..accd4eb 100644
--- a/src/browsers/BrowserCategoryListSortFilterProxyModel.h
+++ b/src/browsers/BrowserCategoryListSortFilterProxyModel.h
@@ -19,7 +19,7 @@
 
 #include <QSortFilterProxyModel>
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 class BrowserCategoryListSortFilterProxyModel : public QSortFilterProxyModel
 {
diff --git a/src/browsers/CollectionSortFilterProxyModel.cpp b/src/browsers/CollectionSortFilterProxyModel.cpp
index cf83fb6..660ea11 100644
--- a/src/browsers/CollectionSortFilterProxyModel.cpp
+++ b/src/browsers/CollectionSortFilterProxyModel.cpp
@@ -19,7 +19,8 @@
 #include "CollectionSortFilterProxyModel.h"
 
 #include "amarokconfig.h"
-#include "CollectionTreeItem.h"
+#include "browsers/CollectionTreeItem.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "widgets/PrettyTreeRoles.h"
 
diff --git a/src/browsers/CollectionSortFilterProxyModel.h b/src/browsers/CollectionSortFilterProxyModel.h
index c928a79..a341288 100644
--- a/src/browsers/CollectionSortFilterProxyModel.h
+++ b/src/browsers/CollectionSortFilterProxyModel.h
@@ -19,7 +19,7 @@
 #ifndef COLLECTIONSORTFILTERPROXYMODEL_H
 #define COLLECTIONSORTFILTERPROXYMODEL_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QSortFilterProxyModel>
 
diff --git a/src/browsers/CollectionTreeItem.cpp b/src/browsers/CollectionTreeItem.cpp
index e0abf3e..c65ade6 100644
--- a/src/browsers/CollectionTreeItem.cpp
+++ b/src/browsers/CollectionTreeItem.cpp
@@ -17,15 +17,16 @@
  ****************************************************************************************/
 
 #include "CollectionTreeItem.h"
-#include "CollectionTreeItemModelBase.h"
-#include "core/support/Debug.h"
-#include "amarokconfig.h"
 
-#include "widgets/PrettyTreeRoles.h"
+#include "amarokconfig.h"
+#include "browsers/CollectionTreeItemModelBase.h"
 #include "core/capabilities/ActionsCapability.h"
+#include "core/meta/Meta.h"
+#include "core/support/Debug.h"
+#include "widgets/PrettyTreeRoles.h"
 
-#include <KLocale>
 #include <KIcon>
+#include <KLocale>
 
 Q_DECLARE_METATYPE( QAction* )
 Q_DECLARE_METATYPE( QList<QAction*> )
@@ -334,6 +335,12 @@ CollectionTreeItem::operator<( const CollectionTreeItem& other ) const
     return m_data->sortableName() < other.m_data->sortableName();
 }
 
+const Meta::DataPtr
+CollectionTreeItem::data() const
+{
+    return m_data;
+}
+
 QList<Meta::TrackPtr>
 CollectionTreeItem::descendentTracks()
 {
diff --git a/src/browsers/CollectionTreeItem.h b/src/browsers/CollectionTreeItem.h
index e8acdc6..0a5d197 100644
--- a/src/browsers/CollectionTreeItem.h
+++ b/src/browsers/CollectionTreeItem.h
@@ -18,16 +18,17 @@
 #ifndef COLLECTIONTREEITEM_H
 #define COLLECTIONTREEITEM_H
 
-#include "BrowserDefines.h"
+#include "amarok_export.h"
+#include "browsers/BrowserDefines.h"
 #include "core/collections/Collection.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QList>
 
 class CollectionTreeItemModelBase;
 class QAction;
 
-class CollectionTreeItem : public QObject
+class AMAROK_EXPORT CollectionTreeItem : public QObject
 {
     Q_OBJECT
     Q_ENUMS( Type )
@@ -84,11 +85,11 @@ class CollectionTreeItem : public QObject
          *        CategoryId::CatMenuId enum. Used only for distinction between Artist and
          *        AlbumArtist.
          */
-        void addMatch( Collections::QueryMaker* qm, CategoryId::CatMenuId levelCategory ) const;
+        void addMatch( Collections::QueryMaker *qm, CategoryId::CatMenuId levelCategory ) const;
 
-        bool operator<( const CollectionTreeItem& other ) const;
+        bool operator<( const CollectionTreeItem &other ) const;
 
-        const Meta::DataPtr data() const { return m_data; }
+        const Meta::DataPtr data() const;
         Collections::Collection* parentCollection() const { return m_parentCollection ? m_parentCollection : (m_parent ? m_parent->parentCollection() : 0); }
 
         KUrl::List urls() const;
diff --git a/src/browsers/CollectionTreeItemModel.h b/src/browsers/CollectionTreeItemModel.h
index eee2a0a..afc534a 100644
--- a/src/browsers/CollectionTreeItemModel.h
+++ b/src/browsers/CollectionTreeItemModel.h
@@ -20,7 +20,7 @@
 #define COLLECTIONTREEITEMMODEL_H
 
 #include "CollectionTreeItemModelBase.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include "core/collections/Collection.h"
 
diff --git a/src/browsers/CollectionTreeItemModelBase.h b/src/browsers/CollectionTreeItemModelBase.h
index dd81a83..f614696 100644
--- a/src/browsers/CollectionTreeItemModelBase.h
+++ b/src/browsers/CollectionTreeItemModelBase.h
@@ -22,7 +22,7 @@
 #include "amarok_export.h"
 
 #include "core/collections/QueryMaker.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "CollectionTreeItem.h"
 
 #include <QAbstractItemModel>
diff --git a/src/browsers/CollectionTreeView.h b/src/browsers/CollectionTreeView.h
index 3b2ca80..1487d8e 100644
--- a/src/browsers/CollectionTreeView.h
+++ b/src/browsers/CollectionTreeView.h
@@ -19,7 +19,7 @@
 
 #include "BrowserDefines.h"
 #include "widgets/PrettyTreeView.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "playlist/PlaylistController.h"
 
 #include <QModelIndex>
@@ -31,6 +31,10 @@ class CollectionSortFilterProxyModel;
 class CollectionTreeItemModelBase;
 class CollectionTreeItem;
 class PopupDropper;
+namespace Collections {
+    class Collection;
+    class QueryMaker;
+}
 class QAction;
 class QSortFilterProxyModel;
 
diff --git a/src/browsers/SingleCollectionTreeItemModel.cpp b/src/browsers/SingleCollectionTreeItemModel.cpp
index 1a566c4..32a266d 100644
--- a/src/browsers/SingleCollectionTreeItemModel.cpp
+++ b/src/browsers/SingleCollectionTreeItemModel.cpp
@@ -16,18 +16,19 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "SingleCollectionTreeItemModel"
-
 #include "SingleCollectionTreeItemModel.h"
 
-#include <amarokconfig.h>
-#include "core/support/Amarok.h"
+#include "amarokconfig.h"
+#include "browsers/CollectionTreeItem.h"
 #include "core/collections/Collection.h"
-#include "CollectionTreeItem.h"
+#include "core/meta/Meta.h"
+#include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 
 #include <KLocale>
 
+#define DEBUG_PREFIX "SingleCollectionTreeItemModel"
+
 SingleCollectionTreeItemModel::SingleCollectionTreeItemModel( Collections::Collection *collection,
                                                               const QList<CategoryId::CatMenuId> &levelType )
     :CollectionTreeItemModelBase( )
diff --git a/src/browsers/SingleCollectionTreeItemModel.h b/src/browsers/SingleCollectionTreeItemModel.h
index 3072e08..8afd050 100644
--- a/src/browsers/SingleCollectionTreeItemModel.h
+++ b/src/browsers/SingleCollectionTreeItemModel.h
@@ -21,7 +21,7 @@
 
 #include "amarok_export.h"
 #include "CollectionTreeItemModelBase.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QAbstractItemModel>
 #include <QMap>
diff --git a/src/browsers/filebrowser/FileView.h b/src/browsers/filebrowser/FileView.h
index df8fbee..cb294b2 100644
--- a/src/browsers/filebrowser/FileView.h
+++ b/src/browsers/filebrowser/FileView.h
@@ -19,7 +19,7 @@
 #define AMAROK_FILEVIEW_H
 
 #include "core/collections/Collection.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "playlist/PlaylistController.h"
 #include "widgets/PrettyTreeView.h"
 
diff --git a/src/browsers/playlistbrowser/UserPlaylistModel.h b/src/browsers/playlistbrowser/UserPlaylistModel.h
index f6eb9fb..3c17319 100644
--- a/src/browsers/playlistbrowser/UserPlaylistModel.h
+++ b/src/browsers/playlistbrowser/UserPlaylistModel.h
@@ -19,7 +19,7 @@
 
 #include "amarok_export.h"
 #include "browsers/playlistbrowser/PlaylistBrowserModel.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/playlists/Playlist.h"
 
 #include <QAction>
diff --git a/src/configdialog/dialogs/ExcludedLabelsDialog.cpp b/src/configdialog/dialogs/ExcludedLabelsDialog.cpp
index 2764a0e..fb237d9 100644
--- a/src/configdialog/dialogs/ExcludedLabelsDialog.cpp
+++ b/src/configdialog/dialogs/ExcludedLabelsDialog.cpp
@@ -16,6 +16,7 @@
 
 #include "ExcludedLabelsDialog.h"
 
+#include "core/meta/Meta.h"
 #include "core-impl/collections/support/CollectionManager.h"
 #include "statsyncing/Config.h"
 
diff --git a/src/configdialog/dialogs/ExcludedLabelsDialog.h b/src/configdialog/dialogs/ExcludedLabelsDialog.h
index 9c41083..3f11e88 100644
--- a/src/configdialog/dialogs/ExcludedLabelsDialog.h
+++ b/src/configdialog/dialogs/ExcludedLabelsDialog.h
@@ -18,7 +18,7 @@
 #define EXCLUDEDLABELSDIALOG_H
 
 #include "ui_ExcludedLabelsDialog.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KDialog>
 
diff --git a/src/context/applets/albums/Albums.h b/src/context/applets/albums/Albums.h
index 033613a..f4074c3 100644
--- a/src/context/applets/albums/Albums.h
+++ b/src/context/applets/albums/Albums.h
@@ -21,7 +21,7 @@
 
 #include "context/Applet.h"
 #include "context/DataEngine.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QGraphicsLinearLayout>
 
diff --git a/src/context/applets/albums/AlbumsModel.h b/src/context/applets/albums/AlbumsModel.h
index ab23887..872cfd6 100644
--- a/src/context/applets/albums/AlbumsModel.h
+++ b/src/context/applets/albums/AlbumsModel.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_ALBUMSMODEL_H
 #define AMAROK_ALBUMSMODEL_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QStandardItemModel>
 #include <QSortFilterProxyModel>
diff --git a/src/context/applets/albums/AlbumsView.h b/src/context/applets/albums/AlbumsView.h
index c15e7b6..5ea4e5b 100644
--- a/src/context/applets/albums/AlbumsView.h
+++ b/src/context/applets/albums/AlbumsView.h
@@ -18,7 +18,7 @@
 #ifndef AMAROK_ALBUMSVIEW_H
 #define AMAROK_ALBUMSVIEW_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "AlbumsModel.h"
 
 #include <QGraphicsWidget>
diff --git a/src/context/applets/currenttrack/CurrentTrack.h b/src/context/applets/currenttrack/CurrentTrack.h
index e023e91..aad233d 100644
--- a/src/context/applets/currenttrack/CurrentTrack.h
+++ b/src/context/applets/currenttrack/CurrentTrack.h
@@ -20,7 +20,7 @@
 #define CURRENT_TRACK_APPLET_H
 
 #include "context/Applet.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "ui_currentTrackSettings.h"
 
 #include <Plasma/DataEngine>
diff --git a/src/context/applets/similarartists/ArtistWidget.cpp b/src/context/applets/similarartists/ArtistWidget.cpp
index da38375..f553131 100644
--- a/src/context/applets/similarartists/ArtistWidget.cpp
+++ b/src/context/applets/similarartists/ArtistWidget.cpp
@@ -20,15 +20,16 @@
 #include "ArtistWidget.h"
 
 //Amarok
+#include "PaletteHandler.h"
+#include "SvgHandler.h"
 #include "amarokurls/AmarokUrl.h"
 #include "core/collections/Collection.h"
-#include "core-impl/collections/support/CollectionManager.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
+#include "core-impl/collections/support/CollectionManager.h"
 #include "playlist/PlaylistController.h"
-#include "PaletteHandler.h"
-#include "SvgHandler.h"
 
 //KDE
 #include <KColorUtils>
diff --git a/src/context/applets/similarartists/ArtistWidget.h b/src/context/applets/similarartists/ArtistWidget.h
index dc73672..c819d06 100644
--- a/src/context/applets/similarartists/ArtistWidget.h
+++ b/src/context/applets/similarartists/ArtistWidget.h
@@ -18,7 +18,7 @@
 #ifndef ARTIST_WIDGET_H
 #define ARTIST_WIDGET_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "network/NetworkAccessManagerProxy.h"
 #include "SimilarArtist.h"
 
diff --git a/src/context/engines/current/CurrentEngine.h b/src/context/engines/current/CurrentEngine.h
index 1f5975b..7784529 100644
--- a/src/context/engines/current/CurrentEngine.h
+++ b/src/context/engines/current/CurrentEngine.h
@@ -18,7 +18,11 @@
 #define AMAROK_CURRENT_ENGINE
 
 #include "context/DataEngine.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
+
+namespace Collections {
+    class QueryMaker;
+}
 
 /**
     This class provides context information on the currently playing track.
diff --git a/src/context/engines/labels/LabelsEngine.h b/src/context/engines/labels/LabelsEngine.h
index b4199d5..c2c23f6 100644
--- a/src/context/engines/labels/LabelsEngine.h
+++ b/src/context/engines/labels/LabelsEngine.h
@@ -20,7 +20,7 @@
 
 #include "ContextObserver.h"
 #include "context/DataEngine.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "network/NetworkAccessManagerProxy.h"
 
 #include <QMap>
diff --git a/src/context/engines/lyrics/LyricsEngine.h b/src/context/engines/lyrics/LyricsEngine.h
index b187b73..97cf413 100644
--- a/src/context/engines/lyrics/LyricsEngine.h
+++ b/src/context/engines/lyrics/LyricsEngine.h
@@ -20,7 +20,7 @@
 
 #include "context/DataEngine.h"
 #include "context/LyricsManager.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 /**
     This class provides Lyrics data for use in Context applets. 
diff --git a/src/context/engines/similarartists/SimilarArtistsEngine.h b/src/context/engines/similarartists/SimilarArtistsEngine.h
index 7161646..689ff9b 100644
--- a/src/context/engines/similarartists/SimilarArtistsEngine.h
+++ b/src/context/engines/similarartists/SimilarArtistsEngine.h
@@ -22,7 +22,7 @@
 #include "NetworkAccessManagerProxy.h"
 #include "context/DataEngine.h"
 #include "context/applets/similarartists/SimilarArtist.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 using namespace Context;
 
diff --git a/src/context/engines/songkick/SongkickEngine.h b/src/context/engines/songkick/SongkickEngine.h
index 43c9364..e8f31e9 100644
--- a/src/context/engines/songkick/SongkickEngine.h
+++ b/src/context/engines/songkick/SongkickEngine.h
@@ -20,7 +20,7 @@
 
 #include "ContextObserver.h"
 #include "context/DataEngine.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <kio/job.h>
 
diff --git a/src/context/engines/tabs/TabsEngine.h b/src/context/engines/tabs/TabsEngine.h
index 31b10d1..2041c99 100644
--- a/src/context/engines/tabs/TabsEngine.h
+++ b/src/context/engines/tabs/TabsEngine.h
@@ -20,7 +20,7 @@
 #include "TabsInfo.h"
 
 #include "context/DataEngine.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "NetworkAccessManagerProxy.h"
 
 #include <QVariant>
diff --git a/src/context/engines/upcomingevents/UpcomingEventsEngine.h b/src/context/engines/upcomingevents/UpcomingEventsEngine.h
index fe46269..9b7d86d 100644
--- a/src/context/engines/upcomingevents/UpcomingEventsEngine.h
+++ b/src/context/engines/upcomingevents/UpcomingEventsEngine.h
@@ -21,7 +21,7 @@
 
 #include "context/applets/upcomingevents/LastFmEvent.h"
 #include "context/DataEngine.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "network/NetworkAccessManagerProxy.h"
 
 // Qt
diff --git a/src/context/engines/wikipedia/WikipediaEngine.h b/src/context/engines/wikipedia/WikipediaEngine.h
index 6f2e77c..2a18c0b 100644
--- a/src/context/engines/wikipedia/WikipediaEngine.h
+++ b/src/context/engines/wikipedia/WikipediaEngine.h
@@ -19,7 +19,7 @@
 #ifndef AMAROK_WIKIPEDIA_ENGINE
 #define AMAROK_WIKIPEDIA_ENGINE
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "context/DataEngine.h"
 #include "NetworkAccessManagerProxy.h"
 
diff --git a/src/context/widgets/RecentlyPlayedListWidget.h b/src/context/widgets/RecentlyPlayedListWidget.h
index 37032cb..caa7803 100644
--- a/src/context/widgets/RecentlyPlayedListWidget.h
+++ b/src/context/widgets/RecentlyPlayedListWidget.h
@@ -17,7 +17,7 @@
 #ifndef RECENTLYPLAYEDLISTWIDGET_H
 #define RECENTLYPLAYEDLISTWIDGET_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KIcon>
 #include <Plasma/ScrollWidget>
diff --git a/src/context/widgets/TrackWidget.h b/src/context/widgets/TrackWidget.h
index 83f1cfd..0fa9b78 100644
--- a/src/context/widgets/TrackWidget.h
+++ b/src/context/widgets/TrackWidget.h
@@ -18,7 +18,7 @@
 #define TRACK_WIDGET_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "RatingWidget.h"
 #include "ToolBoxIcon.h"
 
diff --git a/src/core-impl/capabilities/AlbumActionsCapability.cpp b/src/core-impl/capabilities/AlbumActionsCapability.cpp
index c647eda..5d5f405 100644
--- a/src/core-impl/capabilities/AlbumActionsCapability.cpp
+++ b/src/core-impl/capabilities/AlbumActionsCapability.cpp
@@ -15,12 +15,13 @@
  ****************************************************************************************/
 
 #include "AlbumActionsCapability.h"
+
+#include "core/meta/Meta.h"
 #include "covermanager/CoverFetchingActions.h"
 
 #include <KIcon>
 #include <KLocalizedString>
 
-
 class CompilationAction : public QAction
 {
     Q_OBJECT
diff --git a/src/core-impl/capabilities/AlbumActionsCapability.h b/src/core-impl/capabilities/AlbumActionsCapability.h
index a23c030..226faea 100644
--- a/src/core-impl/capabilities/AlbumActionsCapability.h
+++ b/src/core-impl/capabilities/AlbumActionsCapability.h
@@ -19,7 +19,7 @@
 
 #include "amarok_export.h"
 #include "core/capabilities/ActionsCapability.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 namespace Capabilities
 {
diff --git a/src/core-impl/capabilities/timecode/TimecodeLoadCapability.h b/src/core-impl/capabilities/timecode/TimecodeLoadCapability.h
index 36c20b5..17b935b 100644
--- a/src/core-impl/capabilities/timecode/TimecodeLoadCapability.h
+++ b/src/core-impl/capabilities/timecode/TimecodeLoadCapability.h
@@ -18,7 +18,7 @@
 #define TIMECODELOADCAPABILITY_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/capabilities/Capability.h"
 #include "amarokurls/AmarokUrl.h"
 
diff --git a/src/core-impl/capabilities/timecode/TimecodeWriteCapability.h b/src/core-impl/capabilities/timecode/TimecodeWriteCapability.h
index 626c4d6..40127bc 100644
--- a/src/core-impl/capabilities/timecode/TimecodeWriteCapability.h
+++ b/src/core-impl/capabilities/timecode/TimecodeWriteCapability.h
@@ -18,7 +18,7 @@
 #define TIMECODEWRITECAPABILITY_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/capabilities/Capability.h"
 
 namespace Capabilities
diff --git a/src/core-impl/collections/db/sql/SqlQueryMakerInternal.h b/src/core-impl/collections/db/sql/SqlQueryMakerInternal.h
index 70accca..417b6f9 100644
--- a/src/core-impl/collections/db/sql/SqlQueryMakerInternal.h
+++ b/src/core-impl/collections/db/sql/SqlQueryMakerInternal.h
@@ -18,7 +18,7 @@
 #define SQLQUERYMAKERINTERNAL_H
 
 #include "core/collections/QueryMaker.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QObject>
 #include <QWeakPointer>
diff --git a/src/core-impl/collections/ipodcollection/IpodCollection.h b/src/core-impl/collections/ipodcollection/IpodCollection.h
index 8307670..6b2081b 100644
--- a/src/core-impl/collections/ipodcollection/IpodCollection.h
+++ b/src/core-impl/collections/ipodcollection/IpodCollection.h
@@ -19,7 +19,7 @@
 
 #include "ui_IpodConfiguration.h"
 #include "core/collections/Collection.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QMutex>
 #include <QSharedPointer>
diff --git a/src/core-impl/collections/ipodcollection/jobs/IpodCopyTracksJob.h b/src/core-impl/collections/ipodcollection/jobs/IpodCopyTracksJob.h
index bac72bc..0258bf2 100644
--- a/src/core-impl/collections/ipodcollection/jobs/IpodCopyTracksJob.h
+++ b/src/core-impl/collections/ipodcollection/jobs/IpodCopyTracksJob.h
@@ -18,7 +18,7 @@
 #define COPYTRACKSJOB_H
 
 #include "IpodCollection.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/transcoding/TranscodingConfiguration.h"
 
 #include <ThreadWeaver/Job>
diff --git a/src/core-impl/collections/ipodcollection/jobs/IpodDeleteTracksJob.h b/src/core-impl/collections/ipodcollection/jobs/IpodDeleteTracksJob.h
index 20623db..2e0803d 100644
--- a/src/core-impl/collections/ipodcollection/jobs/IpodDeleteTracksJob.h
+++ b/src/core-impl/collections/ipodcollection/jobs/IpodDeleteTracksJob.h
@@ -18,7 +18,7 @@
 #define IPODDELETETRACKSJOB_H
 
 #include "IpodCollection.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <ThreadWeaver/Job>
 
diff --git a/src/core-impl/collections/ipodcollection/jobs/IpodParseTracksJob.h b/src/core-impl/collections/ipodcollection/jobs/IpodParseTracksJob.h
index edaa6a2..b6283a7 100644
--- a/src/core-impl/collections/ipodcollection/jobs/IpodParseTracksJob.h
+++ b/src/core-impl/collections/ipodcollection/jobs/IpodParseTracksJob.h
@@ -17,7 +17,7 @@
 #ifndef IPODPARSETRACKSJOB_H
 #define IPODPARSETRACKSJOB_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <ThreadWeaver/Job>
 
diff --git a/src/core-impl/collections/nepomukcollection/NepomukConstructMetaJob.h b/src/core-impl/collections/nepomukcollection/NepomukConstructMetaJob.h
index 3316733..66e2473 100644
--- a/src/core-impl/collections/nepomukcollection/NepomukConstructMetaJob.h
+++ b/src/core-impl/collections/nepomukcollection/NepomukConstructMetaJob.h
@@ -17,7 +17,7 @@
 #ifndef NEPOMUKCONSTRUCTMETAJOB_H
 #define NEPOMUKCONSTRUCTMETAJOB_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaKeys.h"
 #include "core-impl/collections/support/MemoryCollection.h"
 
diff --git a/src/core-impl/collections/playdarcollection/PlaydarQueryMaker.h b/src/core-impl/collections/playdarcollection/PlaydarQueryMaker.h
index dd83477..1076eb3 100644
--- a/src/core-impl/collections/playdarcollection/PlaydarQueryMaker.h
+++ b/src/core-impl/collections/playdarcollection/PlaydarQueryMaker.h
@@ -25,7 +25,7 @@
 #include "support/Query.h"
 #include "support/QMFunctionTypes.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaConstants.h"
 #include "core/collections/QueryMaker.h"
 
diff --git a/src/core-impl/collections/playdarcollection/support/Query.h b/src/core-impl/collections/playdarcollection/support/Query.h
index 4a70b46..58fa233 100644
--- a/src/core-impl/collections/playdarcollection/support/Query.h
+++ b/src/core-impl/collections/playdarcollection/support/Query.h
@@ -18,7 +18,7 @@
 #define PLAYDAR_QUERYOBJECT_H
 
 #include "Controller.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "../PlaydarMeta.h"
 
 #include <QWeakPointer>
diff --git a/src/core-impl/collections/proxycollection/ProxyCollection.h b/src/core-impl/collections/proxycollection/ProxyCollection.h
index a0141b3..537882d 100644
--- a/src/core-impl/collections/proxycollection/ProxyCollection.h
+++ b/src/core-impl/collections/proxycollection/ProxyCollection.h
@@ -21,7 +21,7 @@
 
 #include "core/collections/Collection.h"
 #include "core-impl/collections/support/CollectionManager.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaKeys.h"
 
 #include <QString>
diff --git a/src/core-impl/collections/support/CollectionManager.h b/src/core-impl/collections/support/CollectionManager.h
index 72aab0b..a3cb6ce 100644
--- a/src/core-impl/collections/support/CollectionManager.h
+++ b/src/core-impl/collections/support/CollectionManager.h
@@ -19,13 +19,14 @@
 
 #include "amarok_export.h"
 #include "core/collections/Collection.h"
-#include "core/meta/Meta.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KService>
 
 #include <QList>
 #include <QObject>
+#include <QSet>
 
 class SqlStorage;
 class CollectionManagerSingleton;
diff --git a/src/core-impl/collections/support/MemoryCustomValue.cpp b/src/core-impl/collections/support/MemoryCustomValue.cpp
index 43a1d3a..04d3383 100644
--- a/src/core-impl/collections/support/MemoryCustomValue.cpp
+++ b/src/core-impl/collections/support/MemoryCustomValue.cpp
@@ -16,6 +16,7 @@
 
 #include "MemoryCustomValue.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 
 #include <QSet>
diff --git a/src/core-impl/collections/support/MemoryCustomValue.h b/src/core-impl/collections/support/MemoryCustomValue.h
index 552d8b8..1269f1d 100644
--- a/src/core-impl/collections/support/MemoryCustomValue.h
+++ b/src/core-impl/collections/support/MemoryCustomValue.h
@@ -18,7 +18,7 @@
 #define MEMORYCUSTOMVALUE_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/collections/QueryMaker.h"
 
 #include <QList>
diff --git a/src/core-impl/collections/support/MemoryFilter.cpp b/src/core-impl/collections/support/MemoryFilter.cpp
index b18f24c..c3a5e0d 100644
--- a/src/core-impl/collections/support/MemoryFilter.cpp
+++ b/src/core-impl/collections/support/MemoryFilter.cpp
@@ -16,6 +16,7 @@
 
 #include "MemoryFilter.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaConstants.h"
 
 #include <QDateTime>
diff --git a/src/core-impl/collections/support/MemoryFilter.h b/src/core-impl/collections/support/MemoryFilter.h
index 5a17307..f5227b4 100644
--- a/src/core-impl/collections/support/MemoryFilter.h
+++ b/src/core-impl/collections/support/MemoryFilter.h
@@ -18,7 +18,7 @@
 #define MEMORYFILTER_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/collections/QueryMaker.h"
 
 #include <QList>
diff --git a/src/core-impl/collections/support/MemoryMatcher.h b/src/core-impl/collections/support/MemoryMatcher.h
index e3566f6..335589c 100644
--- a/src/core-impl/collections/support/MemoryMatcher.h
+++ b/src/core-impl/collections/support/MemoryMatcher.h
@@ -21,7 +21,7 @@
 #include "amarok_export.h"
 #include "MemoryCollection.h"
 #include "core/collections/QueryMaker.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 /**
 A helper class for finding items in a MemoryCollection
diff --git a/src/core-impl/collections/support/MemoryQueryMakerHelper.h b/src/core-impl/collections/support/MemoryQueryMakerHelper.h
index 83a3bdf..2039e49 100644
--- a/src/core-impl/collections/support/MemoryQueryMakerHelper.h
+++ b/src/core-impl/collections/support/MemoryQueryMakerHelper.h
@@ -18,7 +18,7 @@
 #define MEMORYQUERYMAKERHELPER_H
 
 #include <QList>
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 namespace Collections {
 
diff --git a/src/core-impl/collections/support/MemoryQueryMakerInternal.h b/src/core-impl/collections/support/MemoryQueryMakerInternal.h
index 4409c9e..702a417 100644
--- a/src/core-impl/collections/support/MemoryQueryMakerInternal.h
+++ b/src/core-impl/collections/support/MemoryQueryMakerInternal.h
@@ -18,7 +18,7 @@
 #define MEMORYQUERYMAKERINTERNAL_H
 
 #include "core/collections/QueryMaker.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QObject>
 #include <QWeakPointer>
diff --git a/src/core-impl/collections/support/TextualQueryFilter.h b/src/core-impl/collections/support/TextualQueryFilter.h
index 4763d75..1c3bd35 100644
--- a/src/core-impl/collections/support/TextualQueryFilter.h
+++ b/src/core-impl/collections/support/TextualQueryFilter.h
@@ -23,7 +23,7 @@
 #include "amarok_export.h"
 
 #include "browsers/CollectionTreeItem.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/collections/QueryMaker.h"
 
 #include <QAbstractItemModel>
diff --git a/src/core-impl/collections/upnpcollection/UpnpCache.h b/src/core-impl/collections/upnpcollection/UpnpCache.h
index 57d9335..0736cea 100644
--- a/src/core-impl/collections/upnpcollection/UpnpCache.h
+++ b/src/core-impl/collections/upnpcollection/UpnpCache.h
@@ -20,7 +20,7 @@
 
 #include <kio/udsentry.h>
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core-impl/collections/support/MemoryCollection.h"
 
 
diff --git a/src/core-impl/meta/cue/CueFileSupport.h b/src/core-impl/meta/cue/CueFileSupport.h
index 1bc8ab3..e8699cc 100644
--- a/src/core-impl/meta/cue/CueFileSupport.h
+++ b/src/core-impl/meta/cue/CueFileSupport.h
@@ -18,7 +18,7 @@
 #ifndef CUEFILESUPPORT_H
 #define CUEFILESUPPORT_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KUrl>
 
diff --git a/src/core-impl/meta/proxy/MetaProxyWorker.cpp b/src/core-impl/meta/proxy/MetaProxyWorker.cpp
index 54da675..de4422e 100644
--- a/src/core-impl/meta/proxy/MetaProxyWorker.cpp
+++ b/src/core-impl/meta/proxy/MetaProxyWorker.cpp
@@ -16,6 +16,7 @@
 
 #include "MetaProxyWorker.h"
 
+#include "core/meta/Meta.h"
 #include "core-impl/collections/support/CollectionManager.h"
 
 using namespace MetaProxy;
diff --git a/src/core-impl/playlists/types/file/PlaylistFile.h b/src/core-impl/playlists/types/file/PlaylistFile.h
index 0358196..de71057 100644
--- a/src/core-impl/playlists/types/file/PlaylistFile.h
+++ b/src/core-impl/playlists/types/file/PlaylistFile.h
@@ -19,7 +19,7 @@
 
 #include "amarok_export.h"
 #include "core/playlists/Playlist.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core-impl/meta/proxy/MetaProxy.h"
 
 #include <QMutex>
diff --git a/src/core-impl/playlists/types/file/PlaylistFileSupport.h b/src/core-impl/playlists/types/file/PlaylistFileSupport.h
index 2ed3bab..8335a24 100644
--- a/src/core-impl/playlists/types/file/PlaylistFileSupport.h
+++ b/src/core-impl/playlists/types/file/PlaylistFileSupport.h
@@ -18,7 +18,7 @@
 #define AMAROK_META_PLAYLISTFILESUPPORT_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core-impl/playlists/types/file/PlaylistFile.h"
 
 namespace Playlists
diff --git a/src/core/capabilities/ReadLabelCapability.h b/src/core/capabilities/ReadLabelCapability.h
index 9bf9c6c..be2295d 100644
--- a/src/core/capabilities/ReadLabelCapability.h
+++ b/src/core/capabilities/ReadLabelCapability.h
@@ -19,7 +19,7 @@
 
 #include "core/amarokcore_export.h"
 #include "core/capabilities/Capability.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QStringList>
 
diff --git a/src/core/capabilities/SourceInfoCapability.h b/src/core/capabilities/SourceInfoCapability.h
index b3414db..52aae81 100644
--- a/src/core/capabilities/SourceInfoCapability.h
+++ b/src/core/capabilities/SourceInfoCapability.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License along with         *
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
- 
+
 #ifndef SOURCEINFOCAPABILITY_H
 #define SOURCEINFOCAPABILITY_H
 
diff --git a/src/core/capabilities/WriteLabelCapability.h b/src/core/capabilities/WriteLabelCapability.h
index 51f1910..2970752 100644
--- a/src/core/capabilities/WriteLabelCapability.h
+++ b/src/core/capabilities/WriteLabelCapability.h
@@ -19,7 +19,7 @@
 
 #include "core/amarokcore_export.h"
 #include "core/capabilities/Capability.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 namespace Capabilities
 {
diff --git a/src/core/collections/CollectionLocation.cpp b/src/core/collections/CollectionLocation.cpp
index a773b19..2385570 100644
--- a/src/core/collections/CollectionLocation.cpp
+++ b/src/core/collections/CollectionLocation.cpp
@@ -24,6 +24,7 @@
 #include "core/collections/Collection.h"
 #include "core/collections/CollectionLocationDelegate.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "core/support/Components.h"
 #include "core/support/Debug.h"
 #include "core/transcoding/TranscodingConfiguration.h"
diff --git a/src/core/collections/CollectionLocation.h b/src/core/collections/CollectionLocation.h
index d37ccfb..7a1ed1e 100644
--- a/src/core/collections/CollectionLocation.h
+++ b/src/core/collections/CollectionLocation.h
@@ -20,7 +20,7 @@
 #define AMAROK_COLLECTIONLOCATION_H
 
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/transcoding/TranscodingConfiguration.h"
 
 #include <QList>
@@ -29,6 +29,7 @@
 #include <KUrl>
 
 namespace Collections {
+    class Collection;
     class QueryMaker;
 
 /**
@@ -397,7 +398,7 @@ class AMAROK_CORE_EXPORT CollectionLocation : public QObject
         void setSource( CollectionLocation *source );
 
         //only used in the source CollectionLocation
-        CollectionLocation * m_destination;
+        CollectionLocation *m_destination;
         //only used in destination CollectionLocation
         CollectionLocation *m_source;
 
diff --git a/src/core/collections/CollectionLocationDelegate.h b/src/core/collections/CollectionLocationDelegate.h
index b5d8c5e..3c80d07 100644
--- a/src/core/collections/CollectionLocationDelegate.h
+++ b/src/core/collections/CollectionLocationDelegate.h
@@ -19,7 +19,7 @@
 #define COLLECTIONLOCATIONDELEGATE_H
 
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/transcoding/TranscodingConfiguration.h"
 
 namespace Collections {
diff --git a/src/core/collections/QueryMaker.cpp b/src/core/collections/QueryMaker.cpp
index 09a4e76..e71e97f 100644
--- a/src/core/collections/QueryMaker.cpp
+++ b/src/core/collections/QueryMaker.cpp
@@ -19,6 +19,7 @@
 
 using namespace Collections;
 
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 
 QueryMaker::QueryMaker() : QObject()
diff --git a/src/core/collections/QueryMaker.h b/src/core/collections/QueryMaker.h
index efefab4..92b6a65 100644
--- a/src/core/collections/QueryMaker.h
+++ b/src/core/collections/QueryMaker.h
@@ -18,7 +18,7 @@
 #define AMAROK_COLLECTION_QUERYMAKER_H
 
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaConstants.h"
 
 #include <QObject>
diff --git a/src/core/collections/support/TrackForUrlWorker.cpp b/src/core/collections/support/TrackForUrlWorker.cpp
index 4a8ad69..4855d30 100644
--- a/src/core/collections/support/TrackForUrlWorker.cpp
+++ b/src/core/collections/support/TrackForUrlWorker.cpp
@@ -16,6 +16,8 @@
 
 #include "TrackForUrlWorker.h"
 
+#include "core/meta/Meta.h"
+
 Amarok::TrackForUrlWorker::TrackForUrlWorker( const KUrl &url )
     : ThreadWeaver::Job()
     , m_url( url )
diff --git a/src/core/collections/support/TrackForUrlWorker.h b/src/core/collections/support/TrackForUrlWorker.h
index 1621f92..7696a14 100644
--- a/src/core/collections/support/TrackForUrlWorker.h
+++ b/src/core/collections/support/TrackForUrlWorker.h
@@ -19,7 +19,7 @@
 
 #include "core/amarokcore_export.h"
 #include "core/support/Amarok.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KUrl>
 
diff --git a/src/core/meta/Meta.h b/src/core/meta/Meta.h
index 26226e5..58d12cb 100644
--- a/src/core/meta/Meta.h
+++ b/src/core/meta/Meta.h
@@ -18,10 +18,10 @@
 #ifndef AMAROK_META_H
 #define AMAROK_META_H
 
-#include "core/amarokcore_export.h"
 #include "MetaReplayGain.h"
-
+#include "core/amarokcore_export.h"
 #include "core/interfaces/MetaCapability.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QList>
 #include <QMetaType>
@@ -45,39 +45,9 @@ class PersistentStatisticsStore;
 
 namespace Meta
 {
-    class Base;
-    class Track;
-    class Artist;
-    class Album;
-    class Genre;
-    class Composer;
-    class Year;
-    class Label;
-
-    class Statistics;
-    typedef KSharedPtr<Statistics> StatisticsPtr;
-    typedef KSharedPtr<const Statistics> ConstStatisticsPtr;
-
-    typedef KSharedPtr<Base> DataPtr;
-    typedef QList<DataPtr> DataList;
-    typedef KSharedPtr<Track> TrackPtr;
-    typedef QList<TrackPtr> TrackList;
-    typedef KSharedPtr<Artist> ArtistPtr;
-    typedef QList<ArtistPtr> ArtistList;
-    typedef KSharedPtr<Album> AlbumPtr;
-    typedef QList<AlbumPtr> AlbumList;
-    typedef KSharedPtr<Composer> ComposerPtr;
-    typedef QList<ComposerPtr> ComposerList;
-    typedef KSharedPtr<Genre> GenrePtr;
-    typedef QList<GenrePtr> GenreList;
-    typedef KSharedPtr<Year> YearPtr;
-    typedef QList<YearPtr> YearList;
-    typedef KSharedPtr<Label> LabelPtr;
-    typedef QList<LabelPtr> LabelList;
-
     class AMAROK_CORE_EXPORT Observer
     {
-        friend class Base; // so that is can call destroyedNotify()
+        friend class Base; // so that it can call destroyedNotify()
 
         public:
             virtual ~Observer();
@@ -111,7 +81,7 @@ namespace Meta
             virtual void entityDestroyed();
 
         private:
-            friend class ::PersistentStatisticsStore; // so that is can call KSharedPtr-free subscribe:
+            friend class ::PersistentStatisticsStore; // so that it can call KSharedPtr-free subscribe:
             void subscribeTo( Base *ptr );
             void unsubscribeFrom( Base *ptr );
 
diff --git a/src/configdialog/dialogs/ExcludedLabelsDialog.h b/src/core/meta/forward_declarations.h
similarity index 52%
copy from src/configdialog/dialogs/ExcludedLabelsDialog.h
copy to src/core/meta/forward_declarations.h
index 9c41083..5534444 100644
--- a/src/configdialog/dialogs/ExcludedLabelsDialog.h
+++ b/src/core/meta/forward_declarations.h
@@ -1,5 +1,5 @@
 /****************************************************************************************
- * Copyright (c) 2012 Matěj Laitl <matej at laitl.cz>                                      *
+ * Copyright (c) 2013 Matěj Laitl <matej at laitl.cz>                                      *
  *                                                                                      *
  * This program is free software; you can redistribute it and/or modify it under        *
  * the terms of the GNU General Public License as published by the Free Software        *
@@ -14,39 +14,50 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#ifndef EXCLUDEDLABELSDIALOG_H
-#define EXCLUDEDLABELSDIALOG_H
+#ifndef AMAROKCORE_META_FORWARD_DECLARATIONS_H
+#define AMAROKCORE_META_FORWARD_DECLARATIONS_H
 
-#include "ui_ExcludedLabelsDialog.h"
-#include "core/meta/Meta.h"
+#include <KSharedPtr>
 
-#include <KDialog>
+#include <QList>
 
-namespace StatSyncing {
-    class Config;
-}
-class KLineEdit;
-class QGridLayout;
-class QListWidget;
-
-class ExcludedLabelsDialog : public KDialog, private Ui_ExcludedLabelsDialog
+namespace Meta
 {
-    Q_OBJECT
+    class Base;
+    typedef KSharedPtr<Base> DataPtr;
+    typedef QList<DataPtr> DataList;
+
+    class Track;
+    typedef KSharedPtr<Track> TrackPtr;
+    typedef QList<TrackPtr> TrackList;
+
+    class Artist;
+    typedef KSharedPtr<Artist> ArtistPtr;
+    typedef QList<ArtistPtr> ArtistList;
 
-    public:
-        explicit ExcludedLabelsDialog( StatSyncing::Config *config, QWidget *parent = 0,
-                                       Qt::WFlags flags = 0 );
+    class Album;
+    typedef KSharedPtr<Album> AlbumPtr;
+    typedef QList<AlbumPtr> AlbumList;
 
-    private slots:
-        void slowNewResultReady( const Meta::LabelList &labels );
-        void slotAddExcludedLabel();
-        void slotSaveToConfig();
+    class Genre;
+    typedef KSharedPtr<Genre> GenrePtr;
+    typedef QList<GenrePtr> GenreList;
 
-    private:
-        void addLabel( const QString &label, bool selected = false );
-        void addLabels( const QSet<QString> &labels, bool selected = false );
+    class Composer;
+    typedef KSharedPtr<Composer> ComposerPtr;
+    typedef QList<ComposerPtr> ComposerList;
 
-        StatSyncing::Config *m_statSyncingConfig;
-};
+    class Year;
+    typedef KSharedPtr<Year> YearPtr;
+    typedef QList<YearPtr> YearList;
+
+    class Label;
+    typedef KSharedPtr<Label> LabelPtr;
+    typedef QList<LabelPtr> LabelList;
+
+    class Statistics;
+    typedef KSharedPtr<Statistics> StatisticsPtr;
+    typedef KSharedPtr<const Statistics> ConstStatisticsPtr;
+}
 
-#endif // EXCLUDEDLABELSDIALOG_H
+#endif // AMAROKCORE_META_FORWARD_DECLARATIONS_H
diff --git a/src/core/meta/support/MetaConstants.cpp b/src/core/meta/support/MetaConstants.cpp
index 9a1fd3a..40d7122 100644
--- a/src/core/meta/support/MetaConstants.cpp
+++ b/src/core/meta/support/MetaConstants.cpp
@@ -16,11 +16,14 @@
 
 #include "MetaConstants.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "FileType.h"
 
 #include <KLocalizedString>
 
+#include <QSet>
+
 QString Meta::nameForField( qint64 field )
 {
     switch( field )
diff --git a/src/core/meta/support/MetaConstants.h b/src/core/meta/support/MetaConstants.h
index 953e8b3..fcb7920 100644
--- a/src/core/meta/support/MetaConstants.h
+++ b/src/core/meta/support/MetaConstants.h
@@ -19,7 +19,7 @@
 
 #include "core/amarokcore_export.h"
 #include "MetaValues.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QString>
 
diff --git a/src/core/meta/support/MetaKeys.h b/src/core/meta/support/MetaKeys.h
index 9533e1f..c2b15e5 100644
--- a/src/core/meta/support/MetaKeys.h
+++ b/src/core/meta/support/MetaKeys.h
@@ -18,7 +18,7 @@
 #define AMAROK_METAKEYS_H
 
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QHash>
 
diff --git a/src/core/meta/support/MetaUtility.h b/src/core/meta/support/MetaUtility.h
index c2709f5..8d75790 100644
--- a/src/core/meta/support/MetaUtility.h
+++ b/src/core/meta/support/MetaUtility.h
@@ -18,7 +18,7 @@
 #define AMAROK_METAUTILITY_H
 
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaConstants.h"
 
 #include <QMap>
diff --git a/src/core/meta/support/PrivateMetaRegistry.cpp b/src/core/meta/support/PrivateMetaRegistry.cpp
index 96457be..9b0928f 100644
--- a/src/core/meta/support/PrivateMetaRegistry.cpp
+++ b/src/core/meta/support/PrivateMetaRegistry.cpp
@@ -14,8 +14,8 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
+#include "core/meta/Meta.h"
 #include "core/meta/support/PrivateMetaRegistry.h"
-
 #include "core/support/Debug.h"
 
 namespace Meta {
diff --git a/src/core/meta/support/PrivateMetaRegistry.h b/src/core/meta/support/PrivateMetaRegistry.h
index 2076144..4692ce7 100644
--- a/src/core/meta/support/PrivateMetaRegistry.h
+++ b/src/core/meta/support/PrivateMetaRegistry.h
@@ -17,7 +17,10 @@
 #ifndef METAPRIVATEMETAREGISTRY_H
 #define METAPRIVATEMETAREGISTRY_H
 
-#include "core/meta/Meta.h"
+#include "core/amarokcore_export.h"
+#include "core/meta/forward_declarations.h"
+
+#include <QMap>
 
 namespace Meta {
 
@@ -27,10 +30,10 @@ namespace Meta {
  * are from the same album). This, besides saving memory, also makes it possible to group
  * by pointers in the playlist instead of some album/artist name foo.
 */
-class AMAROK_CORE_EXPORT PrivateMetaRegistry{
+class AMAROK_CORE_EXPORT PrivateMetaRegistry
+{
 public:
-
-    static PrivateMetaRegistry * instance();
+    static PrivateMetaRegistry *instance();
 
     void insertAlbum( const QString &owner, const QString &key, AlbumPtr album );
     void insertArtist( const QString &owner, const QString &key, ArtistPtr artist );
@@ -45,11 +48,10 @@ public:
     YearPtr year( const QString &owner, const QString &key );
 
 private:
-
     PrivateMetaRegistry();
     ~PrivateMetaRegistry();
 
-    static PrivateMetaRegistry* s_instance;      //!< instance variable
+    static PrivateMetaRegistry *s_instance;      //!< instance variable
 
     QMap<QString, AlbumPtr> m_albums;
     QMap<QString, ArtistPtr> m_artists;
@@ -57,7 +59,6 @@ private:
     QMap<QString, ComposerPtr> m_composers;
     QMap<QString, YearPtr> m_years;
 };
-
 }
 
 #endif
diff --git a/src/core/playlists/Playlist.cpp b/src/core/playlists/Playlist.cpp
index a1ac2d4..2677c78 100644
--- a/src/core/playlists/Playlist.cpp
+++ b/src/core/playlists/Playlist.cpp
@@ -14,6 +14,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
+#include "core/meta/Meta.h"
 #include "core/playlists/Playlist.h"
 #include "core/playlists/PlaylistProvider.h"
 
diff --git a/src/core/playlists/Playlist.h b/src/core/playlists/Playlist.h
index cf9a4c0..9fa854f 100644
--- a/src/core/playlists/Playlist.h
+++ b/src/core/playlists/Playlist.h
@@ -18,11 +18,13 @@
 #define AMAROK_META_PLAYLIST_H
 
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QList>
 #include <QMetaType>
+#include <QMutex>
 #include <QPixmap>
+#include <QReadWriteLock>
 #include <QSet>
 #include <QSharedData>
 #include <QString>
diff --git a/src/core/playlists/PlaylistProvider.cpp b/src/core/playlists/PlaylistProvider.cpp
index 525de4e..545a11e 100644
--- a/src/core/playlists/PlaylistProvider.cpp
+++ b/src/core/playlists/PlaylistProvider.cpp
@@ -14,9 +14,8 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-
+#include "core/meta/Meta.h"
 #include "core/playlists/PlaylistProvider.h"
-#include "PlaylistProvider.moc"
 
 using namespace Playlists;
 
diff --git a/src/core/support/Amarok.h b/src/core/support/Amarok.h
index be7f4c7..70113f7 100644
--- a/src/core/support/Amarok.h
+++ b/src/core/support/Amarok.h
@@ -20,7 +20,7 @@
 
 #include "core/amarokcore_export.h"
 #include "Version.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KActionCollection>
 #include <KConfig>
diff --git a/src/core/transcoding/TranscodingConfiguration.h b/src/core/transcoding/TranscodingConfiguration.h
index 1474100..0fd1be6 100644
--- a/src/core/transcoding/TranscodingConfiguration.h
+++ b/src/core/transcoding/TranscodingConfiguration.h
@@ -17,10 +17,10 @@
 #ifndef TRANSCODING_CONFIGURATION_H
 #define TRANSCODING_CONFIGURATION_H
 
-#include "TranscodingDefines.h"
-#include "TranscodingProperty.h"
 #include "core/amarokcore_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/Meta.h" // needed for default parameter constructor
+#include "core/transcoding/TranscodingDefines.h"
+#include "core/transcoding/TranscodingProperty.h"
 
 #include <KConfigGroup>
 
@@ -79,7 +79,7 @@ public:
      * and JUST_COPY encoders are considered plain copying. Also returns true if an encoder is
      * selected, but the passed track does not satisfy the selected m_trackSelection value.
      */
-    bool isJustCopy( const Meta::TrackPtr &srcTrack = Meta::TrackPtr( 0 ),
+    bool isJustCopy( const Meta::TrackPtr &srcTrack = Meta::TrackPtr(),
                      const QStringList &playableFileTypes = QStringList() ) const;
 
     QVariant property( QByteArray name ) const;
diff --git a/src/covermanager/CoverCache.cpp b/src/covermanager/CoverCache.cpp
index ab6006b..14a4646 100644
--- a/src/covermanager/CoverCache.cpp
+++ b/src/covermanager/CoverCache.cpp
@@ -16,6 +16,7 @@
 
 #include "covermanager/CoverCache.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 
 #include <QDir>
diff --git a/src/covermanager/CoverCache.h b/src/covermanager/CoverCache.h
index 6fc8ded..6659527 100644
--- a/src/covermanager/CoverCache.h
+++ b/src/covermanager/CoverCache.h
@@ -17,8 +17,9 @@
 #define AMAROK_COVERCACHE_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
+#include <QHash>
 #include <QPixmap>
 #include <QPixmapCache>
 #include <QReadWriteLock>
@@ -69,10 +70,11 @@ class AMAROK_EXPORT CoverCache
 
         typedef QHash< int, QPixmapCache::Key > CoverKeys;
 
-        /** Cache holding all the pixmap keys.
-            Don't use weak pointers for the Hash key. Hash keys that change are deadly
-        */
-        mutable QHash< const Meta::Album*, CoverKeys > m_keys;
+        /**
+         * Cache holding all the pixmap keys.
+         * Don't use smart pointers for the Hash key. Hash keys that change are deadly
+         */
+        mutable QHash<const Meta::Album*, CoverKeys> m_keys;
 
         Q_DISABLE_COPY( CoverCache )
 };
diff --git a/src/covermanager/CoverFetchQueue.h b/src/covermanager/CoverFetchQueue.h
index aa2146a..997c495 100644
--- a/src/covermanager/CoverFetchQueue.h
+++ b/src/covermanager/CoverFetchQueue.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_COVERFETCHQUEUE_H
 #define AMAROK_COVERFETCHQUEUE_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "CoverFetchUnit.h"
 
 #include <KIO/Job>
diff --git a/src/covermanager/CoverFetchUnit.cpp b/src/covermanager/CoverFetchUnit.cpp
index cb6d7f4..93bbb15 100644
--- a/src/covermanager/CoverFetchUnit.cpp
+++ b/src/covermanager/CoverFetchUnit.cpp
@@ -141,6 +141,12 @@ CoverFetchPayload::~CoverFetchPayload()
 {
 }
 
+Meta::AlbumPtr
+CoverFetchPayload::album() const
+{
+    return m_album;
+}
+
 QString
 CoverFetchPayload::sanitizeQuery( const QString &query )
 {
diff --git a/src/covermanager/CoverFetchUnit.h b/src/covermanager/CoverFetchUnit.h
index 68a3f54..bfbbd96 100644
--- a/src/covermanager/CoverFetchUnit.h
+++ b/src/covermanager/CoverFetchUnit.h
@@ -20,6 +20,7 @@
 #include "core/meta/Meta.h"
 
 #include <KSharedPtr>
+#include <KUrl>
 
 #include <QStringList>
 #include <QXmlStreamReader>
@@ -50,8 +51,8 @@ namespace CoverFetch
         Yahoo           //!< Use Yahoo! BOSS image search as provider
     };
 
-    typedef QHash< QString, QString > Metadata;
-    typedef QHash< KUrl, Metadata > Urls;
+    typedef QHash<QString, QString> Metadata;
+    typedef QHash<KUrl, Metadata> Urls;
 }
 
 /**
@@ -102,7 +103,7 @@ public:
     CoverFetchPayload( const Meta::AlbumPtr album, enum Type type, const CoverFetch::Source src );
     virtual ~CoverFetchPayload();
 
-    Meta::AlbumPtr album() const { return m_album; }
+    Meta::AlbumPtr album() const;
     CoverFetch::Source source() const;
     enum Type type() const;
     const CoverFetch::Urls &urls() const;
@@ -154,7 +155,7 @@ public:
     explicit CoverFetchSearchPayload( const QString &query = QString(),
                                       const CoverFetch::Source src = CoverFetch::LastFm,
                                       unsigned int page = 0,
-                                      Meta::AlbumPtr album = Meta::AlbumPtr(0) );
+                                      Meta::AlbumPtr album = Meta::AlbumPtr() );
     ~CoverFetchSearchPayload();
 
     QString query() const;
diff --git a/src/covermanager/CoverFetcher.cpp b/src/covermanager/CoverFetcher.cpp
index 1f59b39..f668110 100644
--- a/src/covermanager/CoverFetcher.cpp
+++ b/src/covermanager/CoverFetcher.cpp
@@ -18,15 +18,14 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "CoverFetcher"
-#include "core/support/Debug.h"
-
 #include "CoverFetcher.h"
 
+#include "amarokconfig.h"
+#include "core/interfaces/Logger.h"
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Components.h"
-#include "core/interfaces/Logger.h"
-#include "amarokconfig.h"
+#include "core/support/Debug.h"
 #include "CoverFetchQueue.h"
 #include "CoverFoundDialog.h"
 #include "CoverFetchUnit.h"
@@ -37,6 +36,8 @@
 #include <QBuffer>
 #include <QImageReader>
 
+#define DEBUG_PREFIX "CoverFetcher"
+
 CoverFetcher* CoverFetcher::s_instance = 0;
 
 CoverFetcher*
diff --git a/src/covermanager/CoverFetcher.h b/src/covermanager/CoverFetcher.h
index 6d1753a..75de749 100644
--- a/src/covermanager/CoverFetcher.h
+++ b/src/covermanager/CoverFetcher.h
@@ -20,7 +20,7 @@
 #ifndef AMAROK_COVERFETCHER_H
 #define AMAROK_COVERFETCHER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "CoverFetchUnit.h"
 #include "network/NetworkAccessManagerProxy.h"
 
diff --git a/src/covermanager/CoverFetchingActions.h b/src/covermanager/CoverFetchingActions.h
index 7e2463c..df51d7d 100644
--- a/src/covermanager/CoverFetchingActions.h
+++ b/src/covermanager/CoverFetchingActions.h
@@ -18,7 +18,7 @@
 #define COVERFETCHINGACTIONS_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QAction>
 
diff --git a/src/covermanager/CoverFoundDialog.h b/src/covermanager/CoverFoundDialog.h
index 63657a9..f9338e9 100644
--- a/src/covermanager/CoverFoundDialog.h
+++ b/src/covermanager/CoverFoundDialog.h
@@ -20,7 +20,7 @@
 #ifndef AMAROK_COVERFOUNDDIALOG_H
 #define AMAROK_COVERFOUNDDIALOG_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "covermanager/CoverFetchUnit.h"
 #include "network/NetworkAccessManagerProxy.h"
 
diff --git a/src/covermanager/CoverViewDialog.cpp b/src/covermanager/CoverViewDialog.cpp
index 3ef50e2..b6a20eb 100644
--- a/src/covermanager/CoverViewDialog.cpp
+++ b/src/covermanager/CoverViewDialog.cpp
@@ -17,6 +17,7 @@
 
 #include "CoverViewDialog.h"
 
+#include "core/meta/Meta.h"
 #include "widgets/PixmapViewer.h"
 
 #include <KApplication>
diff --git a/src/covermanager/CoverViewDialog.h b/src/covermanager/CoverViewDialog.h
index 9611373..59d9866 100644
--- a/src/covermanager/CoverViewDialog.h
+++ b/src/covermanager/CoverViewDialog.h
@@ -18,7 +18,7 @@
 #define AMAROK_COVERVIEWDIALOG_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QDialog>
 
diff --git a/src/databaseimporter/DatabaseImporter.h b/src/databaseimporter/DatabaseImporter.h
index 9c25e5c..602f332 100644
--- a/src/databaseimporter/DatabaseImporter.h
+++ b/src/databaseimporter/DatabaseImporter.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_DATABASE_IMPORTER_H
 #define AMAROK_DATABASE_IMPORTER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KVBox>
 
diff --git a/src/databaseimporter/amarok14/FastForwardWorker.h b/src/databaseimporter/amarok14/FastForwardWorker.h
index 71ad24c..6a4640f 100644
--- a/src/databaseimporter/amarok14/FastForwardWorker.h
+++ b/src/databaseimporter/amarok14/FastForwardWorker.h
@@ -21,7 +21,7 @@
 
 #include "databaseimporter/DatabaseImporter.h"
 #include "core/collections/CollectionLocation.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <threadweaver/Job.h>
 #include <threadweaver/ThreadWeaver.h>
diff --git a/src/databaseimporter/itunes/ITunesImporterWorker.cpp b/src/databaseimporter/itunes/ITunesImporterWorker.cpp
index 309a3d2..8aa81e0 100644
--- a/src/databaseimporter/itunes/ITunesImporterWorker.cpp
+++ b/src/databaseimporter/itunes/ITunesImporterWorker.cpp
@@ -37,6 +37,10 @@ ITunesImporterWorker::ITunesImporterWorker()
 {
 }
 
+ITunesImporterWorker::~ITunesImporterWorker()
+{
+}
+
 void
 ITunesImporterWorker::readTrackElement()
 {
diff --git a/src/databaseimporter/itunes/ITunesImporterWorker.h b/src/databaseimporter/itunes/ITunesImporterWorker.h
index 3ceaa69..e8a104d 100644
--- a/src/databaseimporter/itunes/ITunesImporterWorker.h
+++ b/src/databaseimporter/itunes/ITunesImporterWorker.h
@@ -18,23 +18,25 @@
 #define AMAROK_ITUNES_IMPORTER_WORKER_H
 
 #include "databaseimporter/DatabaseImporter.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <threadweaver/Job.h>
 #include <threadweaver/ThreadWeaver.h>
 
+#include <QMap>
 #include <QSqlDatabase>
 #include <QXmlStreamReader>
 
 class ITunesImporterWorker : public ThreadWeaver::Job, public QXmlStreamReader
 {
     Q_OBJECT
-    
+
     public:
         ITunesImporterWorker();
+        ~ITunesImporterWorker();
 
         void setDatabaseLocation( const QString &location ) { m_databaseLocation = location; }
-      
+
         bool failed() const { return m_failed; }
         void abort() { m_aborted = true; }
 
@@ -46,14 +48,12 @@ class ITunesImporterWorker : public ThreadWeaver::Job, public QXmlStreamReader
         void trackAdded( Meta::TrackPtr );
 
     private:
-        void readUnknownElement();
         void readTrackElement();
-        
+
         bool m_aborted;
         bool m_failed;
-        
-        QMap<Meta::TrackPtr,QString> m_tracksForInsert;
-        
+
+        QMap<Meta::TrackPtr, QString> m_tracksForInsert;
         QString m_databaseLocation;
 };
 
diff --git a/src/dbus/DBusQueryHelper.cpp b/src/dbus/DBusQueryHelper.cpp
index eca431f..cd38b2d 100644
--- a/src/dbus/DBusQueryHelper.cpp
+++ b/src/dbus/DBusQueryHelper.cpp
@@ -16,14 +16,15 @@
  
 #include "DBusQueryHelper.h"
 
-#include "core/support/Debug.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaUtility.h"
+#include "core/support/Debug.h"
 
 #include <QTimer>
 
 Q_DECLARE_METATYPE( VariantMapList )
- 
+
 DBusQueryHelper::DBusQueryHelper( QObject *parent, Collections::QueryMaker *qm, const QDBusConnection &conn, const QDBusMessage &msg, bool mprisCompatible )
     : QObject( parent )
     , m_connection( conn )
diff --git a/src/dbus/DBusQueryHelper.h b/src/dbus/DBusQueryHelper.h
index 970fe6a..a8d89e4 100644
--- a/src/dbus/DBusQueryHelper.h
+++ b/src/dbus/DBusQueryHelper.h
@@ -17,7 +17,7 @@
 #ifndef DBUSQUERYHELPER_H
 #define DBUSQUERYHELPER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QDBusConnection>
 #include <QDBusMessage>
diff --git a/src/dbus/mpris1/PlayerHandler.h b/src/dbus/mpris1/PlayerHandler.h
index 976e53f..d1b2737 100644
--- a/src/dbus/mpris1/PlayerHandler.h
+++ b/src/dbus/mpris1/PlayerHandler.h
@@ -19,7 +19,7 @@
 #define MPRIS1_PLAYER_HANDLER_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QObject>
 #include <QVariantMap>
diff --git a/src/dbus/mpris2/MediaPlayer2Player.h b/src/dbus/mpris2/MediaPlayer2Player.h
index 9b5c508..a237a77 100644
--- a/src/dbus/mpris2/MediaPlayer2Player.h
+++ b/src/dbus/mpris2/MediaPlayer2Player.h
@@ -23,7 +23,7 @@
 
 #include "DBusAbstractAdaptor.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QDBusObjectPath>
 #include <QModelIndex>
diff --git a/src/dialogs/DatabaseImporterDialog.cpp b/src/dialogs/DatabaseImporterDialog.cpp
index 1405e66..5159ce8 100644
--- a/src/dialogs/DatabaseImporterDialog.cpp
+++ b/src/dialogs/DatabaseImporterDialog.cpp
@@ -16,6 +16,7 @@
 
 #include "DatabaseImporterDialog.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "databaseimporter/sqlbatch/SqlBatchImporter.h"
 #include "databaseimporter/amarok14/FastForwardImporter.h"
diff --git a/src/dialogs/DatabaseImporterDialog.h b/src/dialogs/DatabaseImporterDialog.h
index 488cbac..f0ae7c3 100644
--- a/src/dialogs/DatabaseImporterDialog.h
+++ b/src/dialogs/DatabaseImporterDialog.h
@@ -20,7 +20,7 @@
 #include <KAssistantDialog>    //baseclass
 
 #include "databaseimporter/DatabaseImporter.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QHash>
 
diff --git a/src/dialogs/EditFilterDialog.h b/src/dialogs/EditFilterDialog.h
index 9fb6e2b..b1a3a17 100644
--- a/src/dialogs/EditFilterDialog.h
+++ b/src/dialogs/EditFilterDialog.h
@@ -19,7 +19,7 @@
 #ifndef AMAROK_EDITFILTERDIALOG_H
 #define AMAROK_EDITFILTERDIALOG_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "widgets/MetaQueryWidget.h"
 #include "widgets/TokenPool.h"
 
diff --git a/src/dialogs/MusicBrainzTagger.cpp b/src/dialogs/MusicBrainzTagger.cpp
index 21753e7..e99576b 100644
--- a/src/dialogs/MusicBrainzTagger.cpp
+++ b/src/dialogs/MusicBrainzTagger.cpp
@@ -15,10 +15,9 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "MusicBrainzTagDialog"
-
 #include "MusicBrainzTagger.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaConstants.h"
 #include "core/meta/support/MetaUtility.h"
 #include "core/support/Debug.h"
@@ -36,6 +35,8 @@
 #include <QToolBar>
 #include <QToolButton>
 
+#define DEBUG_PREFIX "MusicBrainzTagDialog"
+
 MusicBrainzTagger::MusicBrainzTagger( const Meta::TrackList &tracks,
                                       QWidget *parent )
     : KDialog( parent )
diff --git a/src/dialogs/MusicBrainzTagger.h b/src/dialogs/MusicBrainzTagger.h
index 928f005..27d9d85 100644
--- a/src/dialogs/MusicBrainzTagger.h
+++ b/src/dialogs/MusicBrainzTagger.h
@@ -19,7 +19,7 @@
 #define MUSICBRAINZTAGGER_H
 
 #include "config.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KDialog>
 
diff --git a/src/dialogs/OrganizeCollectionDialog.h b/src/dialogs/OrganizeCollectionDialog.h
index 997583a..080afed 100644
--- a/src/dialogs/OrganizeCollectionDialog.h
+++ b/src/dialogs/OrganizeCollectionDialog.h
@@ -19,7 +19,7 @@
 #define AMAROK_ORGANIZECOLLECTIONDIALOG_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include "widgets/FilenameLayoutWidget.h"
 #include "ui_OrganizeCollectionOptions.h"
diff --git a/src/dialogs/TrackOrganizer.cpp b/src/dialogs/TrackOrganizer.cpp
index 920ccb0..f46b7ce 100644
--- a/src/dialogs/TrackOrganizer.cpp
+++ b/src/dialogs/TrackOrganizer.cpp
@@ -21,6 +21,7 @@
 #include "TrackOrganizer.h"
 
 #include "QStringx.h"
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core/support/Amarok.h"
 
diff --git a/src/dialogs/TrackOrganizer.h b/src/dialogs/TrackOrganizer.h
index 4f75e89..76a8fc7 100644
--- a/src/dialogs/TrackOrganizer.h
+++ b/src/dialogs/TrackOrganizer.h
@@ -21,9 +21,10 @@
 #define TRACKORGANIZER_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QObject>
+#include <QMap>
 
 /**
  * Generates a list of paths formatted according to the specified
diff --git a/src/dynamic/Bias.h b/src/dynamic/Bias.h
index beb5eb7..a685bb6 100644
--- a/src/dynamic/Bias.h
+++ b/src/dynamic/Bias.h
@@ -24,6 +24,7 @@
 #include "amarok_export.h"
 #include "dynamic/TrackSet.h"
 
+#include <QMetaType>
 #include <QObject>
 #include <QRect>
 #include <QWidget>
@@ -272,4 +273,3 @@ namespace Dynamic
 Q_DECLARE_METATYPE( Dynamic::BiasPtr )
 
 #endif
-
diff --git a/src/dynamic/BiasSolver.cpp b/src/dynamic/BiasSolver.cpp
index dff6e66..91da059 100644
--- a/src/dynamic/BiasSolver.cpp
+++ b/src/dynamic/BiasSolver.cpp
@@ -17,25 +17,26 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "BiasSolver"
-
 #include "BiasSolver.h"
-#include "TrackSet.h"
 
 #include "amarokconfig.h"
-#include "core-impl/collections/support/CollectionManager.h"
-#include "core/support/Debug.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaConstants.h"
+#include "core/support/Debug.h"
+#include "core-impl/collections/support/CollectionManager.h"
 
-#include <cmath>
+#include <ThreadWeaver/Thread>
 
 #include <QHash>
 #include <QMutexLocker>
 
+#include <cmath>
+
+#define DEBUG_PREFIX "BiasSolver"
+
 /* These number are black magic. The best values can only be obtained through
  * exhaustive trial and error or writing another optimization program to
  * optimize this optimization program. They are very sensitive. Be careful */
-#include <threadweaver/Thread.h>
 
 namespace Dynamic
 {
diff --git a/src/dynamic/BiasSolver.h b/src/dynamic/BiasSolver.h
index 438c8e1..b96318c 100644
--- a/src/dynamic/BiasSolver.h
+++ b/src/dynamic/BiasSolver.h
@@ -21,15 +21,15 @@
 #define AMAROK_BIASSOLVER_H
 
 #include "Bias.h"
-#include "core/meta/Meta.h"
-#include "TrackSet.h"
-
-#include <threadweaver/Job.h>
+#include "core/meta/forward_declarations.h"
+#include "dynamic/TrackSet.h"
 
 #include <QDateTime>
 #include <QMutex>
 #include <QWaitCondition>
 
+#include <ThreadWeaver/Job>
+
 namespace Dynamic
 {
 
@@ -214,7 +214,6 @@ namespace Dynamic
             /** The maximum time we should try to spend generating the playlist */
             static const int MAX_TIME_MS = 5000;
     };
-
 }
 
 #endif
diff --git a/src/dynamic/BiasedPlaylist.h b/src/dynamic/BiasedPlaylist.h
index 84a39e2..8dc0cad 100644
--- a/src/dynamic/BiasedPlaylist.h
+++ b/src/dynamic/BiasedPlaylist.h
@@ -21,7 +21,7 @@
 
 #include "Bias.h"
 #include "DynamicPlaylist.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include "amarok_export.h" // we are exporting it for the tests
 
diff --git a/src/dynamic/DynamicPlaylist.h b/src/dynamic/DynamicPlaylist.h
index 55eb7a5..a1f3b53 100644
--- a/src/dynamic/DynamicPlaylist.h
+++ b/src/dynamic/DynamicPlaylist.h
@@ -19,11 +19,14 @@
 #ifndef AMAROK_DYNAMICPLAYLIST_H
 #define AMAROK_DYNAMICPLAYLIST_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/collections/QueryMaker.h"
 
 #include "amarok_export.h" // we are exporting it for the tests
 
+namespace Collections {
+    class Collection;
+}
 class QXmlStreamReader;
 class QXmlStreamWriter;
 
diff --git a/src/dynamic/TrackSet.cpp b/src/dynamic/TrackSet.cpp
index 9623605..456a10a 100644
--- a/src/dynamic/TrackSet.cpp
+++ b/src/dynamic/TrackSet.cpp
@@ -17,8 +17,10 @@
  ****************************************************************************************/
 
 #include "TrackSet.h"
-#include "core/support/Debug.h"
+
 #include "core/collections/Collection.h"
+#include "core/meta/Meta.h"
+#include "core/support/Debug.h"
 
 #include <KRandom>
 
diff --git a/src/dynamic/TrackSet.h b/src/dynamic/TrackSet.h
index bd9ef07..dee8ee3 100644
--- a/src/dynamic/TrackSet.h
+++ b/src/dynamic/TrackSet.h
@@ -20,13 +20,14 @@
 #define AMAROK_TRACKSET_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QBitArray>
+#include <QExplicitlySharedDataPointer>
+#include <QHash>
+#include <QSharedData>
 #include <QString>
 #include <QStringList>
-#include <QSharedData>
-#include <QExplicitlySharedDataPointer>
 
 namespace Dynamic
 {
diff --git a/src/dynamic/biases/AlbumPlayBias.cpp b/src/dynamic/biases/AlbumPlayBias.cpp
index 8356919..b15f34d 100644
--- a/src/dynamic/biases/AlbumPlayBias.cpp
+++ b/src/dynamic/biases/AlbumPlayBias.cpp
@@ -16,11 +16,10 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "AlbumPlayBias"
-
 #include "AlbumPlayBias.h"
 
 #include "browsers/playlistbrowser/DynamicBiasWidgets.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "dynamic/TrackSet.h"
 
@@ -31,6 +30,8 @@
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
+#define DEBUG_PREFIX "AlbumPlayBias"
+
 QString
 Dynamic::AlbumPlayBiasFactory::i18nName() const
 { return i18nc("Name of the \"AlbumPlay\" bias", "Album play"); }
diff --git a/src/dynamic/biases/EchoNestBias.cpp b/src/dynamic/biases/EchoNestBias.cpp
index a0f8e08..5a9d7a4 100644
--- a/src/dynamic/biases/EchoNestBias.cpp
+++ b/src/dynamic/biases/EchoNestBias.cpp
@@ -15,10 +15,9 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "EchoNestBias"
-
 #include "EchoNestBias.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
@@ -37,6 +36,8 @@
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
+#define DEBUG_PREFIX "EchoNestBias"
+
 QString
 Dynamic::EchoNestBiasFactory::i18nName() const
 { return i18nc("Name of the \"EchoNest\" bias", "EchoNest similar artist"); }
diff --git a/src/dynamic/biases/EchoNestBias.h b/src/dynamic/biases/EchoNestBias.h
index 0b60ef0..c266811 100644
--- a/src/dynamic/biases/EchoNestBias.h
+++ b/src/dynamic/biases/EchoNestBias.h
@@ -25,8 +25,8 @@
 namespace KIO {
     class StoredTransferJob;
 }
-
 class KJob;
+class KUrl;
 
 namespace Dynamic
 {
diff --git a/src/dynamic/biases/IfElseBias.cpp b/src/dynamic/biases/IfElseBias.cpp
index ce1d7aa..0a8597a 100644
--- a/src/dynamic/biases/IfElseBias.cpp
+++ b/src/dynamic/biases/IfElseBias.cpp
@@ -16,11 +16,10 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "IfElseBias"
-
 #include "IfElseBias.h"
 
 #include "amarokconfig.h"
+#include "core/meta/Meta.h"
 
 #include <QtGlobal> // for qRound
 #include <QPainter>
@@ -28,7 +27,9 @@
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
-#include <klocale.h>
+#include <KLocale>
+
+#define DEBUG_PREFIX "IfElseBias"
 
 QString
 Dynamic::IfElseBiasFactory::i18nName() const
diff --git a/src/dynamic/biases/PartBias.cpp b/src/dynamic/biases/PartBias.cpp
index 9cfedb8..9916199 100644
--- a/src/dynamic/biases/PartBias.cpp
+++ b/src/dynamic/biases/PartBias.cpp
@@ -16,11 +16,10 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "PartBias"
-
 #include "PartBias.h"
 
 #include "browsers/playlistbrowser/DynamicBiasWidgets.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "widgets/SliderWidget.h"
 
@@ -39,6 +38,8 @@
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
+#define DEBUG_PREFIX "PartBias"
+
 QString
 Dynamic::PartBiasFactory::i18nName() const
 { return i18nc("Name of the \"Part\" bias", "Partition"); }
diff --git a/src/dynamic/biases/QuizPlayBias.cpp b/src/dynamic/biases/QuizPlayBias.cpp
index bb0ab11..7cbce99 100644
--- a/src/dynamic/biases/QuizPlayBias.cpp
+++ b/src/dynamic/biases/QuizPlayBias.cpp
@@ -16,13 +16,12 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "QuizPlayBias"
-
 #include "QuizPlayBias.h"
 
 #include "browsers/playlistbrowser/DynamicBiasWidgets.h"
 #include "core/collections/Collection.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
 #include "dynamic/TrackSet.h"
@@ -35,8 +34,9 @@
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
-#include <klocale.h>
+#include <KLocale>
 
+#define DEBUG_PREFIX "QuizPlayBias"
 
 QString
 Dynamic::QuizPlayBiasFactory::i18nName() const
diff --git a/src/dynamic/biases/TagMatchBias.cpp b/src/dynamic/biases/TagMatchBias.cpp
index d62b805..ac9cc2a 100644
--- a/src/dynamic/biases/TagMatchBias.cpp
+++ b/src/dynamic/biases/TagMatchBias.cpp
@@ -18,13 +18,12 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "TagMatchBias"
-
 #include "TagMatchBias.h"
 
 #include "browsers/playlistbrowser/DynamicBiasWidgets.h"
 #include "core/collections/Collection.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
 #include "dynamic/TrackSet.h"
@@ -37,6 +36,8 @@
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
 
+#define DEBUG_PREFIX "TagMatchBias"
+
 QString
 Dynamic::TagMatchBiasFactory::i18nName() const
 { return i18nc("Name of the \"TagMatch\" bias", "Match meta tag"); }
diff --git a/src/dynamic/biases/TagMatchBias.h b/src/dynamic/biases/TagMatchBias.h
index f944b59..0382559 100644
--- a/src/dynamic/biases/TagMatchBias.h
+++ b/src/dynamic/biases/TagMatchBias.h
@@ -26,6 +26,8 @@
 #include "dynamic/BiasFactory.h"
 #include "widgets/MetaQueryWidget.h"
 
+#include <QDateTime>
+
 class QWidget;
 class QCheckBox;
 
diff --git a/src/mac/GrowlInterface.h b/src/mac/GrowlInterface.h
index 5d07a84..b03a511 100644
--- a/src/mac/GrowlInterface.h
+++ b/src/mac/GrowlInterface.h
@@ -24,7 +24,7 @@
 #include <QImage>
 
 #include "core/support/Debug.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "EngineController.h"
     
  // NOTE if not on mac, this whole file is useless, so not even going to try
diff --git a/src/moodbar/MoodbarManager.cpp b/src/moodbar/MoodbarManager.cpp
index 2c7c70e..c85bdc4 100644
--- a/src/moodbar/MoodbarManager.cpp
+++ b/src/moodbar/MoodbarManager.cpp
@@ -28,11 +28,10 @@ even porting to qtscript so it could be run, as needed, by Amarok.
 - Nikolaj
 */
 
-#define DEBUG_PREFIX "MoodbarManager"
-
 #include "MoodbarManager.h"
 
 #include "amarokconfig.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "PaletteHandler.h"
 
@@ -40,7 +39,7 @@ even porting to qtscript so it could be run, as needed, by Amarok.
 #include <QFileInfo>
 #include <QPainter>
 
-
+#define DEBUG_PREFIX "MoodbarManager"
 #define NUM_HUES 12
 
 namespace The
@@ -172,7 +171,7 @@ QPixmap MoodbarManager::getMoodbar( Meta::TrackPtr track, int width, int height,
             moodFilePath = m_moodFileMap.value( track );
         else
             moodFilePath = moodPath( track->playableUrl().path() );
-        
+
         data = readMoodFile( moodFilePath );
 
         if ( data.size() > 10 )
diff --git a/src/moodbar/MoodbarManager.h b/src/moodbar/MoodbarManager.h
index be189bd..480960d 100644
--- a/src/moodbar/MoodbarManager.h
+++ b/src/moodbar/MoodbarManager.h
@@ -19,13 +19,16 @@
 #define MOODBARMANAGER_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KImageCache>
+
 #include <QColor>
+#include <QMap>
 #include <QObject>
 
-
+class KUrl;
+class QPalette;
 class MoodbarManager;
 
 namespace The {
@@ -36,7 +39,7 @@ typedef QVector<QColor> MoodbarColorList;
 
 class AMAROK_EXPORT  MoodbarManager : public QObject
 {
-    
+
 Q_OBJECT
 
 friend MoodbarManager* The::moodbarManager();
diff --git a/src/musicbrainz/MusicBrainzFinder.cpp b/src/musicbrainz/MusicBrainzFinder.cpp
index dd8d393..feef8a0 100644
--- a/src/musicbrainz/MusicBrainzFinder.cpp
+++ b/src/musicbrainz/MusicBrainzFinder.cpp
@@ -15,10 +15,9 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "MusicBrainzFinder"
-
 #include "MusicBrainzFinder.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaConstants.h"
 #include "core/meta/support/MetaUtility.h"
 #include "core/support/Debug.h"
@@ -31,6 +30,8 @@
 #include <QNetworkAccessManager>
 #include <QTimer>
 
+#define DEBUG_PREFIX "MusicBrainzFinder"
+
 /*
  * Levenshtein distance algorithm implementation carefully pirated from Wikibooks
  * (http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance)
diff --git a/src/musicbrainz/MusicBrainzFinder.h b/src/musicbrainz/MusicBrainzFinder.h
index d9faf61..beb1551 100644
--- a/src/musicbrainz/MusicBrainzFinder.h
+++ b/src/musicbrainz/MusicBrainzFinder.h
@@ -19,7 +19,7 @@
 #define MUSICBRAINZFINDER_H
 
 #include "Version.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "musicbrainz/MusicBrainzXmlParser.h"
 #include "network/NetworkAccessManagerProxy.h"
 
diff --git a/src/musicbrainz/MusicBrainzTagsItem.h b/src/musicbrainz/MusicBrainzTagsItem.h
index f0f259c..6852c9f 100644
--- a/src/musicbrainz/MusicBrainzTagsItem.h
+++ b/src/musicbrainz/MusicBrainzTagsItem.h
@@ -18,9 +18,10 @@
 #ifndef MUSICBRAINZTAGSITEM_H
 #define MUSICBRAINZTAGSITEM_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QReadWriteLock>
+#include <QVariant>
 
 class MusicBrainzTagsItem
 {
diff --git a/src/musicbrainz/MusicBrainzTagsModel.h b/src/musicbrainz/MusicBrainzTagsModel.h
index 7028507..eaee7f8 100644
--- a/src/musicbrainz/MusicBrainzTagsModel.h
+++ b/src/musicbrainz/MusicBrainzTagsModel.h
@@ -18,7 +18,7 @@
 #ifndef MUSICBRAINZTAGSMODEL_H
 #define MUSICBRAINZTAGSMODEL_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QAbstractItemModel>
 
diff --git a/src/musicbrainz/MusicBrainzTagsView.cpp b/src/musicbrainz/MusicBrainzTagsView.cpp
index 259876a..dd4eefb 100644
--- a/src/musicbrainz/MusicBrainzTagsView.cpp
+++ b/src/musicbrainz/MusicBrainzTagsView.cpp
@@ -28,6 +28,7 @@
 #include <QDesktopServices>
 #include <QMenu>
 #include <QSortFilterProxyModel>
+#include <QUrl>
 
 #define DEBUG_PREFIX "MusicBrainzTagsView"
 
diff --git a/src/musicbrainz/MusicDNSAudioDecoder.cpp b/src/musicbrainz/MusicDNSAudioDecoder.cpp
index 52a6559..1e2cf66 100644
--- a/src/musicbrainz/MusicDNSAudioDecoder.cpp
+++ b/src/musicbrainz/MusicDNSAudioDecoder.cpp
@@ -14,12 +14,11 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "MusicDNSAudioDecoder"
-
 #include "MusicDNSAudioDecoder.h"
 
 #include "config.h"
 #include "core/support/Debug.h"
+#include "core/meta/Meta.h"
 
 extern "C" {
     typedef quint64 UINT64_C;
@@ -30,6 +29,8 @@ extern "C" {
 
 #include <ofa1/ofa.h>
 
+#define DEBUG_PREFIX "MusicDNSAudioDecoder"
+
 DecodedAudioData::DecodedAudioData()
                  : m_sRate( 0 )
                  , m_channels( 0 )
diff --git a/src/musicbrainz/MusicDNSAudioDecoder.h b/src/musicbrainz/MusicDNSAudioDecoder.h
index da7c1f0..ca98c20 100644
--- a/src/musicbrainz/MusicDNSAudioDecoder.h
+++ b/src/musicbrainz/MusicDNSAudioDecoder.h
@@ -17,12 +17,13 @@
 #ifndef MUSICDNSAUDIODECODER_H
 #define MUSICDNSAUDIODECODER_H
 
+#include "core/meta/forward_declarations.h"
+
+#include <ThreadWeaver/Job>
+
 #define DEFAULT_SAMPLE_LENGTH 135000
 #define MIN_SAMPLE_LENGTH 10000
 
-#include <core/meta/Meta.h>
-#include <threadweaver/Job.h>
-
 class DecodedAudioData
 {
     public:
diff --git a/src/musicbrainz/MusicDNSFinder.cpp b/src/musicbrainz/MusicDNSFinder.cpp
index a05eb84..a2e1fe1 100644
--- a/src/musicbrainz/MusicDNSFinder.cpp
+++ b/src/musicbrainz/MusicDNSFinder.cpp
@@ -14,13 +14,16 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "MusicDNSFinder"
-
 #include "MusicDNSFinder.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
+
+#include <ThreadWeaver/Weaver>
+
 #include <QNetworkAccessManager>
-#include <threadweaver/ThreadWeaver.h>
+
+#define DEBUG_PREFIX "MusicDNSFinder"
 
 MusicDNSFinder::MusicDNSFinder( QObject *parent,
                                 const QString &host, const int port, const QString &pathPrefix,
diff --git a/src/musicbrainz/MusicDNSFinder.h b/src/musicbrainz/MusicDNSFinder.h
index 59f6d5b..90c4c9c 100644
--- a/src/musicbrainz/MusicDNSFinder.h
+++ b/src/musicbrainz/MusicDNSFinder.h
@@ -18,7 +18,7 @@
 #define MUSICDNSFINDER_H
 
 #include "Version.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "musicbrainz/MusicDNSAudioDecoder.h"
 #include "musicbrainz/MusicDNSXmlParser.h"
 #include "network/NetworkAccessManagerProxy.h"
diff --git a/src/playlist/PlaylistController.h b/src/playlist/PlaylistController.h
index 6557146..ce3a4f3 100644
--- a/src/playlist/PlaylistController.h
+++ b/src/playlist/PlaylistController.h
@@ -24,7 +24,7 @@
 
 #include "UndoCommands.h"
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/playlists/Playlist.h"
 
 #include <QObject>
diff --git a/src/playlist/PlaylistItem.cpp b/src/playlist/PlaylistItem.cpp
index 5d13dc5..9049cbb 100644
--- a/src/playlist/PlaylistItem.cpp
+++ b/src/playlist/PlaylistItem.cpp
@@ -17,13 +17,23 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "Playlist::Item"
-
 #include "PlaylistItem.h"
+
 #include "core/capabilities/SourceInfoCapability.h"
+#include "core/meta/Meta.h"
 
 #include <KRandom>
 
+#include <QSet>
+
+#define DEBUG_PREFIX "Playlist::Item"
+
+Playlist::Item::Item()
+    : m_state ( Invalid )
+    , m_id ( 0 )
+{
+}
+
 Playlist::Item::Item( Meta::TrackPtr track )
         : m_track( track ), m_state( NewlyAdded )
 {
@@ -31,8 +41,14 @@ Playlist::Item::Item( Meta::TrackPtr track )
 }
 
 Playlist::Item::~Item()
-{ }
+{
+}
 
+const Meta::TrackPtr &
+Playlist::Item::track() const
+{
+    return m_track;
+}
 
 // Does the same thing as:
 //     foreach( quint64 val, set )
diff --git a/src/playlist/PlaylistItem.h b/src/playlist/PlaylistItem.h
index af25a1c..a43a530 100644
--- a/src/playlist/PlaylistItem.h
+++ b/src/playlist/PlaylistItem.h
@@ -20,7 +20,9 @@
 #ifndef AMAROKPLAYLISTITEM_H
 #define AMAROKPLAYLISTITEM_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
+
+#include <QMetaType>
 
 namespace Playlist
 {
@@ -40,11 +42,11 @@ namespace Playlist
 
             static void listRemove( QList<quint64> &target, QSet<quint64> &removeSet );
 
-
-            Item() : m_track ( 0 ), m_state ( Invalid ), m_id ( 0 ) { }
-            Item ( Meta::TrackPtr track );
+            Item();
+            Item( Meta::TrackPtr track );
             ~Item();
-            const Meta::TrackPtr& track() const { return m_track; }
+
+            const Meta::TrackPtr& track() const;
 
             State state() const { return m_state; }
             void setState ( State s ) { m_state = s; }
@@ -62,6 +64,6 @@ namespace Playlist
     };
 }
 
-Q_DECLARE_METATYPE ( Playlist::Item* )
+Q_DECLARE_METATYPE( Playlist::Item* )
 
 #endif
diff --git a/src/playlist/PlaylistModel.h b/src/playlist/PlaylistModel.h
index d21b98b..62f841e 100644
--- a/src/playlist/PlaylistModel.h
+++ b/src/playlist/PlaylistModel.h
@@ -25,9 +25,9 @@
 
 #include "UndoCommands.h"
 #include "amarok_export.h"
-#include "core/support/Amarok.h"
 #include "core/meta/Meta.h"
-#include "proxymodels/AbstractModel.h"
+#include "core/support/Amarok.h"
+#include "playlist/proxymodels/AbstractModel.h"
 
 #include <QAbstractListModel>
 #include <QHash>
@@ -40,7 +40,6 @@ class QMimeData;
 class QModelIndex;
 class TestPlaylistModels;
 
-
 namespace Playlist
 {
 
diff --git a/src/playlist/UndoCommands.h b/src/playlist/UndoCommands.h
index c0e253b..854bad1 100644
--- a/src/playlist/UndoCommands.h
+++ b/src/playlist/UndoCommands.h
@@ -20,7 +20,7 @@
 #ifndef AMAROK_UNDOCOMMANDS_H
 #define AMAROK_UNDOCOMMANDS_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QList>
 #include <QPair>
diff --git a/src/playlist/layouts/LayoutItemConfig.cpp b/src/playlist/layouts/LayoutItemConfig.cpp
index 0f9de6b..338381c 100644
--- a/src/playlist/layouts/LayoutItemConfig.cpp
+++ b/src/playlist/layouts/LayoutItemConfig.cpp
@@ -18,11 +18,12 @@
 
 #include "LayoutItemConfig.h"
 
+#include "core/meta/Meta.h"
 #include "playlist/proxymodels/GroupingProxy.h"    // For 'GroupMode'
 
-namespace Playlist {
+using namespace Playlist;
 
-    LayoutItemConfigRowElement::LayoutItemConfigRowElement( int value, qreal size,
+LayoutItemConfigRowElement::LayoutItemConfigRowElement( int value, qreal size,
                                                             bool bold, bool italic, bool underline,
                                                             Qt::Alignment alignment,
                                                             const QString &prefix ,
@@ -243,12 +244,3 @@ void Playlist::PlaylistLayout::setGroupBy( const QString& groupBy )
 {
     m_groupBy = groupBy;
 }
-
-}
-
-
-
-
-
-
-
diff --git a/src/playlist/navigators/AlbumNavigator.h b/src/playlist/navigators/AlbumNavigator.h
index bcc5a8c..24af21d 100644
--- a/src/playlist/navigators/AlbumNavigator.h
+++ b/src/playlist/navigators/AlbumNavigator.h
@@ -23,7 +23,7 @@
 
 #include "NonlinearTrackNavigator.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QList>
 #include <QSet>
diff --git a/src/playlist/navigators/RandomTrackNavigator.cpp b/src/playlist/navigators/RandomTrackNavigator.cpp
index 3220d33..b2fc43c 100644
--- a/src/playlist/navigators/RandomTrackNavigator.cpp
+++ b/src/playlist/navigators/RandomTrackNavigator.cpp
@@ -21,15 +21,16 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "Playlist::RandomTrackNavigator"
-
 #include "RandomTrackNavigator.h"
 
 #include "core/support/Debug.h"
 
+#include <QDateTime>
 #include <QtGlobal> // For 'qrand()'
+
 #include <math.h> // For 'round()'
 
+#define DEBUG_PREFIX "Playlist::RandomTrackNavigator"
 
 Playlist::RandomTrackNavigator::RandomTrackNavigator()
 {
diff --git a/src/playlist/navigators/RepeatAlbumNavigator.h b/src/playlist/navigators/RepeatAlbumNavigator.h
index add4f52..9b6639d 100644
--- a/src/playlist/navigators/RepeatAlbumNavigator.h
+++ b/src/playlist/navigators/RepeatAlbumNavigator.h
@@ -23,7 +23,7 @@
 
 #include "AlbumNavigator.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 namespace Playlist
 {
diff --git a/src/playlist/proxymodels/AbstractModel.h b/src/playlist/proxymodels/AbstractModel.h
index a9a5b6a..7bd0c9a 100644
--- a/src/playlist/proxymodels/AbstractModel.h
+++ b/src/playlist/proxymodels/AbstractModel.h
@@ -18,7 +18,7 @@
 #ifndef AMAROK_PLAYLISTABSTRACTMODEL_H
 #define AMAROK_PLAYLISTABSTRACTMODEL_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "playlist/PlaylistDefines.h"
 #include "playlist/PlaylistItem.h"
 
diff --git a/src/playlist/proxymodels/GroupingProxy.cpp b/src/playlist/proxymodels/GroupingProxy.cpp
index 8b9d680..81b0e66 100644
--- a/src/playlist/proxymodels/GroupingProxy.cpp
+++ b/src/playlist/proxymodels/GroupingProxy.cpp
@@ -21,20 +21,20 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "Playlist::GroupingProxy"
-
 #include "GroupingProxy.h"
 
-#include "core/support/Debug.h"
 #include "core/collections/Collection.h"
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core/meta/support/MetaUtility.h"
 #include "core/capabilities/SourceInfoCapability.h"
+#include "core/support/Debug.h"
 #include "playlist/PlaylistDefines.h"
 
 #include <QVariant>
 #include <QFileInfo>
 
+#define DEBUG_PREFIX "Playlist::GroupingProxy"
 
 Playlist::GroupingProxy::GroupingProxy( Playlist::AbstractModel *belowModel, QObject *parent )
     : ProxyBase( belowModel, parent )
diff --git a/src/playlist/proxymodels/GroupingProxy.h b/src/playlist/proxymodels/GroupingProxy.h
index 3eb835f..8c0ed62 100644
--- a/src/playlist/proxymodels/GroupingProxy.h
+++ b/src/playlist/proxymodels/GroupingProxy.h
@@ -25,7 +25,7 @@
 #define AMAROK_PLAYLISTGROUPINGPROXY_H
 
 #include "ProxyBase.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QHash>
 #include <QModelIndex>
diff --git a/src/playlist/proxymodels/SortAlgorithms.cpp b/src/playlist/proxymodels/SortAlgorithms.cpp
index ce7dc44..47b468c 100644
--- a/src/playlist/proxymodels/SortAlgorithms.cpp
+++ b/src/playlist/proxymodels/SortAlgorithms.cpp
@@ -18,9 +18,12 @@
 
 #include "SortAlgorithms.h"
 
-#include "AbstractModel.h"
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core/support/Debug.h"
+#include "playlist/proxymodels/AbstractModel.h"
+
+#include <QDateTime>
 
 namespace Playlist
 {
diff --git a/src/playlist/view/listview/InlineEditorWidget.cpp b/src/playlist/view/listview/InlineEditorWidget.cpp
index 968fdbc..727fb71 100644
--- a/src/playlist/view/listview/InlineEditorWidget.cpp
+++ b/src/playlist/view/listview/InlineEditorWidget.cpp
@@ -17,13 +17,14 @@
 
 #include "InlineEditorWidget.h"
 
+#include "SvgHandler.h"
+#include "core/meta/Meta.h"
 #include "core/support/Debug.h"
 #include "moodbar/MoodbarManager.h"
 #include "playlist/PlaylistDefines.h"
 #include "playlist/layouts/LayoutManager.h"
 #include "playlist/proxymodels/GroupingProxy.h"
-#include "PrettyItemDelegate.h"
-#include "SvgHandler.h"
+#include "playlist/view/listview/PrettyItemDelegate.h"
 
 #include <KHBox>
 #include <KRatingWidget>
diff --git a/src/playlist/view/listview/PrettyItemDelegate.h b/src/playlist/view/listview/PrettyItemDelegate.h
index 3f41bb9..cd842c9 100644
--- a/src/playlist/view/listview/PrettyItemDelegate.h
+++ b/src/playlist/view/listview/PrettyItemDelegate.h
@@ -20,7 +20,7 @@
 #ifndef PRETTYITEMDELEGATE_H
 #define PRETTYITEMDELEGATE_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "playlist/layouts/LayoutItemConfig.h"
 
 #include <QModelIndex>
diff --git a/src/playlistgenerator/ConstraintFactory.h b/src/playlistgenerator/ConstraintFactory.h
index 2b0030f..d10b81b 100644
--- a/src/playlistgenerator/ConstraintFactory.h
+++ b/src/playlistgenerator/ConstraintFactory.h
@@ -18,9 +18,11 @@
 #define APG_CONSTRAINT_FACTORY
 
 #include <QDomElement>
+#include <QHash>
 #include <QPair>
 #include <QString>
 #include <QStringList>
+
 #include <limits.h>
 
 class Constraint;
diff --git a/src/playlistgenerator/ConstraintGroup.h b/src/playlistgenerator/ConstraintGroup.h
index b5f0ae2..fff4caf 100644
--- a/src/playlistgenerator/ConstraintGroup.h
+++ b/src/playlistgenerator/ConstraintGroup.h
@@ -21,7 +21,7 @@
 
 #include "ConstraintNode.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QDomElement>
 #include <QHash>
diff --git a/src/playlistgenerator/ConstraintNode.h b/src/playlistgenerator/ConstraintNode.h
index f0ae344..0effead 100644
--- a/src/playlistgenerator/ConstraintNode.h
+++ b/src/playlistgenerator/ConstraintNode.h
@@ -17,7 +17,7 @@
 #ifndef APG_CONSTRAINTNODE
 #define APG_CONSTRAINTNODE
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QDomElement>
 #include <QList>
diff --git a/src/playlistgenerator/ConstraintSolver.h b/src/playlistgenerator/ConstraintSolver.h
index fc07bee..4c42c99 100644
--- a/src/playlistgenerator/ConstraintSolver.h
+++ b/src/playlistgenerator/ConstraintSolver.h
@@ -17,11 +17,13 @@
 #ifndef APG_CONSTRAINTSOLVER
 #define APG_CONSTRAINTSOLVER
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
+#include <QHash>
 #include <QMutex>
 #include <QString>
-#include <threadweaver/Job.h>
+
+#include <ThreadWeaver/Job>
 
 class ConstraintNode;
 
@@ -34,8 +36,8 @@ namespace APG {
         Q_OBJECT
 
         public:
-            typedef QHash< Meta::TrackList*, double > Population;
-            
+            typedef QHash<Meta::TrackList*, double> Population;
+
             static const int QUALITY_RANGE; // allows used to adjust speed/quality tradeoff
 
             ConstraintSolver( ConstraintNode*, int );
diff --git a/src/playlistgenerator/Preset.cpp b/src/playlistgenerator/Preset.cpp
index fb6911a..000a0bc 100644
--- a/src/playlistgenerator/Preset.cpp
+++ b/src/playlistgenerator/Preset.cpp
@@ -14,8 +14,6 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "APG::Preset"
-
 #include "Preset.h"
 
 #include "ConstraintNode.h"
@@ -24,14 +22,17 @@
 #include "constraints/TrackSpreader.h"
 
 #include "core/interfaces/Logger.h"
+#include "core/meta/Meta.h"
 #include "core/support/Components.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
 #include "playlist/PlaylistController.h"
 
-
 #include <QDomElement>
-#include <threadweaver/ThreadWeaver.h>
+
+#include <ThreadWeaver/Weaver>
+
+#define DEBUG_PREFIX "APG::Preset"
 
 APG::PresetPtr
 APG::Preset::createFromXml( QDomElement& xmlelem )
@@ -144,12 +145,12 @@ APG::Preset::solverFinished( ThreadWeaver::Job* job )
         debug() << "Solver" << solver->serial() << "finished successfully";
         if ( !solver->satisfied() ) {
             Amarok::Components::logger()->longMessage(
-                        i18n("The playlist generator created a playlist which does not meet all " \
-                             "of your constraints.  If you are not satisfied with the results, " \
-                             "try loosening or removing some constraints and then generating a " \
+                        i18n("The playlist generator created a playlist which does not meet all "
+                             "of your constraints.  If you are not satisfied with the results, "
+                             "try loosening or removing some constraints and then generating a "
                              "new playlist.") );
         }
-        The::playlistController()->insertOptioned( solver->getSolution() , Playlist::Replace );
+        The::playlistController()->insertOptioned( solver->getSolution(), Playlist::Replace );
     } else {
         debug() << "Ignoring results from aborted Solver" << solver->serial();
     }
diff --git a/src/playlistgenerator/Preset.h b/src/playlistgenerator/Preset.h
index ecf5147..878b2a2 100644
--- a/src/playlistgenerator/Preset.h
+++ b/src/playlistgenerator/Preset.h
@@ -17,7 +17,7 @@
 #ifndef APG_PRESET
 #define APG_PRESET
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KSharedPtr>
 
diff --git a/src/playlistgenerator/TreeModel.h b/src/playlistgenerator/TreeModel.h
index e0a2432..c0ef047 100644
--- a/src/playlistgenerator/TreeModel.h
+++ b/src/playlistgenerator/TreeModel.h
@@ -17,7 +17,7 @@
 #ifndef APG_TREEMODEL
 #define APG_TREEMODEL
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QAbstractItemModel>
 #include <QModelIndex>
diff --git a/src/playlistgenerator/constraints/Checkpoint.cpp b/src/playlistgenerator/constraints/Checkpoint.cpp
index b77c628..e647fc1 100644
--- a/src/playlistgenerator/constraints/Checkpoint.cpp
+++ b/src/playlistgenerator/constraints/Checkpoint.cpp
@@ -306,6 +306,10 @@ ConstraintTypes::Checkpoint::TrackMatcher::TrackMatcher( const Meta::TrackPtr& t
 {
 }
 
+ConstraintTypes::Checkpoint::TrackMatcher::~TrackMatcher()
+{
+}
+
 QList<int>
 ConstraintTypes::Checkpoint::TrackMatcher::find( const Meta::TrackList& tl ) const
 {
@@ -333,6 +337,10 @@ ConstraintTypes::Checkpoint::ArtistMatcher::ArtistMatcher( const Meta::ArtistPtr
 {
 }
 
+ConstraintTypes::Checkpoint::ArtistMatcher::~ArtistMatcher()
+{
+}
+
 QList<int>
 ConstraintTypes::Checkpoint::ArtistMatcher::find( const Meta::TrackList& tl ) const
 {
@@ -360,6 +368,10 @@ ConstraintTypes::Checkpoint::AlbumMatcher::AlbumMatcher( const Meta::AlbumPtr& l
 {
 }
 
+ConstraintTypes::Checkpoint::AlbumMatcher::~AlbumMatcher()
+{
+}
+
 QList<int>
 ConstraintTypes::Checkpoint::AlbumMatcher::find( const Meta::TrackList& tl ) const
 {
diff --git a/src/playlistgenerator/constraints/Checkpoint.h b/src/playlistgenerator/constraints/Checkpoint.h
index e965282..75692e3 100644
--- a/src/playlistgenerator/constraints/Checkpoint.h
+++ b/src/playlistgenerator/constraints/Checkpoint.h
@@ -21,7 +21,7 @@
 
 #include "playlistgenerator/Constraint.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QPointer>
 #include <QString>
@@ -97,7 +97,7 @@ namespace ConstraintTypes {
     class Checkpoint::TrackMatcher : public AbstractMatcher {
         public:
             TrackMatcher( const Meta::TrackPtr& );
-            virtual ~TrackMatcher() {}
+            virtual ~TrackMatcher();
 
             virtual QList<int> find( const Meta::TrackList& ) const;
             virtual bool match( const Meta::TrackPtr& ) const;
@@ -110,7 +110,7 @@ namespace ConstraintTypes {
     class Checkpoint::AlbumMatcher : public AbstractMatcher {
         public:
             AlbumMatcher( const Meta::AlbumPtr& );
-            virtual ~AlbumMatcher() {}
+            virtual ~AlbumMatcher();
 
             virtual QList<int> find( const Meta::TrackList& ) const;
             virtual bool match( const Meta::TrackPtr& ) const;
@@ -123,7 +123,7 @@ namespace ConstraintTypes {
     class Checkpoint::ArtistMatcher : public AbstractMatcher {
         public:
             ArtistMatcher( const Meta::ArtistPtr& );
-            virtual ~ArtistMatcher() {}
+            virtual ~ArtistMatcher();
 
             virtual QList<int> find( const Meta::TrackList& ) const;
             virtual bool match( const Meta::TrackPtr& ) const;
diff --git a/src/playlistgenerator/constraints/Matching.h b/src/playlistgenerator/constraints/Matching.h
index eda60b2..2d94e23 100644
--- a/src/playlistgenerator/constraints/Matching.h
+++ b/src/playlistgenerator/constraints/Matching.h
@@ -19,7 +19,7 @@
 
 #include "playlistgenerator/Constraint.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QBitArray>
 
diff --git a/src/playlistgenerator/constraints/PlaylistDuration.cpp b/src/playlistgenerator/constraints/PlaylistDuration.cpp
index 751787b..73fb1e0 100644
--- a/src/playlistgenerator/constraints/PlaylistDuration.cpp
+++ b/src/playlistgenerator/constraints/PlaylistDuration.cpp
@@ -14,16 +14,17 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "Constraint::PlaylistDuration"
-
 #include "PlaylistDuration.h"
 
+#include "core/meta/Meta.h"
 #include "playlistgenerator/Constraint.h"
 #include "playlistgenerator/ConstraintFactory.h"
 
 #include <stdlib.h>
 #include <math.h>
 
+#define DEBUG_PREFIX "Constraint::PlaylistDuration"
+
 Constraint*
 ConstraintTypes::PlaylistDuration::createFromXml( QDomElement& xmlelem, ConstraintNode* p )
 {
@@ -134,7 +135,7 @@ ConstraintTypes::PlaylistDuration::satisfaction( const Meta::TrackList& tl ) con
     foreach( Meta::TrackPtr t, tl ) {
         l += t->length();
     }
-    
+
     double factor = m_strictness * 0.0003;
     if ( m_comparison == CompareNumEquals ) {
         return 4.0 / ( ( 1.0 + exp( factor*( double )( l - m_duration ) ) )*( 1.0 + exp( factor*( double )( m_duration - l ) ) ) );
diff --git a/src/playlistgenerator/constraints/PlaylistFileSize.cpp b/src/playlistgenerator/constraints/PlaylistFileSize.cpp
index de39e2f..e70d179 100644
--- a/src/playlistgenerator/constraints/PlaylistFileSize.cpp
+++ b/src/playlistgenerator/constraints/PlaylistFileSize.cpp
@@ -14,16 +14,17 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "Constraint::PlaylistFileSize"
-
 #include "PlaylistFileSize.h"
 
+#include "core/meta/Meta.h"
 #include "playlistgenerator/Constraint.h"
 #include "playlistgenerator/ConstraintFactory.h"
 
 #include <stdlib.h>
 #include <math.h>
 
+#define DEBUG_PREFIX "Constraint::PlaylistFileSize"
+
 Constraint*
 ConstraintTypes::PlaylistFileSize::createFromXml( QDomElement& xmlelem, ConstraintNode* p )
 {
diff --git a/src/playlistgenerator/constraints/TagMatch.cpp b/src/playlistgenerator/constraints/TagMatch.cpp
index e424054..d53ca53 100644
--- a/src/playlistgenerator/constraints/TagMatch.cpp
+++ b/src/playlistgenerator/constraints/TagMatch.cpp
@@ -22,6 +22,7 @@
 #include "playlistgenerator/ConstraintFactory.h"
 
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core/support/Debug.h"
 
diff --git a/src/playlistgenerator/constraints/TagMatch.h b/src/playlistgenerator/constraints/TagMatch.h
index a39e14f..470a74e 100644
--- a/src/playlistgenerator/constraints/TagMatch.h
+++ b/src/playlistgenerator/constraints/TagMatch.h
@@ -21,7 +21,7 @@
 
 #include "Matching.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QAbstractListModel>
 #include <QBitArray>
diff --git a/src/playlistgenerator/constraints/TrackSpreader.cpp b/src/playlistgenerator/constraints/TrackSpreader.cpp
index 3e27c2b..34f8221 100644
--- a/src/playlistgenerator/constraints/TrackSpreader.cpp
+++ b/src/playlistgenerator/constraints/TrackSpreader.cpp
@@ -14,15 +14,18 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "Constraint::TrackSpreader"
-
 #include "TrackSpreader.h"
 
+#include "core/meta/Meta.h"
 #include "playlistgenerator/Constraint.h"
 
+#include <QHash>
+
 #include <math.h>
 #include <stdlib.h>
 
+#define DEBUG_PREFIX "Constraint::TrackSpreader"
+
 Constraint*
 ConstraintTypes::TrackSpreader::createNew( ConstraintNode* p )
 {
diff --git a/src/playlistgenerator/constraints/TrackSpreader.h b/src/playlistgenerator/constraints/TrackSpreader.h
index 998241b..b41af96 100644
--- a/src/playlistgenerator/constraints/TrackSpreader.h
+++ b/src/playlistgenerator/constraints/TrackSpreader.h
@@ -19,7 +19,7 @@
 
 #include "playlistgenerator/Constraint.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 class Constraint;
 class ConstraintFactoryEntry;
diff --git a/src/playlistmanager/SyncedPlaylist.cpp b/src/playlistmanager/SyncedPlaylist.cpp
index 56be7e8..ae6f9ab 100644
--- a/src/playlistmanager/SyncedPlaylist.cpp
+++ b/src/playlistmanager/SyncedPlaylist.cpp
@@ -17,6 +17,7 @@
 
 #include "SyncedPlaylist.h"
 
+#include "core/meta/Meta.h"
 #include "core/playlists/PlaylistProvider.h"
 #include "core/support/Debug.h"
 
diff --git a/src/playlistmanager/sql/SqlPlaylistGroup.h b/src/playlistmanager/sql/SqlPlaylistGroup.h
index 0e68c57..628910a 100644
--- a/src/playlistmanager/sql/SqlPlaylistGroup.h
+++ b/src/playlistmanager/sql/SqlPlaylistGroup.h
@@ -17,7 +17,7 @@
 #ifndef SQLPLAYLISTGROUP_H
 #define SQLPLAYLISTGROUP_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "SqlPlaylist.h"
 
 #include <QString>
diff --git a/src/services/DynamicServiceQueryMaker.h b/src/services/DynamicServiceQueryMaker.h
index 863d98e..05cfb35 100644
--- a/src/services/DynamicServiceQueryMaker.h
+++ b/src/services/DynamicServiceQueryMaker.h
@@ -17,7 +17,7 @@
 #ifndef DYNAMICSERVICEQUERYMAKER_H
 #define DYNAMICSERVICEQUERYMAKER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/collections/QueryMaker.h"
 #include "ServiceCollection.h"
 #include "amarok_export.h"
diff --git a/src/services/InfoParserBase.cpp b/src/services/InfoParserBase.cpp
index 32406b4..ac35e2f 100644
--- a/src/services/InfoParserBase.cpp
+++ b/src/services/InfoParserBase.cpp
@@ -19,14 +19,13 @@
 #include "core/support/Debug.h"
 
 #include <KStandardDirs>
+#include <KUrl>
 
 #include <QFile>
 #include <QPalette>
 
-
 QString InfoParserBase::s_loadingBaseHtml;
 
-
 InfoParserBase::InfoParserBase()
   : QObject()
 {}
diff --git a/src/services/InfoParserBase.h b/src/services/InfoParserBase.h
index 3b16845..86c07e5 100644
--- a/src/services/InfoParserBase.h
+++ b/src/services/InfoParserBase.h
@@ -18,7 +18,7 @@
 #define INFOPARSERBASE_H
 
 #include "amarok_export.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QObject>
 
diff --git a/src/services/ServiceCollectionTreeView.cpp b/src/services/ServiceCollectionTreeView.cpp
index 81df36b..31a113e 100644
--- a/src/services/ServiceCollectionTreeView.cpp
+++ b/src/services/ServiceCollectionTreeView.cpp
@@ -17,8 +17,9 @@
 #include "ServiceCollectionTreeView.h"
 
 #include "browsers/CollectionTreeItem.h"
-#include "core/support/Debug.h"
 #include "core/capabilities/ActionsCapability.h"
+#include "core/meta/Meta.h"
+#include "core/support/Debug.h"
 
 #include <KMenu>
 
@@ -26,7 +27,6 @@
 #include <QContextMenuEvent>
 #include <QSortFilterProxyModel>
 
-
 ServiceCollectionTreeView::ServiceCollectionTreeView( QWidget *parent )
     : CollectionTreeView( parent )
     , m_playableTracks( true ) //per default, act just like a normal CollectionTreeView
diff --git a/src/services/ampache/LastfmInfoParser.cpp b/src/services/ampache/LastfmInfoParser.cpp
index 7aa9bff..5a0d70a 100644
--- a/src/services/ampache/LastfmInfoParser.cpp
+++ b/src/services/ampache/LastfmInfoParser.cpp
@@ -17,6 +17,7 @@
 
 #include "LastfmInfoParser.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 
diff --git a/src/services/ampache/LastfmInfoParser.h b/src/services/ampache/LastfmInfoParser.h
index 61456e2..d92ff1f 100644
--- a/src/services/ampache/LastfmInfoParser.h
+++ b/src/services/ampache/LastfmInfoParser.h
@@ -18,13 +18,16 @@
 #ifndef LASTFMINFOPARSER_H
 #define LASTFMINFOPARSER_H
 
-#include "../InfoParserBase.h"
+#include "services/InfoParserBase.h"
+
+#include <QMap>
 
 class QNetworkReply;
 
 class LastfmInfoParser : public InfoParserBase
 {
     Q_OBJECT
+
     public:
         LastfmInfoParser() : InfoParserBase() {}
         ~LastfmInfoParser() {}
@@ -38,8 +41,7 @@ class LastfmInfoParser : public InfoParserBase
         void onGetArtistInfo();
 
     private:
-        QMap< QString, QNetworkReply* > m_jobs;
-
+        QMap<QString, QNetworkReply *> m_jobs;
 };
 
 #endif // LASTFMINFOPARSER_H
diff --git a/src/services/lastfm/LastFmServiceSettings.cpp b/src/services/lastfm/LastFmServiceSettings.cpp
index 6ec77a8..bf37fb0 100644
--- a/src/services/lastfm/LastFmServiceSettings.cpp
+++ b/src/services/lastfm/LastFmServiceSettings.cpp
@@ -15,10 +15,9 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "LastFmServiceSettings"
-
 #include "LastFmServiceSettings.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
@@ -33,6 +32,8 @@
 
 #include <XmlQuery.h>
 
+#define DEBUG_PREFIX "LastFmServiceSettings"
+
 K_PLUGIN_FACTORY( LastFmServiceSettingsFactory, registerPlugin<LastFmServiceSettings>(); )
 K_EXPORT_PLUGIN( LastFmServiceSettingsFactory( "kcm_amarok_lastfm" ) )
 
diff --git a/src/services/lastfm/LastFmServiceSettings.h b/src/services/lastfm/LastFmServiceSettings.h
index 7a77650..82b9b00 100644
--- a/src/services/lastfm/LastFmServiceSettings.h
+++ b/src/services/lastfm/LastFmServiceSettings.h
@@ -19,7 +19,7 @@
 #define LASTFMSERVICESETTINGS_H
 
 #include "LastFmServiceConfig.h"
-#include "core/meta/Meta.h" // for using the Meta::LabelList
+#include "core/meta/forward_declarations.h" // for using the Meta::LabelList
 
 #include <kcmodule.h>
 
diff --git a/src/services/lastfm/LastFmTreeModel.h b/src/services/lastfm/LastFmTreeModel.h
index 00fcca6..691229d 100644
--- a/src/services/lastfm/LastFmTreeModel.h
+++ b/src/services/lastfm/LastFmTreeModel.h
@@ -19,7 +19,9 @@
 #ifndef LASTFMTREEMODEL_H
 #define LASTFMTREEMODEL_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
+
+#include <KUrl>
 
 #include <QAbstractItemModel>
 #include <QPixmap>
diff --git a/src/services/lastfm/ScrobblerAdapter.cpp b/src/services/lastfm/ScrobblerAdapter.cpp
index 9510502..4ee47e2 100644
--- a/src/services/lastfm/ScrobblerAdapter.cpp
+++ b/src/services/lastfm/ScrobblerAdapter.cpp
@@ -24,6 +24,7 @@
 #include "MainWindow.h"
 #include "core/collections/Collection.h"
 #include "core/interfaces/Logger.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaConstants.h"
 #include "core/support/Components.h"
 #include "core/support/Debug.h"
diff --git a/src/services/lastfm/ScrobblerAdapter.h b/src/services/lastfm/ScrobblerAdapter.h
index 94c4b62..8854446 100644
--- a/src/services/lastfm/ScrobblerAdapter.h
+++ b/src/services/lastfm/ScrobblerAdapter.h
@@ -19,7 +19,7 @@
 #ifndef LASTFMSCROBBLERADAPTER_H
 #define LASTFMSCROBBLERADAPTER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "services/lastfm/LastFmServiceConfig.h"
 #include "statsyncing/ScrobblingService.h"
 
diff --git a/src/services/lastfm/SimilarArtistsAction.cpp b/src/services/lastfm/SimilarArtistsAction.cpp
index 94120d6..85577ec 100644
--- a/src/services/lastfm/SimilarArtistsAction.cpp
+++ b/src/services/lastfm/SimilarArtistsAction.cpp
@@ -15,8 +15,10 @@
  ****************************************************************************************/
 
 #include "SimilarArtistsAction.h"
-#include "playlist/PlaylistController.h"
+
+#include "core/meta/Meta.h"
 #include "core-impl/collections/support/CollectionManager.h"
+#include "playlist/PlaylistController.h"
 
 #include <KIcon>
 
diff --git a/src/services/lastfm/biases/LastFmBias.cpp b/src/services/lastfm/biases/LastFmBias.cpp
index 6819f60..aaa8d3a 100644
--- a/src/services/lastfm/biases/LastFmBias.cpp
+++ b/src/services/lastfm/biases/LastFmBias.cpp
@@ -14,10 +14,9 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "LastFmBias"
-
 #include "LastFmBias.h"
 
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
@@ -38,6 +37,8 @@
 #include <Artist.h>
 #include <ws.h>
 
+#define DEBUG_PREFIX "LastFmBias"
+
 QString
 Dynamic::LastFmBiasFactory::i18nName() const
 { return i18nc("Name of the \"Last.fm\" similar bias", "Last.fm similar"); }
diff --git a/src/services/lastfm/biases/WeeklyTopBias.cpp b/src/services/lastfm/biases/WeeklyTopBias.cpp
index 50bf5a0..c99c538 100644
--- a/src/services/lastfm/biases/WeeklyTopBias.cpp
+++ b/src/services/lastfm/biases/WeeklyTopBias.cpp
@@ -18,6 +18,7 @@
 #include "WeeklyTopBias.h"
 
 #include "browsers/playlistbrowser/DynamicBiasWidgets.h"
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 #include "core-impl/collections/support/CollectionManager.h"
diff --git a/src/services/lastfm/meta/LastFmMultiPlayableCapability.h b/src/services/lastfm/meta/LastFmMultiPlayableCapability.h
index 4307b54..cdfcb3b 100644
--- a/src/services/lastfm/meta/LastFmMultiPlayableCapability.h
+++ b/src/services/lastfm/meta/LastFmMultiPlayableCapability.h
@@ -22,7 +22,7 @@
 #include "core/support/Debug.h"
 #include "MainWindow.h"
 #include "LastFmMeta.h"
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/capabilities/MultiPlayableCapability.h"
 
 #include <KLocale>
diff --git a/src/services/scriptable/ScriptableServiceQueryMaker.h b/src/services/scriptable/ScriptableServiceQueryMaker.h
index 418ccbb..5b33dad 100644
--- a/src/services/scriptable/ScriptableServiceQueryMaker.h
+++ b/src/services/scriptable/ScriptableServiceQueryMaker.h
@@ -19,7 +19,7 @@
 
 #include "../DynamicServiceQueryMaker.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include "ScriptableServiceCollection.h"
 
diff --git a/src/statsyncing/collection/CollectionProvider.cpp b/src/statsyncing/collection/CollectionProvider.cpp
index 84b7bf7..7e3bdd8 100644
--- a/src/statsyncing/collection/CollectionProvider.cpp
+++ b/src/statsyncing/collection/CollectionProvider.cpp
@@ -20,6 +20,7 @@
 #include "amarokconfig.h"
 #include "core/collections/Collection.h"
 #include "core/collections/QueryMaker.h"
+#include "core/meta/Meta.h"
 #include "statsyncing/collection/CollectionTrack.h"
 
 using namespace StatSyncing;
diff --git a/src/statsyncing/collection/CollectionProvider.h b/src/statsyncing/collection/CollectionProvider.h
index f8047f7..d785b43 100644
--- a/src/statsyncing/collection/CollectionProvider.h
+++ b/src/statsyncing/collection/CollectionProvider.h
@@ -17,11 +17,15 @@
 #ifndef STATSYNCING_COLLECTIONPROVIDER_H
 #define STATSYNCING_COLLECTIONPROVIDER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "statsyncing/Provider.h"
 
 #include <QSemaphore>
 
+namespace Collections {
+    class Collection;
+}
+
 namespace StatSyncing
 {
     /**
diff --git a/src/statsyncing/collection/CollectionTrack.cpp b/src/statsyncing/collection/CollectionTrack.cpp
index aa94700..299c40c 100644
--- a/src/statsyncing/collection/CollectionTrack.cpp
+++ b/src/statsyncing/collection/CollectionTrack.cpp
@@ -16,6 +16,7 @@
 
 #include "CollectionTrack.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core/support/Debug.h"
 
diff --git a/src/statsyncing/collection/CollectionTrack.h b/src/statsyncing/collection/CollectionTrack.h
index 52ca7a5..109f004 100644
--- a/src/statsyncing/collection/CollectionTrack.h
+++ b/src/statsyncing/collection/CollectionTrack.h
@@ -17,7 +17,7 @@
 #ifndef STATSYNCING_COLLECTIONTRACK_H
 #define STATSYNCING_COLLECTIONTRACK_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "statsyncing/Track.h"
 
 namespace StatSyncing
diff --git a/src/statsyncing/jobs/SynchronizeTracksJob.cpp b/src/statsyncing/jobs/SynchronizeTracksJob.cpp
index 9a6a045..b789aa3 100644
--- a/src/statsyncing/jobs/SynchronizeTracksJob.cpp
+++ b/src/statsyncing/jobs/SynchronizeTracksJob.cpp
@@ -16,6 +16,7 @@
 
 #include "SynchronizeTracksJob.h"
 
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core/support/Components.h"
 #include "core/support/Debug.h"
diff --git a/src/statsyncing/jobs/SynchronizeTracksJob.h b/src/statsyncing/jobs/SynchronizeTracksJob.h
index bf0b3a9..efa7736 100644
--- a/src/statsyncing/jobs/SynchronizeTracksJob.h
+++ b/src/statsyncing/jobs/SynchronizeTracksJob.h
@@ -17,7 +17,7 @@
 #ifndef STATSYNCING_SYNCHRONIZETRACKSJOB_H
 #define STATSYNCING_SYNCHRONIZETRACKSJOB_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "statsyncing/Options.h"
 #include "statsyncing/ScrobblingService.h"
 #include "statsyncing/Track.h"
diff --git a/src/synchronization/SynchronizationBaseJob.cpp b/src/synchronization/SynchronizationBaseJob.cpp
index 659877f..caefa2b 100644
--- a/src/synchronization/SynchronizationBaseJob.cpp
+++ b/src/synchronization/SynchronizationBaseJob.cpp
@@ -18,8 +18,9 @@
 
 #include "core/collections/Collection.h"
 #include "core/collections/QueryMaker.h"
-#include "core/support/Debug.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaConstants.h"
+#include "core/support/Debug.h"
 
 #include <QMetaEnum>
 #include <QMetaObject>
diff --git a/src/synchronization/SynchronizationBaseJob.h b/src/synchronization/SynchronizationBaseJob.h
index bfb1b42..54619b4 100644
--- a/src/synchronization/SynchronizationBaseJob.h
+++ b/src/synchronization/SynchronizationBaseJob.h
@@ -17,7 +17,7 @@
 #ifndef SYNCHRONIZATIONBASEJOB_H
 #define SYNCHRONIZATIONBASEJOB_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaKeys.h"
 
 #include <QHash>
diff --git a/src/synchronization/UnionJob.h b/src/synchronization/UnionJob.h
index a95d1d9..8c566f3 100644
--- a/src/synchronization/UnionJob.h
+++ b/src/synchronization/UnionJob.h
@@ -19,7 +19,7 @@
 
 #include "SynchronizationBaseJob.h"
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QMap>
 #include <QPair>
diff --git a/src/toolbar/MainToolbar.h b/src/toolbar/MainToolbar.h
index 0c4ba10..f47d33d 100644
--- a/src/toolbar/MainToolbar.h
+++ b/src/toolbar/MainToolbar.h
@@ -27,7 +27,7 @@ class VolumeDial;
 
 namespace Amarok { class TimeSlider; }
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include <QToolBar>
 
 class MainToolbar : public QToolBar
diff --git a/src/widgets/AlbumBreadcrumbWidget.cpp b/src/widgets/AlbumBreadcrumbWidget.cpp
index 614a1b0..c938c50 100644
--- a/src/widgets/AlbumBreadcrumbWidget.cpp
+++ b/src/widgets/AlbumBreadcrumbWidget.cpp
@@ -15,7 +15,9 @@
  ****************************************************************************************/
 
 #include "AlbumBreadcrumbWidget.h"
-#include "BreadcrumbItemButton.h"
+
+#include "core/meta/Meta.h"
+#include "widgets/BreadcrumbItemButton.h"
 
 #include <KIcon>
 #include <KLocale>
diff --git a/src/widgets/AlbumBreadcrumbWidget.h b/src/widgets/AlbumBreadcrumbWidget.h
index 498c191..11cb5dd 100644
--- a/src/widgets/AlbumBreadcrumbWidget.h
+++ b/src/widgets/AlbumBreadcrumbWidget.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_ALBUMBREADCRUMBWIDGET_H
 #define AMAROK_ALBUMBREADCRUMBWIDGET_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KHBox>
 
diff --git a/src/widgets/MetaQueryWidget.h b/src/widgets/MetaQueryWidget.h
index 5ba8ef9..7434231 100644
--- a/src/widgets/MetaQueryWidget.h
+++ b/src/widgets/MetaQueryWidget.h
@@ -23,7 +23,7 @@
 
 #include <QWidget>
 #include <QWeakPointer>
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/meta/support/MetaConstants.h"
 
 class QFrame;
diff --git a/src/widgets/Osd.h b/src/widgets/Osd.h
index 8ef3f30..9ba57d2 100644
--- a/src/widgets/Osd.h
+++ b/src/widgets/Osd.h
@@ -18,7 +18,7 @@
 #ifndef AMAROK_OSD_H
 #define AMAROK_OSD_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QImage>
 #include <QPixmap>
diff --git a/src/widgets/ProgressWidget.h b/src/widgets/ProgressWidget.h
index 710d237..42fb215 100644
--- a/src/widgets/ProgressWidget.h
+++ b/src/widgets/ProgressWidget.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_PROGRESSWIDGET_H
 #define AMAROK_PROGRESSWIDGET_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <Phonon/Global>
 
diff --git a/src/widgets/TrackSelectWidget.cpp b/src/widgets/TrackSelectWidget.cpp
index 82880b4..48ac94f 100644
--- a/src/widgets/TrackSelectWidget.cpp
+++ b/src/widgets/TrackSelectWidget.cpp
@@ -14,14 +14,13 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
  ****************************************************************************************/
 
-#define DEBUG_PREFIX "TrackSelectWidget"
-
 #include "TrackSelectWidget.h"
 
 #include "amarokconfig.h"
 #include "browsers/CollectionTreeItem.h"
 #include "browsers/CollectionTreeItemModel.h"
 #include "browsers/CollectionTreeView.h"
+#include "core/meta/Meta.h"
 #include "core/support/Amarok.h"
 #include "core/support/Debug.h"
 #include "widgets/PrettyTreeDelegate.h"
@@ -32,6 +31,8 @@
 
 #include <QLabel>
 
+#define DEBUG_PREFIX "TrackSelectWidget"
+
 TrackSelectWidget::TrackSelectWidget( QWidget* parent )
     : KVBox( parent )
 {
diff --git a/src/widgets/TrackSelectWidget.h b/src/widgets/TrackSelectWidget.h
index f170756..5f6f7f6 100644
--- a/src/widgets/TrackSelectWidget.h
+++ b/src/widgets/TrackSelectWidget.h
@@ -17,7 +17,7 @@
 #ifndef AMAROK_TRACK_SELECT_WIDGET_H
 #define AMAROK_TRACK_SELECT_WIDGET_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <KVBox>
 
diff --git a/tests/MetaNotificationSpy.cpp b/tests/MetaNotificationSpy.cpp
index eac1a9c..1d86f40 100644
--- a/tests/MetaNotificationSpy.cpp
+++ b/tests/MetaNotificationSpy.cpp
@@ -16,6 +16,8 @@
 
 #include "MetaNotificationSpy.h"
 
+#include "core/meta/Meta.h"
+
 class MetaNotificationSpyPrivate : public Meta::Observer
 {
 public:
diff --git a/tests/MetaNotificationSpy.h b/tests/MetaNotificationSpy.h
index 4595564..e68c428 100644
--- a/tests/MetaNotificationSpy.h
+++ b/tests/MetaNotificationSpy.h
@@ -17,7 +17,7 @@
 #ifndef METANOTIFICATIONSPY_H
 #define METANOTIFICATIONSPY_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 class MetaNotificationSpyPrivate;
 
diff --git a/tests/core-impl/collections/support/TestMemoryQueryMaker.h b/tests/core-impl/collections/support/TestMemoryQueryMaker.h
index 4e64e54..c3f0770 100644
--- a/tests/core-impl/collections/support/TestMemoryQueryMaker.h
+++ b/tests/core-impl/collections/support/TestMemoryQueryMaker.h
@@ -20,7 +20,7 @@
 
 #include<QtTest/QTest>
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 #include "core/collections/QueryMaker.h"
 
 #include "core-impl/collections/support/MemoryCollection.h"
diff --git a/tests/core-impl/meta/multi/TestMetaMultiTrack.h b/tests/core-impl/meta/multi/TestMetaMultiTrack.h
index c1dd5eb..4265daa 100644
--- a/tests/core-impl/meta/multi/TestMetaMultiTrack.h
+++ b/tests/core-impl/meta/multi/TestMetaMultiTrack.h
@@ -20,9 +20,10 @@
 #ifndef TESTMETAMULTITRACK_H
 #define TESTMETAMULTITRACK_H
 
+#include "core/meta/Meta.h"
 #include "core/playlists/Playlist.h"
 
-#include <QtCore/QObject>
+#include <QObject>
 
 namespace Meta {
     class MultiTrack;
diff --git a/tests/core/collections/support/TestTrackForUrlWorker.cpp b/tests/core/collections/support/TestTrackForUrlWorker.cpp
index 110878d..faa752e 100644
--- a/tests/core/collections/support/TestTrackForUrlWorker.cpp
+++ b/tests/core/collections/support/TestTrackForUrlWorker.cpp
@@ -16,6 +16,7 @@
 #include "TestTrackForUrlWorker.h"
 
 #include "config-amarok-test.h"
+#include "core/meta/Meta.h"
 #include "core-impl/collections/support/CollectionManager.h"
 #include "mocks/MockTrackForUrlWorker.h"
 
@@ -117,3 +118,5 @@ TestTrackForUrlWorker::setEmittedTrack( Meta::TrackPtr track )
 {
     m_emittedTrack = track;
 }
+
+#include "TestTrackForUrlWorker.moc"
diff --git a/tests/core/collections/support/TestTrackForUrlWorker.h b/tests/core/collections/support/TestTrackForUrlWorker.h
index 5f4786c..0e61924 100644
--- a/tests/core/collections/support/TestTrackForUrlWorker.h
+++ b/tests/core/collections/support/TestTrackForUrlWorker.h
@@ -16,7 +16,7 @@
 #ifndef TESTTRACKFORURLWORKER_H
 #define TESTTRACKFORURLWORKER_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QtTest>
 
diff --git a/tests/core/meta/TestMetaTrack.cpp b/tests/core/meta/TestMetaTrack.cpp
index 6eb6277..5023113 100644
--- a/tests/core/meta/TestMetaTrack.cpp
+++ b/tests/core/meta/TestMetaTrack.cpp
@@ -21,6 +21,7 @@
 
 #include "amarokconfig.h"
 #include "config-amarok-test.h"
+#include "core/meta/Meta.h"
 #include "core/meta/Statistics.h"
 #include "core-impl/collections/support/CollectionManager.h"
 
@@ -34,6 +35,10 @@ TestMetaTrack::TestMetaTrack()
     : m_trackPath( dataPath( "/data/audio/Platz 01.mp3" ) )
 {}
 
+TestMetaTrack::~TestMetaTrack()
+{
+}
+
 QString
 TestMetaTrack::dataPath( const QString &relPath )
 {
@@ -55,11 +60,6 @@ void TestMetaTrack::initTestCase()
     AmarokConfig::setWriteBackStatistics( true );
 }
 
-void TestMetaTrack::cleanupTestCase()
-{
-}
-
-
 void TestMetaTrack::testPrettyName()
 {
     QCOMPARE( m_testTrack1->prettyName(), QString( "Platz 01" ) );
diff --git a/tests/core/meta/TestMetaTrack.h b/tests/core/meta/TestMetaTrack.h
index ca1e7467..d462866 100644
--- a/tests/core/meta/TestMetaTrack.h
+++ b/tests/core/meta/TestMetaTrack.h
@@ -20,7 +20,7 @@
 #ifndef TESTMETATRACK_H
 #define TESTMETATRACK_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QtCore/QObject>
 #include <QtCore/QString>
@@ -32,10 +32,10 @@ Q_OBJECT
 
 public:
     TestMetaTrack();
+    ~TestMetaTrack();
 
 private slots:
     void initTestCase();
-    void cleanupTestCase();
 
     void testPrettyName();
     void testPlayableUrl();
diff --git a/tests/core/meta/support/TestMetaAlbumKey.cpp b/tests/core/meta/support/TestMetaAlbumKey.cpp
index 23cd100..6b8cbeb 100644
--- a/tests/core/meta/support/TestMetaAlbumKey.cpp
+++ b/tests/core/meta/support/TestMetaAlbumKey.cpp
@@ -16,13 +16,18 @@
 #include "TestMetaAlbumKey.h"
 
 #include "config-amarok-test.h"
-#include "core-impl/collections/support/CollectionManager.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaKeys.h"
+#include "core-impl/collections/support/CollectionManager.h"
 
 #include <qtest_kde.h>
 
 QTEST_KDEMAIN_CORE( TestMetaAlbumKey )
 
+TestMetaAlbumKey::~TestMetaAlbumKey()
+{
+}
+
 void
 TestMetaAlbumKey::initTestCase()
 {
diff --git a/tests/core/meta/support/TestMetaAlbumKey.h b/tests/core/meta/support/TestMetaAlbumKey.h
index d72b291..b3fb35e 100644
--- a/tests/core/meta/support/TestMetaAlbumKey.h
+++ b/tests/core/meta/support/TestMetaAlbumKey.h
@@ -16,7 +16,7 @@
 #ifndef TESTMETAALBUMKEY_H
 #define TESTMETAALBUMKEY_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QtTest>
 
@@ -24,6 +24,9 @@ class TestMetaAlbumKey : public QObject
 {
     Q_OBJECT
 
+    public:
+        ~TestMetaAlbumKey();
+
     private slots:
         void initTestCase();
 
diff --git a/tests/core/meta/support/TestMetaTrackKey.cpp b/tests/core/meta/support/TestMetaTrackKey.cpp
index 19bee64..962e490 100644
--- a/tests/core/meta/support/TestMetaTrackKey.cpp
+++ b/tests/core/meta/support/TestMetaTrackKey.cpp
@@ -16,8 +16,9 @@
 #include "TestMetaTrackKey.h"
 
 #include "config-amarok-test.h"
-#include "core-impl/collections/support/CollectionManager.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/MetaKeys.h"
+#include "core-impl/collections/support/CollectionManager.h"
 
 #include <qtest_kde.h>
 
diff --git a/tests/core/meta/support/TestPrivateMetaRegistry.cpp b/tests/core/meta/support/TestPrivateMetaRegistry.cpp
index b62cc82..b9e878b 100644
--- a/tests/core/meta/support/TestPrivateMetaRegistry.cpp
+++ b/tests/core/meta/support/TestPrivateMetaRegistry.cpp
@@ -15,9 +15,10 @@
 
 #include "TestPrivateMetaRegistry.h"
 
+#include "config-amarok-test.h"
+#include "core/meta/Meta.h"
 #include "core/meta/support/PrivateMetaRegistry.h"
 #include "core-impl/collections/support/CollectionManager.h"
-#include "config-amarok-test.h"
 
 #include <qtest_kde.h>
 
@@ -25,6 +26,10 @@ using namespace Meta;
 
 QTEST_KDEMAIN_CORE( TestPrivateMetaRegistry )
 
+TestPrivateMetaRegistry::~TestPrivateMetaRegistry()
+{
+}
+
 void
 TestPrivateMetaRegistry::initTestCase()
 {
diff --git a/tests/core/meta/support/TestPrivateMetaRegistry.h b/tests/core/meta/support/TestPrivateMetaRegistry.h
index ebe105c..320e280 100644
--- a/tests/core/meta/support/TestPrivateMetaRegistry.h
+++ b/tests/core/meta/support/TestPrivateMetaRegistry.h
@@ -16,7 +16,7 @@
 #ifndef TESTMETAPRIVATEMETAREGISTRY_H
 #define TESTMETAPRIVATEMETAREGISTRY_H
 
-#include "core/meta/Meta.h"
+#include "core/meta/forward_declarations.h"
 
 #include <QtTest>
 
@@ -26,6 +26,9 @@ class TestPrivateMetaRegistry : public QObject
 {
     Q_OBJECT
 
+    public:
+        ~TestPrivateMetaRegistry();
+
     private slots:
         void initTestCase();
 
diff --git a/tests/mocks/MockTrackForUrlWorker.cpp b/tests/mocks/MockTrackForUrlWorker.cpp
index c960f92..5e67d5f 100644
--- a/tests/mocks/MockTrackForUrlWorker.cpp
+++ b/tests/mocks/MockTrackForUrlWorker.cpp
@@ -15,6 +15,8 @@
 
 #include "MockTrackForUrlWorker.h"
 
+#include "core/meta/Meta.h"
+
 MockTrackForUrlWorker::MockTrackForUrlWorker( const KUrl &url )
     : TrackForUrlWorker( url )
 {
diff --git a/tests/scanner/TestGenericScanManager.cpp b/tests/scanner/TestGenericScanManager.cpp
index 88f9bde..5f74dcf 100644
--- a/tests/scanner/TestGenericScanManager.cpp
+++ b/tests/scanner/TestGenericScanManager.cpp
@@ -25,8 +25,9 @@
 
 #include <qtest_kde.h>
 
-#include <QTest>
+#include <QImage>
 #include <QScopedPointer>
+#include <QTest>
 
 QTEST_KDEMAIN_CORE( TestGenericScanManager )
 



More information about the Amarok-devel mailing list