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

0001 /****************************************************************************************
0002  * Copyright (c) 2007-2008 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 #include "core/collections/Collection.h"
0018 
0019 #include "core/collections/CollectionLocation.h"
0020 #include "core/meta/Meta.h"
0021 
0022 Collections::CollectionFactory::CollectionFactory()
0023     : Plugins::PluginFactory()
0024 {
0025 }
0026 
0027 Collections::CollectionFactory::~CollectionFactory()
0028 {
0029 }
0030 
0031 
0032 Collections::TrackProvider::TrackProvider()
0033 {
0034 }
0035 
0036 Collections::TrackProvider::~TrackProvider()
0037 {
0038 }
0039 
0040 bool
0041 Collections::TrackProvider::possiblyContainsTrack( const QUrl &url ) const
0042 {
0043     Q_UNUSED( url )
0044     return false;
0045 }
0046 
0047 Meta::TrackPtr
0048 Collections::TrackProvider::trackForUrl( const QUrl &url )
0049 {
0050     Q_UNUSED( url )
0051     return Meta::TrackPtr();
0052 }
0053 
0054 // Collection
0055 
0056 Collections::Collection::~Collection()
0057 {
0058 }
0059 
0060 QString
0061 Collections::Collection::uidUrlProtocol() const
0062 {
0063     return QString();
0064 }
0065 
0066 Collections::CollectionLocation*
0067 Collections::Collection::location()
0068 {
0069     return new Collections::CollectionLocation( this );
0070 }
0071 
0072 bool
0073 Collections::Collection::isWritable() const
0074 {
0075     Collections::CollectionLocation* loc = const_cast<Collections::Collection *>(this)->location();
0076     if( !loc )
0077         return false;
0078     bool writable = loc->isWritable();
0079     delete loc;
0080     return writable;
0081 }
0082 
0083 bool
0084 Collections::Collection::isOrganizable() const
0085 {
0086     Collections::CollectionLocation* loc = const_cast<Collections::Collection *>(this)->location();
0087     if( !loc )
0088         return false;
0089     bool organizable = loc->isOrganizable();
0090     delete loc;
0091     return organizable;
0092 }
0093