Formatting

This commit is contained in:
Jonas Kvinge
2021-07-11 09:49:38 +02:00
parent a6742d401c
commit e48b7d83a3
161 changed files with 370 additions and 369 deletions

View File

@@ -611,7 +611,7 @@ int Playlist::next_row(const bool ignore_repeat_track) const {
int Playlist::previous_row(const bool ignore_repeat_track) const {
int prev_virtual_index = PreviousVirtualIndex(current_virtual_index_,ignore_repeat_track);
int prev_virtual_index = PreviousVirtualIndex(current_virtual_index_, ignore_repeat_track);
if (prev_virtual_index < 0) {
// We've gone off the beginning of the playlist.
@@ -624,7 +624,7 @@ int Playlist::previous_row(const bool ignore_repeat_track) const {
break;
default:
prev_virtual_index = PreviousVirtualIndex(virtual_items_.count(),ignore_repeat_track);
prev_virtual_index = PreviousVirtualIndex(virtual_items_.count(), ignore_repeat_track);
break;
}
}
@@ -1736,7 +1736,7 @@ void Playlist::ClearStreamMetadata() {
current_item()->ClearTemporaryMetadata();
UpdateScrobblePoint();
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount-1));
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
}

View File

@@ -68,7 +68,7 @@ class ReOrderItems;
class RemoveItems;
class ShuffleItems;
class SortItems;
}
} // namespace PlaylistUndoCommands
typedef QMap<int, Qt::Alignment> ColumnAlignmentMap;
Q_DECLARE_METATYPE(Qt::Alignment)

View File

