diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-12-22 10:46:29 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-12-22 10:46:29 +0000 |
| commit | 954146ff9b69591f0cf3895e96922bb55ad88502 (patch) | |
| tree | b495690d6ed2a6b5251fd1e8a428b550354a0cba /src/plugins/PlayListFormats/m3u | |
| parent | 2b286b3f3713a224839b9444579046556b608c58 (diff) | |
| download | qmmp-954146ff9b69591f0cf3895e96922bb55ad88502.tar.gz qmmp-954146ff9b69591f0cf3895e96922bb55ad88502.tar.bz2 qmmp-954146ff9b69591f0cf3895e96922bb55ad88502.zip | |
playlist format api cleanup
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3088 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/PlayListFormats/m3u')
| -rw-r--r-- | src/plugins/PlayListFormats/m3u/m3uplaylistformat.cpp | 24 | ||||
| -rw-r--r-- | src/plugins/PlayListFormats/m3u/m3uplaylistformat.h | 14 |
2 files changed, 11 insertions, 27 deletions
diff --git a/src/plugins/PlayListFormats/m3u/m3uplaylistformat.cpp b/src/plugins/PlayListFormats/m3u/m3uplaylistformat.cpp index 8349f1274..3f1270eec 100644 --- a/src/plugins/PlayListFormats/m3u/m3uplaylistformat.cpp +++ b/src/plugins/PlayListFormats/m3u/m3uplaylistformat.cpp @@ -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 * @@ -22,19 +22,12 @@ #include <QtPlugin> #include "m3uplaylistformat.h" -bool M3UPlaylistFormat::hasFormat(const QString &f) +const PlayListFormatProperties M3UPlaylistFormat::properties() const { - return m_supported_formats.contains(f); -} - -QStringList M3UPlaylistFormat::getExtensions() const -{ - return m_supported_formats; -} - -M3UPlaylistFormat::M3UPlaylistFormat() -{ - m_supported_formats << "m3u"; + PlayListFormatProperties p; + p.filters << "*.m3u"; + p.shortName = "m3u"; + return p; } QStringList M3UPlaylistFormat::decode(const QString & contents) @@ -70,9 +63,4 @@ QString M3UPlaylistFormat::encode(const QList<PlayListItem*> & contents) return out.join("\n"); } -QString M3UPlaylistFormat::name() const -{ - return "M3UPlaylistFormat"; -} - Q_EXPORT_PLUGIN2(m3uplaylistformat,M3UPlaylistFormat) diff --git a/src/plugins/PlayListFormats/m3u/m3uplaylistformat.h b/src/plugins/PlayListFormats/m3u/m3uplaylistformat.h index 4a5414894..4c2405abf 100644 --- a/src/plugins/PlayListFormats/m3u/m3uplaylistformat.h +++ b/src/plugins/PlayListFormats/m3u/m3uplaylistformat.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,10 @@ class M3UPlaylistFormat : public QObject, public PlayListFormat Q_OBJECT Q_INTERFACES(PlayListFormat) public: - M3UPlaylistFormat(); - 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 |
