Make static
This commit is contained in:
@@ -267,7 +267,7 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
|
||||
// This and the kFileLineRegExp do most of the "dirty" work, namely: splitting the raw .cue
|
||||
// line into logical parts and getting rid of all the unnecessary whitespaces and quoting.
|
||||
QStringList CueParser::SplitCueLine(const QString &line) const {
|
||||
QStringList CueParser::SplitCueLine(const QString &line) {
|
||||
|
||||
QRegularExpression line_regexp(kFileLineRegExp);
|
||||
QRegularExpressionMatch re_match = line_regexp.match(line.trimmed());
|
||||
@@ -281,7 +281,7 @@ QStringList CueParser::SplitCueLine(const QString &line) const {
|
||||
}
|
||||
|
||||
// Updates the song with data from the .cue entry. This one mustn't be used for the last song in the .cue file.
|
||||
bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) const {
|
||||
bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) {
|
||||
|
||||
qint64 beginning = IndexToMarker(entry.index);
|
||||
qint64 end = IndexToMarker(next_index);
|
||||
@@ -307,7 +307,7 @@ bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Son
|
||||
}
|
||||
|
||||
// Updates the song with data from the .cue entry. This one must be used only for the last song in the .cue file.
|
||||
bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) const {
|
||||
bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) {
|
||||
|
||||
qint64 beginning = IndexToMarker(entry.index);
|
||||
|
||||
@@ -338,7 +338,7 @@ bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) const {
|
||||
|
||||
}
|
||||
|
||||
qint64 CueParser::IndexToMarker(const QString &index) const {
|
||||
qint64 CueParser::IndexToMarker(const QString &index) {
|
||||
|
||||
QRegularExpression index_regexp(kIndexRegExp);
|
||||
QRegularExpressionMatch re_match = index_regexp.match(index);
|
||||
|
||||
@@ -96,11 +96,11 @@ class CueParser : public ParserBase {
|
||||
file(_file), index(_index), title(_title), artist(_artist), album_artist(_album_artist), album(_album), composer(_composer), album_composer(_album_composer), genre(_genre), date(_date), disc(_disc) {}
|
||||
};
|
||||
|
||||
bool UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) const;
|
||||
bool UpdateLastSong(const CueEntry &entry, Song *song) const;
|
||||
static bool UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) ;
|
||||
static bool UpdateLastSong(const CueEntry &entry, Song *song) ;
|
||||
|
||||
QStringList SplitCueLine(const QString &line) const;
|
||||
qint64 IndexToMarker(const QString &index) const;
|
||||
static QStringList SplitCueLine(const QString &line);
|
||||
static qint64 IndexToMarker(const QString &index);
|
||||
};
|
||||
|
||||
#endif // CUEPARSER_H
|
||||
|
||||
@@ -99,7 +99,7 @@ SongList M3UParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
|
||||
}
|
||||
|
||||
bool M3UParser::ParseMetadata(const QString &line, M3UParser::Metadata *metadata) const {
|
||||
bool M3UParser::ParseMetadata(const QString &line, M3UParser::Metadata *metadata) {
|
||||
|
||||
// Extended info, eg.
|
||||
// #EXTINF:123,Sample Artist - Sample title
|
||||
|
||||
@@ -66,7 +66,7 @@ class M3UParser : public ParserBase {
|
||||
qint64 length;
|
||||
};
|
||||
|
||||
bool ParseMetadata(const QString &line, Metadata *metadata) const;
|
||||
static bool ParseMetadata(const QString &line, Metadata *metadata) ;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ Song ParserBase::LoadSong(const QString &filename_or_url, const qint64 beginning
|
||||
|
||||
}
|
||||
|
||||
QString ParserBase::URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) const {
|
||||
QString ParserBase::URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) {
|
||||
|
||||
if (!url.isLocalFile()) return url.toString();
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class ParserBase : public QObject {
|
||||
|
||||
// If the URL is a file:// URL then returns its path, absolute or relative to the directory depending on the path_type option.
|
||||
// Otherwise returns the URL as is. This function should always be used when saving a playlist.
|
||||
QString URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) const;
|
||||
static QString URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) ;
|
||||
|
||||
private:
|
||||
CollectionBackendInterface *collection_;
|
||||
|
||||
@@ -100,7 +100,7 @@ QString PlaylistParser::filters() const {
|
||||
|
||||
}
|
||||
|
||||
QString PlaylistParser::FilterForParser(const ParserBase *parser, QStringList *all_extensions) const {
|
||||
QString PlaylistParser::FilterForParser(const ParserBase *parser, QStringList *all_extensions) {
|
||||
|
||||
const QStringList file_extensions = parser->file_extensions();
|
||||
QStringList extensions;
|
||||
|
||||
@@ -61,7 +61,7 @@ class PlaylistParser : public QObject {
|
||||
void Save(const SongList &songs, const QString &filename, const Playlist::Path) const;
|
||||
|
||||
private:
|
||||
QString FilterForParser(const ParserBase *parser, QStringList *all_extensions = nullptr) const;
|
||||
static QString FilterForParser(const ParserBase *parser, QStringList *all_extensions = nullptr) ;
|
||||
|
||||
private:
|
||||
QList<ParserBase*> parsers_;
|
||||
|
||||
@@ -121,7 +121,7 @@ void WplParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
}
|
||||
}
|
||||
|
||||
void WplParser::WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) const {
|
||||
void WplParser::WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) {
|
||||
|
||||
writer->writeStartElement("meta");
|
||||
writer->writeAttribute("name", name);
|
||||
|
||||
@@ -55,7 +55,7 @@ class WplParser : public XMLParser {
|
||||
|
||||
private:
|
||||
void ParseSeq(const QDir &dir, QXmlStreamReader *reader, SongList *songs, const bool collection_search = true) const;
|
||||
void WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) const;
|
||||
static void WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) ;
|
||||
};
|
||||
|
||||
#endif // WPLPARSER_H
|
||||
|
||||
Reference in New Issue
Block a user