Use more uniform coding style in `setTagInfo()`

This commit is contained in:
Martchus 2022-01-01 20:45:06 +01:00
parent 28691378ce
commit ef637cb361
1 changed files with 7 additions and 7 deletions

View File

@ -484,7 +484,7 @@ void setTagInfo(const SetTagInfoArgs &args)
exit(-1); exit(-1);
} }
TagCreationSettings settings; auto settings = TagCreationSettings();
settings.flags = TagCreationFlags::None; settings.flags = TagCreationFlags::None;
// determine targets to remove // determine targets to remove
@ -555,11 +555,11 @@ void setTagInfo(const SetTagInfoArgs &args)
// iterate through all specified files // iterate through all specified files
const auto quiet = args.quietArg.isPresent(); const auto quiet = args.quietArg.isPresent();
unsigned int fileIndex = 0; auto fileIndex = 0u;
static string context("setting tags"); static auto context = std::string("setting tags");
for (const char *file : args.filesArg.values()) { for (const char *file : args.filesArg.values()) {
Diagnostics diag; auto diag = Diagnostics();
AbortableProgressFeedback parsingProgress; // FIXME: actually use the progress object auto parsingProgress = AbortableProgressFeedback(); // FIXME: actually use the progress object
try { try {
// parse tags and tracks (tracks are relevant because track meta-data such as language can be changed as well) // parse tags and tracks (tracks are relevant because track meta-data such as language can be changed as well)
if (!quiet) { if (!quiet) {
@ -772,7 +772,7 @@ void setTagInfo(const SetTagInfoArgs &args)
} }
// alter tracks // alter tracks
for (AbstractTrack *track : fileInfo.tracks()) { for (AbstractTrack *const track : fileInfo.tracks()) {
for (const auto &fieldDenotation : fields) { for (const auto &fieldDenotation : fields) {
// skip empty values // skip empty values
const auto &values = fieldDenotation.second.relevantValues; const auto &values = fieldDenotation.second.relevantValues;
@ -837,7 +837,7 @@ void setTagInfo(const SetTagInfoArgs &args)
} }
} }
// add/update/remove attachments // add/update/remove attachments
AttachmentInfo currentInfo; auto currentInfo = AttachmentInfo();
currentInfo.action = AttachmentAction::Add; currentInfo.action = AttachmentAction::Add;
for (size_t i = 0, occurrences = args.addAttachmentArg.occurrences(); i != occurrences; ++i) { for (size_t i = 0, occurrences = args.addAttachmentArg.occurrences(); i != occurrences; ++i) {
for (const char *value : args.addAttachmentArg.values(i)) { for (const char *value : args.addAttachmentArg.values(i)) {