File indexing completed on 2024-05-19 04:49:59

0001 /****************************************************************************************
0002  * Copyright (c) 2010 Bart Cerneels <bart.cerneels@kde.org>                             *
0003  * Copyright (c) 2011 Lucas Lira Gomes <x8lucas8x@gmail.com>                            *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 #ifndef KCONFIGSYNCRELSTORE_H
0018 #define KCONFIGSYNCRELSTORE_H
0019 
0020 #include "playlistmanager/SyncRelationStorage.h"
0021 
0022 #include <QMap>
0023 
0024 class KConfigGroup;
0025 
0026 class KConfigSyncRelStore : public SyncRelationStorage
0027 {
0028 public:
0029     KConfigSyncRelStore();
0030 
0031     ~KConfigSyncRelStore() override;
0032 
0033     void addSync( const Playlists::PlaylistPtr master, const Playlists::PlaylistPtr slave ) override;
0034     bool hasToSync( Playlists::PlaylistPtr master, Playlists::PlaylistPtr slave ) const override;
0035     SyncedPlaylistPtr asSyncedPlaylist( const Playlists::PlaylistPtr playlist ) override;
0036 
0037 private:
0038     KConfigGroup syncedPlaylistsConfig() const;
0039 
0040     QMap<QUrl,SyncedPlaylistPtr> m_syncMasterMap;
0041     QMultiMap<QUrl,QUrl> m_syncSlaveMap;
0042 };
0043 
0044 #endif // KCONFIGSYNCRELSTORE_H