Fix code style and errors

This commit is contained in:
Jonas Kvinge
2019-04-08 18:46:11 +02:00
parent 0ce5b50950
commit 9be161d165
58 changed files with 146 additions and 146 deletions

View File

@@ -116,7 +116,7 @@ void SCollection::Stopped() {
CurrentSongChanged(Song());
}
void SCollection::CurrentSongChanged(const Song &song) {
void SCollection::CurrentSongChanged(const Song &song) { // FIXME
TagReaderReply *reply = nullptr;

View File

@@ -49,9 +49,9 @@
const char *CollectionBackend::kSettingsGroup = "Collection";
CollectionBackend::CollectionBackend(QObject *parent)
: CollectionBackendInterface(parent)
{}
CollectionBackend::CollectionBackend(QObject *parent) :
CollectionBackendInterface(parent),
db_(nullptr) {}
void CollectionBackend::Init(Database *db, const QString &songs_table, const QString &dirs_table, const QString &subdirs_table, const QString &fts_table) {
db_ = db;
@@ -1095,7 +1095,6 @@ void CollectionBackend::IncrementPlayCount(int id) {
void CollectionBackend::IncrementSkipCount(int id, float progress) {
if (id == -1) return;
progress = qBound(0.0f, progress, 1.0f);
QMutexLocker l(db_->Mutex());
QSqlDatabase db(db_->Connect());

View File

@@ -161,13 +161,10 @@ bool CollectionItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *vie
switch (event->type()) {
case QEvent::ToolTip: {
QRect displayed_text;
QSize real_text;
bool is_elided = false;
real_text = sizeHint(option, index);
displayed_text = view->visualRect(index);
is_elided = displayed_text.width() < real_text.width();
QSize real_text = sizeHint(option, index);
QRect displayed_text = view->visualRect(index);
bool is_elided = displayed_text.width() < real_text.width();
if (is_elided) {
QToolTip::showText(he->globalPos(), text, view);
@@ -361,7 +358,7 @@ void CollectionView::SetFilter(CollectionFilterWidget *filter) { filter_ = filte
void CollectionView::TotalSongCountUpdated(int count) {
bool old = total_song_count_;
int old = total_song_count_;
total_song_count_ = count;
if (old != total_song_count_) update();
@@ -376,7 +373,7 @@ void CollectionView::TotalSongCountUpdated(int count) {
void CollectionView::TotalArtistCountUpdated(int count) {
bool old = total_artist_count_;
int old = total_artist_count_;
total_artist_count_ = count;
if (old != total_artist_count_) update();
@@ -391,7 +388,7 @@ void CollectionView::TotalArtistCountUpdated(int count) {
void CollectionView::TotalAlbumCountUpdated(int count) {
bool old = total_album_count_;
int old = total_album_count_;
total_album_count_ = count;
if (old != total_album_count_) update();