File indexing completed on 2024-05-05 04:49:23

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Maximilian Kossick <maximilian.kossick@googlemail.com>            *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef UNIONJOB_H
0018 #define UNIONJOB_H
0019 
0020 #include "SynchronizationBaseJob.h"
0021 
0022 #include "core/meta/forward_declarations.h"
0023 
0024 #include <QMap>
0025 #include <QPair>
0026 #include <QSet>
0027 
0028 namespace Amarok
0029 {
0030     class Collection;
0031 }
0032 
0033 /**
0034  * @class UnionJob
0035  * As the result of this job both collections contain the union
0036  * of the tracks in both collections, i.e. it adds tracks that are in
0037  * collection A but not in collection B to B and tracks that are in B but
0038  * not in A to A. It does not remove tracks from either A or B.
0039  */
0040 class UnionJob : public SynchronizationBaseJob
0041 {
0042     Q_OBJECT
0043     public:
0044         UnionJob( Collections::Collection *collA, Collections::Collection *collB );
0045         ~UnionJob() override;
0046 
0047     protected:
0048         void doSynchronization( const Meta::TrackList &tracks, InSet syncDirection, Collections::Collection *collA, Collections::Collection *collB ) override;
0049 };
0050 
0051 
0052 #endif