1 /****************************************************************************************
2 * Copyright (c) 2008 Casey Link <unnamedrambler@gmail.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify it under *
5 * the terms of the GNU General Public License as published by the Free Software *
6 * Foundation; either version 2 of the License, or (at your option) any later *
7 * version. *
8 * *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
11 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU General Public License along with *
14 * this program. If not, see <http://www.gnu.org/licenses/>. *
15 ****************************************************************************************/
16
17 #include "ServiceCollectionLocation.h"
18 #include "core/support/Debug.h"
19
20 using namespace Collections;
21
ServiceCollectionLocation()22 ServiceCollectionLocation::ServiceCollectionLocation()
23 : CollectionLocation()
24 , m_removeSources( false )
25 , m_overwriteFiles( false )
26 {}
27
ServiceCollectionLocation(ServiceCollection * parentCollection)28 ServiceCollectionLocation::ServiceCollectionLocation( ServiceCollection *parentCollection )
29 : CollectionLocation( parentCollection )
30 , m_collection( parentCollection )
31 , m_removeSources( false )
32 , m_overwriteFiles( false )
33 {}
34
~ServiceCollectionLocation()35 ServiceCollectionLocation::~ServiceCollectionLocation()
36 {
37 }
38
prettyLocation() const39 QString ServiceCollectionLocation::prettyLocation() const
40 {
41 return QString();
42 }
43
isWritable() const44 bool ServiceCollectionLocation::isWritable() const
45 {
46 return false;
47 }
48
isOrganizable() const49 bool ServiceCollectionLocation::isOrganizable() const
50 {
51 return false;
52 }
53
54 void
getKIOCopyableUrls(const Meta::TrackList & tracks)55 ServiceCollectionLocation::getKIOCopyableUrls( const Meta::TrackList &tracks )
56 {
57 QMap<Meta::TrackPtr, QUrl> urls;
58 foreach( const Meta::TrackPtr &track, tracks )
59 {
60 Meta::ServiceTrack *servtrack = static_cast<Meta::ServiceTrack *>( track.data() );
61 if( servtrack->isPlayable() )
62 urls.insert( track, servtrack->downloadableUrl() );
63 }
64
65 slotGetKIOCopyableUrlsDone( urls );
66 }
67