Formatting

This commit is contained in:
Jonas Kvinge 2021-06-28 00:19:57 +02:00
parent aa859b9002
commit 9327fd3aa1
3 changed files with 21 additions and 10 deletions

View File

@ -548,8 +548,9 @@ void CollectionModel::SongsDeleted(const SongList &songs) {
if (node->parent != root_) parents << node->parent;
// Maybe consider its divider node
if (node->container_level == 0)
if (node->container_level == 0) {
divider_keys << DividerKey(group_by_[0], node);
}
// Special case the Various Artists node
if (IsCompilationArtistNode(node)) {
@ -1572,7 +1573,9 @@ void CollectionModel::FinishItem(const GroupBy type, const bool signal, const bo
if (type == GroupBy_None) item->lazy_loaded = true;
if (signal) endInsertRows();
if (signal) {
endInsertRows();
}
// Create the divider entry if we're supposed to
if (create_divider && show_dividers_) {
@ -1582,8 +1585,9 @@ void CollectionModel::FinishItem(const GroupBy type, const bool signal, const bo
}
if (!divider_key.isEmpty() && !divider_nodes_.contains(divider_key)) {
if (signal)
if (signal) {
beginInsertRows(ItemToIndex(parent), parent->children.count(), parent->children.count());
}
CollectionItem *divider = new CollectionItem(CollectionItem::Type_Divider, root_);
divider->key = divider_key;
@ -1593,7 +1597,9 @@ void CollectionModel::FinishItem(const GroupBy type, const bool signal, const bo
divider_nodes_[divider_key] = divider;
if (signal) endInsertRows();
if (signal) {
endInsertRows();
}
}
}
@ -1776,8 +1782,9 @@ void CollectionModel::GetChildSongs(CollectionItem *item, QList<QUrl> *urls, Son
QList<CollectionItem*> children = item->children;
std::sort(children.begin(), children.end(), std::bind(&CollectionModel::CompareItems, this, std::placeholders::_1, std::placeholders::_2));
for (CollectionItem *child : children)
for (CollectionItem *child : children) {
GetChildSongs(child, urls, songs, song_ids);
}
break;
}

View File

@ -26,6 +26,11 @@
class Application;
InternetService::InternetService(Song::Source source, const QString &name, const QString &url_scheme, const QString &settings_group, SettingsDialog::Page settings_page, Application *app, QObject *parent)
: QObject(parent), app_(app), source_(source), name_(name), url_scheme_(url_scheme), settings_group_(settings_group), settings_page_(settings_page) {
}
InternetService::InternetService(Song::Source source, const QString &name, const QString &url_scheme, const QString &settings_group, SettingsDialog::Page settings_page, Application *app, QObject *parent) :
QObject(parent),
app_(app),
source_(source),
name_(name),
url_scheme_(url_scheme),
settings_group_(settings_group),
settings_page_(settings_page) {}

View File

@ -34,9 +34,8 @@
PlaylistFilter::PlaylistFilter(QObject *parent)
: QSortFilterProxyModel(parent),
filter_tree_(new NopFilter),
query_hash_(0)
query_hash_(0) {
{
setDynamicSortFilter(true);
column_names_["title"] = Playlist::Column_Title;