1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 20:34:39 +01:00

Removed commented-out code and ran make format.

This commit is contained in:
Joseph Freeman 2014-04-25 19:41:04 -04:00
parent 156728390d
commit fe4a80b2d5
5 changed files with 17 additions and 18 deletions

View File

@ -87,9 +87,11 @@ void LibraryBackend::UpdateSongRatingAsync(int id, float rating) {
Q_ARG(int, id), Q_ARG(float, rating));
}
void LibraryBackend::UpdateSongsRatingAsync(const QList<int>& ids, float rating) {
void LibraryBackend::UpdateSongsRatingAsync(const QList<int>& ids,
float rating) {
metaObject()->invokeMethod(this, "UpdateSongsRating", Qt::QueuedConnection,
Q_ARG(const QList<int>&, ids), Q_ARG(float, rating));
Q_ARG(const QList<int>&, 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<int> &id_list, float rating) {
void LibraryBackend::UpdateSongsRating(const QList<int>& id_list,
float rating) {
if (id_list.isEmpty()) return;
QMutexLocker l(db_->Mutex());
@ -1127,9 +1130,9 @@ void LibraryBackend::UpdateSongsRating(const QList<int> &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;

View File

@ -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?

View File

@ -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<int, shared_ptr<PlaylistItem> > old_persistent_mappings;
QMap<int, shared_ptr<PlaylistItem>> old_persistent_mappings;
for (const QModelIndex& index : persistentIndexList()) {
old_persistent_mappings[index.row()] = items_[index.row()];
}
items_ = new_items;
QMapIterator<int, shared_ptr<PlaylistItem> > it(old_persistent_mappings);
QMapIterator<int, shared_ptr<PlaylistItem>> 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<shared_ptr<PlaylistItem> > PlaylistItemFutureWatcher;
typedef QFutureWatcher<shared_ptr<PlaylistItem>> 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<int> id_list;
for (const QModelIndex &index : index_list) {
for (const QModelIndex& index : index_list) {
int row = index.row();
if (has_item_at(row)) {

View File

@ -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 {

View File

@ -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