tag/TagBuilder: rename Commit() to CommitNew()
This commit is contained in:
parent
33c5fc95b4
commit
ac1983eae3
@ -108,7 +108,7 @@ mpd_despotify_tag_from_track(struct ds_track *track)
|
||||
tag.AddItem(TAG_COMMENT, comment);
|
||||
tag.SetTime(track->length / 1000);
|
||||
|
||||
return tag.Commit();
|
||||
return tag.CommitNew();
|
||||
}
|
||||
|
||||
struct despotify_session *mpd_despotify_get_session(void)
|
||||
|
@ -109,7 +109,7 @@ icy_parse_tag(const char *p)
|
||||
|
||||
g_strfreev(items);
|
||||
|
||||
return tag.Commit();
|
||||
return tag.CommitNew();
|
||||
}
|
||||
|
||||
size_t
|
||||
|
@ -56,7 +56,7 @@ playlist::AddSongIdTag(unsigned id, TagType tag_type, const char *value,
|
||||
}
|
||||
|
||||
tag.AddItem(tag_type, value);
|
||||
song.tag = tag.Commit();
|
||||
song.tag = tag.CommitNew();
|
||||
|
||||
queue.ModifyAtPosition(position);
|
||||
OnModified();
|
||||
@ -91,7 +91,7 @@ playlist::ClearSongIdTag(unsigned id, TagType tag_type,
|
||||
tag.RemoveAll();
|
||||
else
|
||||
tag.RemoveType(tag_type);
|
||||
song.tag = tag.Commit();
|
||||
song.tag = tag.CommitNew();
|
||||
|
||||
queue.ModifyAtPosition(position);
|
||||
OnModified();
|
||||
|
@ -104,7 +104,7 @@ song_load(TextFile &file, Directory *parent, const char *uri,
|
||||
}
|
||||
|
||||
if (tag.IsDefined())
|
||||
song->tag = tag.Commit();
|
||||
song->tag = tag.CommitNew();
|
||||
|
||||
return song;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ Song::UpdateFile()
|
||||
mtime = st.st_mtime;
|
||||
|
||||
delete tag;
|
||||
tag = tag_builder.Commit();
|
||||
tag = tag_builder.CommitNew();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ Song::UpdateFileInArchive()
|
||||
return false;
|
||||
|
||||
delete tag;
|
||||
tag = tag_builder.Commit();
|
||||
tag = tag_builder.CommitNew();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -143,6 +143,6 @@ Song::UpdateStream()
|
||||
return false;
|
||||
|
||||
delete tag;
|
||||
tag = tag_builder.Commit();
|
||||
tag = tag_builder.CommitNew();
|
||||
return true;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ update_container_file(Directory &directory,
|
||||
add_tag_handler, &tag_builder);
|
||||
|
||||
if (tag_builder.IsDefined())
|
||||
song->tag = tag_builder.Commit();
|
||||
song->tag = tag_builder.CommitNew();
|
||||
else
|
||||
tag_builder.Clear();
|
||||
|
||||
|
@ -170,7 +170,7 @@ CueParser::Commit()
|
||||
return;
|
||||
|
||||
assert(current->tag == nullptr);
|
||||
current->tag = song_tag.Commit();
|
||||
current->tag = song_tag.CommitNew();
|
||||
|
||||
finished = previous;
|
||||
previous = current;
|
||||
|
@ -406,7 +406,7 @@ Convert(const struct mpd_song *song)
|
||||
for (const auto *i = &tag_table[0]; i->d != TAG_NUM_OF_ITEM_TYPES; ++i)
|
||||
Copy(tag, i->d, song, i->s);
|
||||
|
||||
s->tag = tag.Commit();
|
||||
s->tag = tag.CommitNew();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
@ -137,5 +137,5 @@ vorbis_comments_to_tag(char **comments)
|
||||
vorbis_comments_scan(comments, &add_tag_handler, &tag_builder);
|
||||
return tag_builder.IsEmpty()
|
||||
? nullptr
|
||||
: tag_builder.Commit();
|
||||
: tag_builder.CommitNew();
|
||||
}
|
||||
|
@ -915,7 +915,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
TagBuilder tag_builder;
|
||||
tag_builder.AddItem(TAG_NAME, c->meta_name.c_str());
|
||||
|
||||
c->tag = tag_builder.Commit();
|
||||
c->tag = tag_builder.CommitNew();
|
||||
} else if (StringEqualsCaseASCII(name, "icy-metaint")) {
|
||||
char buffer[64];
|
||||
size_t icy_metaint;
|
||||
|
@ -144,7 +144,7 @@ asx_end_element(gcc_unused GMarkupParseContext *context,
|
||||
if (StringEqualsCaseASCII(element_name, "entry")) {
|
||||
if (strcmp(parser->song->uri, "asx:") != 0) {
|
||||
assert(parser->song->tag == nullptr);
|
||||
parser->song->tag = parser->tag_builder.Commit();
|
||||
parser->song->tag = parser->tag_builder.CommitNew();
|
||||
parser->songs.emplace_front(parser->song);
|
||||
} else
|
||||
parser->song->Free();
|
||||
|
@ -98,7 +98,7 @@ extm3u_parse_tag(const char *line)
|
||||
if (*name != 0)
|
||||
tag.AddItem(TAG_NAME, name);
|
||||
|
||||
return tag.Commit();
|
||||
return tag.CommitNew();
|
||||
}
|
||||
|
||||
Song *
|
||||
|
@ -100,7 +100,7 @@ pls_parser(GKeyFile *keyfile, std::forward_list<SongPointer> &songs)
|
||||
if(error) g_error_free(error);
|
||||
error = nullptr;
|
||||
|
||||
song->tag = tag.Commit();
|
||||
song->tag = tag.CommitNew();
|
||||
songs.emplace_front(song);
|
||||
num_entries--;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ rss_end_element(gcc_unused GMarkupParseContext *context,
|
||||
if (StringEqualsCaseASCII(element_name, "item")) {
|
||||
if (strcmp(parser->song->uri, "rss:") != 0) {
|
||||
assert(parser->song->tag == nullptr);
|
||||
parser->song->tag = parser->tag_builder.Commit();
|
||||
parser->song->tag = parser->tag_builder.CommitNew();
|
||||
parser->songs.emplace_front(parser->song);
|
||||
} else
|
||||
parser->song->Free();
|
||||
|
@ -221,7 +221,7 @@ handle_end_map(void *ctx)
|
||||
tag.SetTime(data->duration / 1000);
|
||||
if (data->title != nullptr)
|
||||
tag.AddItem(TAG_NAME, data->title);
|
||||
s->tag = tag.Commit();
|
||||
s->tag = tag.CommitNew();
|
||||
|
||||
data->songs.emplace_front(s);
|
||||
|
||||
|
@ -151,7 +151,7 @@ xspf_end_element(gcc_unused GMarkupParseContext *context,
|
||||
if (strcmp(element_name, "track") == 0) {
|
||||
if (parser->song != nullptr) {
|
||||
assert(parser->song->tag == nullptr);
|
||||
parser->song->tag = parser->tag_builder.Commit();
|
||||
parser->song->tag = parser->tag_builder.CommitNew();
|
||||
parser->songs.emplace_front(parser->song);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ Tag::Merge(const Tag &base, const Tag &add)
|
||||
{
|
||||
TagBuilder builder(add);
|
||||
builder.Complement(base);
|
||||
return builder.Commit();
|
||||
return builder.CommitNew();
|
||||
}
|
||||
|
||||
Tag *
|
||||
|
@ -134,7 +134,7 @@ TagBuilder::Commit(Tag &tag)
|
||||
}
|
||||
|
||||
Tag *
|
||||
TagBuilder::Commit()
|
||||
TagBuilder::CommitNew()
|
||||
{
|
||||
Tag *tag = new Tag();
|
||||
Commit(*tag);
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
* returned object is owned by the caller. This object is
|
||||
* empty afterwards.
|
||||
*/
|
||||
Tag *Commit();
|
||||
Tag *CommitNew();
|
||||
|
||||
void SetTime(int _time) {
|
||||
time = _time;
|
||||
|
@ -370,7 +370,7 @@ tag_id3_import(struct id3_tag *tag)
|
||||
scan_id3_tag(tag, &add_tag_handler, &tag_builder);
|
||||
return tag_builder.IsEmpty()
|
||||
? nullptr
|
||||
: tag_builder.Commit();
|
||||
: tag_builder.CommitNew();
|
||||
}
|
||||
|
||||
static size_t
|
||||
|
Loading…
Reference in New Issue
Block a user