From fe4a80b2d5e9df7a4f0f63a4e4c1800bb721ca42 Mon Sep 17 00:00:00 2001 From: Joseph Freeman Date: Fri, 25 Apr 2014 19:41:04 -0400 Subject: [PATCH] Removed commented-out code and ran make format. --- src/library/librarybackend.cpp | 15 +++++++++------ src/moodbar/moodbarproxystyle.cpp | 4 ++-- src/playlist/playlist.cpp | 9 ++++----- src/playlist/playlistview.cpp | 6 ++---- src/ui/organisedialog.cpp | 1 - 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/library/librarybackend.cpp b/src/library/librarybackend.cpp index 1b54d955f..c452dc1e4 100644 --- a/src/library/librarybackend.cpp +++ b/src/library/librarybackend.cpp @@ -87,9 +87,11 @@ void LibraryBackend::UpdateSongRatingAsync(int id, float rating) { Q_ARG(int, id), Q_ARG(float, rating)); } -void LibraryBackend::UpdateSongsRatingAsync(const QList& ids, float rating) { +void LibraryBackend::UpdateSongsRatingAsync(const QList& ids, + float rating) { metaObject()->invokeMethod(this, "UpdateSongsRating", Qt::QueuedConnection, - Q_ARG(const QList&, ids), Q_ARG(float, rating)); + Q_ARG(const QList&, ids), + Q_ARG(float, rating)); } void LibraryBackend::LoadDirectories() { @@ -1115,7 +1117,8 @@ void LibraryBackend::UpdateSongRating(int id, float rating) { UpdateSongsRating(id_list, rating); } -void LibraryBackend::UpdateSongsRating(const QList &id_list, float rating) { +void LibraryBackend::UpdateSongsRating(const QList& id_list, + float rating) { if (id_list.isEmpty()) return; QMutexLocker l(db_->Mutex()); @@ -1127,9 +1130,9 @@ void LibraryBackend::UpdateSongsRating(const QList &id_list, float rating) } QString ids = id_str_list.join(","); QSqlQuery q(QString( - "UPDATE %1 SET rating = :rating" - " WHERE ROWID IN (%2)").arg(songs_table_, ids), - db); + "UPDATE %1 SET rating = :rating" + " WHERE ROWID IN (%2)").arg(songs_table_, ids), + db); q.bindValue(":rating", rating); q.exec(); if (db_->CheckErrors(q)) return; diff --git a/src/moodbar/moodbarproxystyle.cpp b/src/moodbar/moodbarproxystyle.cpp index 79fe27237..8308d9cc0 100644 --- a/src/moodbar/moodbarproxystyle.cpp +++ b/src/moodbar/moodbarproxystyle.cpp @@ -100,7 +100,8 @@ void MoodbarProxyStyle::NextState() { // While the regular slider should stay at the standard size (Fixed), // moodbars should use all available space (MinimumExpanding). - slider_->setSizePolicy(QSizePolicy::Expanding, + slider_->setSizePolicy( + QSizePolicy::Expanding, visible ? QSizePolicy::MinimumExpanding : QSizePolicy::Fixed); slider_->updateGeometry(); @@ -173,7 +174,6 @@ void MoodbarProxyStyle::drawComplexControl(ComplexControl control, void MoodbarProxyStyle::Render(ComplexControl control, const QStyleOptionSlider* option, QPainter* painter, const QWidget* widget) { - const qreal fade_value = fade_timeline_->currentValue(); // Have we finished fading? diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index b31b102dd..f062f654c 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -189,7 +189,6 @@ bool Playlist::column_is_editable(Playlist::Column column) { bool Playlist::set_column_value(Song& song, Playlist::Column column, const QVariant& value) { - if (!song.IsEditable()) return false; switch (column) { @@ -1399,13 +1398,13 @@ void Playlist::ReOrderWithoutUndo(const PlaylistItemList& new_items) { layoutAboutToBeChanged(); // This is a slow and nasty way to keep the persistent indices - QMap > old_persistent_mappings; + QMap> old_persistent_mappings; for (const QModelIndex& index : persistentIndexList()) { old_persistent_mappings[index.row()] = items_[index.row()]; } items_ = new_items; - QMapIterator > it(old_persistent_mappings); + QMapIterator> it(old_persistent_mappings); while (it.hasNext()) { it.next(); for (int col = 0; col < ColumnCount; ++col) { @@ -1445,7 +1444,7 @@ void Playlist::Save() const { } namespace { -typedef QFutureWatcher > PlaylistItemFutureWatcher; +typedef QFutureWatcher> PlaylistItemFutureWatcher; } void Playlist::Restore() { @@ -1816,7 +1815,7 @@ void Playlist::RateSong(const QModelIndex& index, double rating) { void Playlist::RateSongs(const QModelIndexList& index_list, double rating) { QList id_list; - for (const QModelIndex &index : index_list) { + for (const QModelIndex& index : index_list) { int row = index.row(); if (has_item_at(row)) { diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 1fa30b1fb..099842ad7 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -578,7 +578,8 @@ void PlaylistView::keyPressEvent(QKeyEvent* event) { event->accept(); } else if (event->modifiers() != Qt::ControlModifier // Ctrl+Space selects // the item - && event->key() == Qt::Key_Space) { + && + event->key() == Qt::Key_Space) { emit PlayPause(); event->accept(); } else if (event->key() == Qt::Key_Left) { @@ -689,7 +690,6 @@ void PlaylistView::closeEditor(QWidget* editor, QTreeView::closeEditor(editor, QAbstractItemDelegate::SubmitModelCache); } else if (hint == QAbstractItemDelegate::EditNextItem || hint == QAbstractItemDelegate::EditPreviousItem) { - QModelIndex index; if (hint == QAbstractItemDelegate::EditNextItem) index = NextEditableIndex(currentIndex()); @@ -791,7 +791,6 @@ void PlaylistView::mousePressEvent(QMouseEvent* event) { if (index.data(Playlist::Role_CanSetRating).toBool()) { QModelIndex src_index = playlist_->proxy()->mapToSource(index); src_index_list << src_index; - //playlist_->RateSong(src_index, new_rating); } } playlist_->RateSongs(src_index_list, new_rating); @@ -892,7 +891,6 @@ void PlaylistView::paintEvent(QPaintEvent* event) { // Check if we should recompute the background image if (height() != last_height_ || width() != last_width_ || force_background_redraw_) { - if (background_image_.isNull()) { cached_scaled_background_image_ = QPixmap(); } else { diff --git a/src/ui/organisedialog.cpp b/src/ui/organisedialog.cpp index 2c241f4b8..f75c199a4 100644 --- a/src/ui/organisedialog.cpp +++ b/src/ui/organisedialog.cpp @@ -166,7 +166,6 @@ void OrganiseDialog::InsertTag(const QString& tag) { Organise::NewSongInfoList OrganiseDialog::ComputeNewSongsFilenames( const SongList& songs, const OrganiseFormat& format) { - // Check if we will have multiple files with the same name. // If so, they will erase each other if the overwrite flag is set. // Better to rename them: e.g. foo.bar -> foo(2).bar