Use a KPluginSelector instead of the custom crap that, in my ignorance, I had half...
[amarok.git] / src / servicebrowser / shoutcast / ShoutcastService.cpp
blob975abcdeea568ba4af1b6bf104be4d5e1e7ee2f4
1 /***************************************************************************
2 * Copyright (c) 2007 Nikolaj Hald Nielsen <nhnFreespirit@gmail.com> *
3 * (c) 2007 Adam Pigg <adam@piggz.co.uk> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #include "ShoutcastService.h"
23 #include "debug.h"
24 #include "amarok.h"
25 #include "ContextStatusBar.h"
27 #include <KTemporaryFile>
31 using namespace Meta;
33 AMAROK_EXPORT_PLUGIN( ShoutcastServiceFactory )
35 void ShoutcastServiceFactory::init()
37 ServiceBase* service = new ShoutcastService( "Shoutcast.com" );
38 emit newService( service );
41 QString ShoutcastServiceFactory::name()
43 return "Shoutcast.com";
47 KPluginInfo ShoutcastServiceFactory::info()
49 return KPluginInfo( "amarok_service-shoutcast.desktop", "services" );
53 ShoutcastService::ShoutcastService( const char *name )
54 : ServiceBase( "Shoutcast Directory" )
56 setObjectName( name );
57 setShortDescription( i18n( "The biggest damn list of online radio stations on the net :-)" ) );
58 setIcon( KIcon( Amarok::icon( "network-wireless" ) ) );
59 showInfo( false );
63 ShoutcastService::~ShoutcastService()
67 void ShoutcastService::polish()
69 DEBUG_BLOCK
71 if ( m_polished )
72 return;
74 m_collection = new ShoutcastServiceCollection();
75 QList<int> levels;
76 levels << CategoryId::Genre;
77 setModel( new SingleCollectionTreeItemModel( m_collection, levels ) );
78 m_polished = true;
83 #include "ShoutcastService.moc"