Revision c46ed13...

Go back to digest for 5th May 2013

Other in Multimedia

Matěj Laitl committed changes in [amarok] /:

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.

File Changes

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