Formatting

This commit is contained in:
Jonas Kvinge
2021-08-23 21:21:08 +02:00
parent ed7794f396
commit ea2bfbda44
111 changed files with 833 additions and 425 deletions

View File

@@ -192,8 +192,10 @@ QString About::ContributorsHtml() const {
QString About::PersonToHtml(const Person &person) {
if (person.email.isNull())
if (person.email.isEmpty()) {
return person.name;
else
}
else {
return QString("%1 &lt;<a href=\"mailto:%2\">%3</a>&gt;").arg(person.name, person.email, person.email);
}
}

View File

@@ -878,8 +878,9 @@ void EditTagDialog::FieldValueEdited() {
if (ignore_edits_) return;
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
if (sel.isEmpty())
if (sel.isEmpty()) {
return;
}
QWidget *w = qobject_cast<QWidget*>(sender());
@@ -896,8 +897,9 @@ void EditTagDialog::FieldValueEdited() {
void EditTagDialog::ResetField() {
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
if (sel.isEmpty())
if (sel.isEmpty()) {
return;
}
QWidget *w = qobject_cast<QWidget*>(sender());

View File

@@ -77,8 +77,9 @@ void ErrorDialog::UpdateContent() {
QString html;
for (const QString &message : current_messages_) {
if (!html.isEmpty())
if (!html.isEmpty()) {
html += "<hr/>";
}
html += message.toHtmlEscaped();
}
ui_->messages->setHtml(html);

View File

@@ -266,8 +266,9 @@ void TrackSelectionDialog::SaveData(const QList<Data> &data) {
for (int i = 0; i < data.count(); ++i) {
const Data &ref = data[i];
if (ref.pending_ || ref.results_.isEmpty() || ref.selected_result_ == -1)
if (ref.pending_ || ref.results_.isEmpty() || ref.selected_result_ == -1) {
continue;
}
const Song &new_metadata = ref.results_[ref.selected_result_];
@@ -302,8 +303,9 @@ void TrackSelectionDialog::accept() {
QDialog::accept();
for (const Data &tag_data : data_) {
if (tag_data.pending_ || tag_data.results_.isEmpty() || tag_data.selected_result_ == -1)
if (tag_data.pending_ || tag_data.results_.isEmpty() || tag_data.selected_result_ == -1) {
continue;
}
const Song &new_metadata = tag_data.results_[tag_data.selected_result_];