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

@@ -222,10 +222,12 @@ void InternetCollectionView::TotalSongCountUpdated(int count) {
total_song_count_ = count;
if (old != total_song_count_) update();
if (total_song_count_ == 0)
if (total_song_count_ == 0) {
setCursor(Qt::PointingHandCursor);
else
}
else {
unsetCursor();
}
emit TotalSongCountUpdated_();
@@ -237,10 +239,12 @@ void InternetCollectionView::TotalArtistCountUpdated(int count) {
total_artist_count_ = count;
if (old != total_artist_count_) update();
if (total_artist_count_ == 0)
if (total_artist_count_ == 0) {
setCursor(Qt::PointingHandCursor);
else
}
else {
unsetCursor();
}
emit TotalArtistCountUpdated_();
@@ -252,10 +256,12 @@ void InternetCollectionView::TotalAlbumCountUpdated(int count) {
total_album_count_ = count;
if (old != total_album_count_) update();
if (total_album_count_ == 0)
if (total_album_count_ == 0) {
setCursor(Qt::PointingHandCursor);
else
}
else {
unsetCursor();
}
emit TotalAlbumCountUpdated_();
@@ -406,10 +412,12 @@ void InternetCollectionView::keyboardSearch(const QString &search) {
void InternetCollectionView::scrollTo(const QModelIndex &idx, ScrollHint hint) {
if (is_in_keyboard_search_)
if (is_in_keyboard_search_) {
QTreeView::scrollTo(idx, QAbstractItemView::PositionAtTop);
else
}
else {
QTreeView::scrollTo(idx, hint);
}
}

View File

@@ -329,7 +329,7 @@ void InternetSearchModel::GetChildResults(const QStandardItem *item, InternetSea
const QModelIndex parent_proxy_index = proxy_->mapFromSource(item->index());
// Yes - visit all the children, but do so through the proxy so we get them in the right order.
for (int i = 0 ; i < item->rowCount() ; ++i) {
for (int i = 0; i < item->rowCount(); ++i) {
const QModelIndex proxy_index = parent_proxy_index.model()->index(i, 0, parent_proxy_index);
const QModelIndex idx = proxy_->mapToSource(proxy_index);
GetChildResults(itemFromIndex(idx), results, visited);
@@ -361,7 +361,7 @@ void GatherResults(const QStandardItem *parent, InternetSearchView::ResultList *
(*results).append(result);
}
for (int i = 0 ; i < parent->rowCount() ; ++i) {
for (int i = 0; i < parent->rowCount(); ++i) {
GatherResults(parent->child(i), results);
}

View File

@@ -509,7 +509,7 @@ void InternetSearchView::SearchDone(const int service_id, const SongList &songs,
}
// Load cached pixmaps into the results
for (InternetSearchView::ResultList::iterator it = results.begin() ; it != results.end() ; ++it) {
for (InternetSearchView::ResultList::iterator it = results.begin(); it != results.end(); ++it) {
it->pixmap_cache_key_ = PixmapCacheKey(*it);
}
@@ -594,7 +594,7 @@ MimeData *InternetSearchView::SelectedMimeData() {
QModelIndexList indexes = ui_->results->selectionModel()->selectedRows();
if (indexes.isEmpty()) {
// There's nothing selected - take the first thing in the model that isn't a divider.
for (int i = 0 ; i < front_proxy_->rowCount() ; ++i) {
for (int i = 0; i < front_proxy_->rowCount(); ++i) {
QModelIndex idx = front_proxy_->index(i, 0);
if (!idx.data(CollectionModel::Role_IsDivider).toBool()) {
indexes << idx; // clazy:exclude=reserve-candidates