Removed commented-out code and ran make format.
This commit is contained in:
parent
156728390d
commit
fe4a80b2d5
@ -87,9 +87,11 @@ void LibraryBackend::UpdateSongRatingAsync(int id, float rating) {
|
|||||||
Q_ARG(int, id), Q_ARG(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,
|
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() {
|
void LibraryBackend::LoadDirectories() {
|
||||||
@ -1115,7 +1117,8 @@ void LibraryBackend::UpdateSongRating(int id, float rating) {
|
|||||||
UpdateSongsRating(id_list, 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;
|
if (id_list.isEmpty()) return;
|
||||||
|
|
||||||
QMutexLocker l(db_->Mutex());
|
QMutexLocker l(db_->Mutex());
|
||||||
@ -1127,9 +1130,9 @@ void LibraryBackend::UpdateSongsRating(const QList<int> &id_list, float rating)
|
|||||||
}
|
}
|
||||||
QString ids = id_str_list.join(",");
|
QString ids = id_str_list.join(",");
|
||||||
QSqlQuery q(QString(
|
QSqlQuery q(QString(
|
||||||
"UPDATE %1 SET rating = :rating"
|
"UPDATE %1 SET rating = :rating"
|
||||||
" WHERE ROWID IN (%2)").arg(songs_table_, ids),
|
" WHERE ROWID IN (%2)").arg(songs_table_, ids),
|
||||||
db);
|
db);
|
||||||
q.bindValue(":rating", rating);
|
q.bindValue(":rating", rating);
|
||||||
q.exec();
|
q.exec();
|
||||||
if (db_->CheckErrors(q)) return;
|
if (db_->CheckErrors(q)) return;
|
||||||
|
@ -100,7 +100,8 @@ void MoodbarProxyStyle::NextState() {
|
|||||||
|
|
||||||
// While the regular slider should stay at the standard size (Fixed),
|
// While the regular slider should stay at the standard size (Fixed),
|
||||||
// moodbars should use all available space (MinimumExpanding).
|
// moodbars should use all available space (MinimumExpanding).
|
||||||
slider_->setSizePolicy(QSizePolicy::Expanding,
|
slider_->setSizePolicy(
|
||||||
|
QSizePolicy::Expanding,
|
||||||
visible ? QSizePolicy::MinimumExpanding : QSizePolicy::Fixed);
|
visible ? QSizePolicy::MinimumExpanding : QSizePolicy::Fixed);
|
||||||
slider_->updateGeometry();
|
slider_->updateGeometry();
|
||||||
|
|
||||||
@ -173,7 +174,6 @@ void MoodbarProxyStyle::drawComplexControl(ComplexControl control,
|
|||||||
void MoodbarProxyStyle::Render(ComplexControl control,
|
void MoodbarProxyStyle::Render(ComplexControl control,
|
||||||
const QStyleOptionSlider* option,
|
const QStyleOptionSlider* option,
|
||||||
QPainter* painter, const QWidget* widget) {
|
QPainter* painter, const QWidget* widget) {
|
||||||
|
|
||||||
const qreal fade_value = fade_timeline_->currentValue();
|
const qreal fade_value = fade_timeline_->currentValue();
|
||||||
|
|
||||||
// Have we finished fading?
|
// Have we finished fading?
|
||||||
|
@ -189,7 +189,6 @@ bool Playlist::column_is_editable(Playlist::Column column) {
|
|||||||
|
|
||||||
bool Playlist::set_column_value(Song& song, Playlist::Column column,
|
bool Playlist::set_column_value(Song& song, Playlist::Column column,
|
||||||
const QVariant& value) {
|
const QVariant& value) {
|
||||||
|
|
||||||
if (!song.IsEditable()) return false;
|
if (!song.IsEditable()) return false;
|
||||||
|
|
||||||
switch (column) {
|
switch (column) {
|
||||||
@ -1399,13 +1398,13 @@ void Playlist::ReOrderWithoutUndo(const PlaylistItemList& new_items) {
|
|||||||
layoutAboutToBeChanged();
|
layoutAboutToBeChanged();
|
||||||
|
|
||||||
// This is a slow and nasty way to keep the persistent indices
|
// 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()) {
|
for (const QModelIndex& index : persistentIndexList()) {
|
||||||
old_persistent_mappings[index.row()] = items_[index.row()];
|
old_persistent_mappings[index.row()] = items_[index.row()];
|
||||||
}
|
}
|
||||||
|
|
||||||
items_ = new_items;
|
items_ = new_items;
|
||||||
QMapIterator<int, shared_ptr<PlaylistItem> > it(old_persistent_mappings);
|
QMapIterator<int, shared_ptr<PlaylistItem>> it(old_persistent_mappings);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
for (int col = 0; col < ColumnCount; ++col) {
|
for (int col = 0; col < ColumnCount; ++col) {
|
||||||
@ -1445,7 +1444,7 @@ void Playlist::Save() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
typedef QFutureWatcher<shared_ptr<PlaylistItem> > PlaylistItemFutureWatcher;
|
typedef QFutureWatcher<shared_ptr<PlaylistItem>> PlaylistItemFutureWatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Playlist::Restore() {
|
void Playlist::Restore() {
|
||||||
@ -1816,7 +1815,7 @@ void Playlist::RateSong(const QModelIndex& index, double rating) {
|
|||||||
|
|
||||||
void Playlist::RateSongs(const QModelIndexList& index_list, double rating) {
|
void Playlist::RateSongs(const QModelIndexList& index_list, double rating) {
|
||||||
QList<int> id_list;
|
QList<int> id_list;
|
||||||
for (const QModelIndex &index : index_list) {
|
for (const QModelIndex& index : index_list) {
|
||||||
int row = index.row();
|
int row = index.row();
|
||||||
|
|
||||||
if (has_item_at(row)) {
|
if (has_item_at(row)) {
|
||||||
|
@ -578,7 +578,8 @@ void PlaylistView::keyPressEvent(QKeyEvent* event) {
|
|||||||
event->accept();
|
event->accept();
|
||||||
} else if (event->modifiers() != Qt::ControlModifier // Ctrl+Space selects
|
} else if (event->modifiers() != Qt::ControlModifier // Ctrl+Space selects
|
||||||
// the item
|
// the item
|
||||||
&& event->key() == Qt::Key_Space) {
|
&&
|
||||||
|
event->key() == Qt::Key_Space) {
|
||||||
emit PlayPause();
|
emit PlayPause();
|
||||||
event->accept();
|
event->accept();
|
||||||
} else if (event->key() == Qt::Key_Left) {
|
} else if (event->key() == Qt::Key_Left) {
|
||||||
@ -689,7 +690,6 @@ void PlaylistView::closeEditor(QWidget* editor,
|
|||||||
QTreeView::closeEditor(editor, QAbstractItemDelegate::SubmitModelCache);
|
QTreeView::closeEditor(editor, QAbstractItemDelegate::SubmitModelCache);
|
||||||
} else if (hint == QAbstractItemDelegate::EditNextItem ||
|
} else if (hint == QAbstractItemDelegate::EditNextItem ||
|
||||||
hint == QAbstractItemDelegate::EditPreviousItem) {
|
hint == QAbstractItemDelegate::EditPreviousItem) {
|
||||||
|
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
if (hint == QAbstractItemDelegate::EditNextItem)
|
if (hint == QAbstractItemDelegate::EditNextItem)
|
||||||
index = NextEditableIndex(currentIndex());
|
index = NextEditableIndex(currentIndex());
|
||||||
@ -791,7 +791,6 @@ void PlaylistView::mousePressEvent(QMouseEvent* event) {
|
|||||||
if (index.data(Playlist::Role_CanSetRating).toBool()) {
|
if (index.data(Playlist::Role_CanSetRating).toBool()) {
|
||||||
QModelIndex src_index = playlist_->proxy()->mapToSource(index);
|
QModelIndex src_index = playlist_->proxy()->mapToSource(index);
|
||||||
src_index_list << src_index;
|
src_index_list << src_index;
|
||||||
//playlist_->RateSong(src_index, new_rating);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
playlist_->RateSongs(src_index_list, 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
|
// Check if we should recompute the background image
|
||||||
if (height() != last_height_ || width() != last_width_ ||
|
if (height() != last_height_ || width() != last_width_ ||
|
||||||
force_background_redraw_) {
|
force_background_redraw_) {
|
||||||
|
|
||||||
if (background_image_.isNull()) {
|
if (background_image_.isNull()) {
|
||||||
cached_scaled_background_image_ = QPixmap();
|
cached_scaled_background_image_ = QPixmap();
|
||||||
} else {
|
} else {
|
||||||
|
@ -166,7 +166,6 @@ void OrganiseDialog::InsertTag(const QString& tag) {
|
|||||||
|
|
||||||
Organise::NewSongInfoList OrganiseDialog::ComputeNewSongsFilenames(
|
Organise::NewSongInfoList OrganiseDialog::ComputeNewSongsFilenames(
|
||||||
const SongList& songs, const OrganiseFormat& format) {
|
const SongList& songs, const OrganiseFormat& format) {
|
||||||
|
|
||||||
// Check if we will have multiple files with the same name.
|
// Check if we will have multiple files with the same name.
|
||||||
// If so, they will erase each other if the overwrite flag is set.
|
// If so, they will erase each other if the overwrite flag is set.
|
||||||
// Better to rename them: e.g. foo.bar -> foo(2).bar
|
// Better to rename them: e.g. foo.bar -> foo(2).bar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user