diff options
Diffstat (limited to 'src/plugins/PlayListFormats/xspf')
| -rw-r--r-- | src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp | 37 | ||||
| -rw-r--r-- | src/plugins/PlayListFormats/xspf/xspfplaylistformat.h | 13 |
2 files changed, 13 insertions, 37 deletions
diff --git a/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp b/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp index 2e1296b48..4e6c2a349 100644 --- a/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp +++ b/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -23,13 +23,19 @@ #include <QFileInfo> #include <QUrl> #include <QtPlugin> - #include <qmmp/qmmp.h> - #include "xspfplaylistformat.h" // Needs more work - it's better use libSpiff there and put it as plugin. +const PlayListFormatProperties XSPFPlaylistFormat::XSPFPlaylistFormat::properties() const +{ + PlayListFormatProperties p; + p.filters << "*.xspf"; + p.shortName = "xspf"; + return p; +} + QStringList XSPFPlaylistFormat::decode(const QString & contents) { QStringList out; @@ -138,29 +144,4 @@ QString XSPFPlaylistFormat::encode(const QList<PlayListItem*> & files) return doc.toString().prepend(xml_header); } -XSPFPlaylistFormat::XSPFPlaylistFormat() -{ - m_supported_formats << "xspf"; -} - -bool XSPFPlaylistFormat::hasFormat(const QString & f) -{ - foreach(QString s,m_supported_formats) - if (f == s) - return true; - - return false; -} - -QStringList XSPFPlaylistFormat::getExtensions() const -{ - return m_supported_formats; -} - - -QString XSPFPlaylistFormat::name() const -{ - return "XSPFPlaylistFormat"; -} - Q_EXPORT_PLUGIN2(xspfplaylistformat,XSPFPlaylistFormat) diff --git a/src/plugins/PlayListFormats/xspf/xspfplaylistformat.h b/src/plugins/PlayListFormats/xspf/xspfplaylistformat.h index 2b72c8613..4570c041d 100644 --- a/src/plugins/PlayListFormats/xspf/xspfplaylistformat.h +++ b/src/plugins/PlayListFormats/xspf/xspfplaylistformat.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -35,14 +35,9 @@ class XSPFPlaylistFormat : public QObject, public PlayListFormat Q_OBJECT Q_INTERFACES(PlayListFormat) public: - XSPFPlaylistFormat(); - virtual QStringList getExtensions()const; - virtual bool hasFormat(const QString&); - virtual QStringList decode(const QString& contents); - virtual QString encode(const QList<PlayListItem*>& contents); - virtual QString name()const; -protected: - QStringList m_supported_formats; + const PlayListFormatProperties properties() const; + QStringList decode(const QString& contents); + QString encode(const QList<PlayListItem*>& contents); }; #endif |