@@ -92,7 +92,7 @@ class PlaylistBackend : public QObject {
void Exit();
void SavePlaylist(int playlist, const PlaylistItemList &items, int last_played, PlaylistGeneratorPtr dynamic);
signals:
signals:
void ExitFinished();
private:

View File

@@ -363,7 +363,7 @@ void PlaylistContainer::GoToNextPlaylistTab() {
void PlaylistContainer::GoToPreviousPlaylistTab() {
// Get the next tab' id
int id_previous = ui_->tab_bar->id_of((ui_->tab_bar->currentIndex()+ui_->tab_bar->count()-1) % ui_->tab_bar->count());
int id_previous = ui_->tab_bar->id_of((ui_->tab_bar->currentIndex() + ui_->tab_bar->count() - 1) % ui_->tab_bar->count());
// Switch to next tab
manager_->SetCurrentPlaylist(id_previous);

View File

@@ -178,7 +178,7 @@ QString PlaylistDelegateBase::displayText(const QVariant &value, const QLocale&)
QString text;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch(value.metaType().id()) {
switch (value.metaType().id()) {
#else
switch (static_cast<QMetaType::Type>(value.type())) {
#endif
@@ -536,7 +536,7 @@ QString RatingItemDelegate::displayText(const QVariant &value, const QLocale&) c
if (value.isNull() || value.toDouble() <= 0) return QString();
// Round to the nearest 0.5
const double rating = double(int(value.toDouble() * RatingPainter::kStarCount * 2 + 0.5)) / 2;
const double rating = double(int(value.toDouble() * RatingPainter::kStarCount * 2 + 0.5)) / 2;
return QString::number(rating, 'f', 1);

View File

@@ -55,13 +55,13 @@ class CollectionBackend;
class Player;
class QueuedItemDelegate : public QStyledItemDelegate {
Q_OBJECT
Q_OBJECT
public:
explicit QueuedItemDelegate(QObject *parent, int indicator_column = Playlist::Column_Title);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
static void DrawBox(QPainter *painter, const QRect line_rect, const QFont &font, const QString &text, int width = -1, const float opacity = 1.0) ;
static void DrawBox(QPainter *painter, const QRect line_rect, const QFont &font, const QString &text, int width = -1, const float opacity = 1.0);
int queue_indicator_size(const QModelIndex &idx) const;
@@ -124,7 +124,7 @@ class DateItemDelegate : public PlaylistDelegateBase {
};
class LastPlayedItemDelegate : public PlaylistDelegateBase {
Q_OBJECT
Q_OBJECT
public:
explicit LastPlayedItemDelegate(QObject *parent) : PlaylistDelegateBase(parent) {}

View File

@@ -305,8 +305,8 @@ FilterTree *FilterParser::parseAndGroup() {
break;
}
checkAnd(); // if there's no 'AND', we'll add the term anyway...
}
while (iter_ != end_);
} while (iter_ != end_);
return group;
}

View File

@@ -72,7 +72,7 @@ class NopFilter : public FilterTree {
// col ::= "title" | "artist" | ...
class FilterParser {
public:
explicit FilterParser(const QString &filter, const QMap<QString, int> &columns, const QSet<int> &numerical_cols);
explicit FilterParser(const QString &filter, const QMap<QString, int> &columns, const QSet<int> &numerical_cols);
FilterTree *parse();
@@ -88,7 +88,7 @@ class FilterParser {
FilterTree *parseSearchTerm();
FilterTree *createSearchTermTreeNode(const QString &col, const QString &prefix, const QString &search) const;
static int parseTime(const QString &time_str) ;
static int parseTime(const QString &time_str);
QString::const_iterator iter_;
QString::const_iterator end_;

View File

@@ -135,7 +135,7 @@ void PlaylistHeader::AddColumnAction(int index) {
action->setChecked(!isSectionHidden(index));
show_actions_ << action;
QObject::connect(action, &QAction::triggered, [this, index]() { ToggleVisible(index); } );
QObject::connect(action, &QAction::triggered, [this, index]() { ToggleVisible(index); });
}

View File

@@ -35,9 +35,9 @@
PlaylistListModel::PlaylistListModel(QObject *parent) : QStandardItemModel(parent), dropping_rows_(false) {
QObject::connect(this,&PlaylistListModel::dataChanged, this, &PlaylistListModel::RowsChanged);
QObject::connect(this,&PlaylistListModel::rowsAboutToBeRemoved, this, &PlaylistListModel::RowsAboutToBeRemoved);
QObject::connect(this,&PlaylistListModel::rowsInserted, this, &PlaylistListModel::RowsInserted);
QObject::connect(this, &PlaylistListModel::dataChanged, this, &PlaylistListModel::RowsChanged);
QObject::connect(this, &PlaylistListModel::rowsAboutToBeRemoved, this, &PlaylistListModel::RowsAboutToBeRemoved);
QObject::connect(this, &PlaylistListModel::rowsInserted, this, &PlaylistListModel::RowsInserted);
}

View File

@@ -60,7 +60,7 @@ class PlaylistListModel : public QStandardItemModel {
// Walks from the given item to the root, returning the / separated path of
// all the parent folders. The path includes this item if it is a folder.
static QString ItemPath(const QStandardItem *item) ;
static QString ItemPath(const QStandardItem *item);
// Finds the playlist with the given ID, returns 0 if it doesn't exist.
QStandardItem *PlaylistById(const int id) const;

View File

@@ -166,7 +166,7 @@ void PlaylistSequence::SetRepeatMode(const RepeatMode mode) {
ui_->repeat->setChecked(mode != Repeat_Off);
switch(mode) {
switch (mode) {
case Repeat_Off: ui_->action_repeat_off->setChecked(true); break;
case Repeat_Track: ui_->action_repeat_track->setChecked(true); break;
case Repeat_Album: ui_->action_repeat_album->setChecked(true); break;

View File

@@ -668,7 +668,7 @@ void PlaylistView::keyPressEvent(QKeyEvent *event) {
emit SeekForward();
event->accept();
}
else if (event->modifiers() == Qt::NoModifier && ((event->key() >= Qt::Key_Exclam && event->key() <= Qt::Key_Z) || event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Escape)) {
else if (event->modifiers() == Qt::NoModifier && ((event->key() >= Qt::Key_Exclam && event->key() <= Qt::Key_Z) || event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Escape)) {
emit FocusOnFilterSignal(event);
event->accept();
}
@@ -974,11 +974,11 @@ void PlaylistView::paintEvent(QPaintEvent *event) {
else {
if (background_image_stretch_) {
if (background_image_keep_aspect_ratio_) {
if (background_image_do_not_cut_){
if (background_image_do_not_cut_) {
cached_scaled_background_image_ = QPixmap::fromImage(background_image_.scaled(pb_width, pb_height, Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
else {
if (pb_height >= pb_width){
if (pb_height >= pb_width) {
cached_scaled_background_image_ = QPixmap::fromImage(background_image_.scaledToHeight(pb_height, Qt::SmoothTransformation));
}
else {