1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-02-02 02:26:44 +01:00

Formatting

This commit is contained in:
Jonas Kvinge 2021-02-02 21:08:58 +01:00
parent 59b48ceb4a
commit 03959a68d5
68 changed files with 50 additions and 99 deletions

View File

@ -171,4 +171,3 @@ void BoomAnalyzer::analyze(QPainter& p, const Scope& scope, bool new_frame) {
p.drawPixmap(0, 0, canvas_);
}

View File

@ -1458,4 +1458,3 @@ void CollectionBackend::UpdateSongRatingAsync(const int id, const float rating)
void CollectionBackend::UpdateSongsRatingAsync(const QList<int>& ids, const float rating) {
metaObject()->invokeMethod(this, "UpdateSongsRating", Qt::QueuedConnection, Q_ARG(QList<int>, ids), Q_ARG(float, rating));
}

View File

@ -164,4 +164,3 @@ bool CollectionItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *vie
return false;
}

View File

@ -130,4 +130,3 @@ void GroupByDialog::CollectionGroupingChanged(const CollectionModel::Grouping &g
ui_->combobox_second->setCurrentIndex(p_->mapping_.get<tag_group_by>().find(g[1])->combo_box_index);
ui_->combobox_third->setCurrentIndex(p_->mapping_.get<tag_group_by>().find(g[2])->combo_box_index);
}

View File

@ -209,4 +209,3 @@ void SavedGroupingManager::UpdateButtonState() {
}
}

View File

@ -49,5 +49,4 @@ class SqlRow {
typedef QList<SqlRow> SqlRowList;
#endif
#endif // SQLROW_H

View File

@ -135,4 +135,3 @@ class ContextAlbumsView : public AutoExpandingTreeView {
};
#endif // CONTEXTALBUMSVIEW_H

View File

@ -91,4 +91,3 @@ void Appearance::ChangeBackgroundColor(const QColor &color) {
background_color_ = color;
}

View File

@ -44,4 +44,3 @@ class Appearance : public QObject {
};
#endif // APPEARANCE_H

View File

@ -398,4 +398,3 @@ QDataStream& operator>>(QDataStream &s, CommandlineOptions &a) {
return s;
}

View File

@ -123,4 +123,3 @@ void DeleteFiles::ProcessSomeFiles() {
QTimer::singleShot(0, this, &DeleteFiles::ProcessSomeFiles);
}

View File

@ -44,4 +44,3 @@ class FileSystemWatcherInterface : public QObject {
};
#endif

View File

@ -61,5 +61,4 @@ class MacFSListener : public FileSystemWatcherInterface {
QTimer *update_timer_;
};
#endif
#endif // MACFSLISTENER_H

View File

@ -393,4 +393,3 @@ class MainWindow : public QMainWindow, public PlatformInterface {
};
#endif // MAINWINDOW_H

View File

@ -114,4 +114,3 @@ class MergedProxyModel : public QAbstractProxyModel {
};
#endif // MERGEDPROXYMODEL_H

View File

@ -3,4 +3,4 @@
void RegisterMetaTypes();
#endif
#endif // METATYPES_H

View File

@ -75,4 +75,3 @@ class MimeData : public QMimeData {
};
#endif // MIMEDATA_H

View File

@ -243,4 +243,4 @@ class Mpris2 : public QObject {
} // namespace mpris
#endif
#endif // MPRIS2_H

View File

@ -61,4 +61,4 @@ inline QString AsMPRISDateTimeType(const int time) {
} // namespace mpris
#endif // MPRIS_COMMON_H
#endif // MPRIS_COMMON_H

View File

@ -106,4 +106,3 @@ int MultiSortFilterProxy::Compare(const QVariant &left, const QVariant &right) c
return 0;
}

View File

@ -142,4 +142,3 @@ QList<QNetworkProxy> NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &q
return QList<QNetworkProxy>() << ret;
}

View File

@ -46,4 +46,3 @@ void ScopedTransaction::Commit() {
db_->commit();
pending_ = false;
}

View File

@ -53,4 +53,3 @@ void DefaultSettingsProvider::setArrayIndex(int i) {
}
void DefaultSettingsProvider::endArray() { backend_.endArray(); }

View File

@ -50,4 +50,3 @@ gulong CheckedGConnect(gpointer source, const char *signal, GCallback callback,
return g_signal_connect(source, signal, G_CALLBACK(callback), data);
}

View File

@ -176,4 +176,3 @@ QImage TagReaderClient::LoadEmbeddedArtBlocking(const QString &filename) {
return ret;
}

View File

@ -140,4 +140,3 @@ int TaskManager::GetTaskProgress(int id) {
}
}

View File

@ -29,7 +29,7 @@ class QObject;
// Improve QThread by adding a SetIoPriority function
class Thread : public QThread {
public:
explicit Thread(QObject* parent = nullptr) : QThread(parent), io_priority_(Utilities::IOPRIO_CLASS_NONE) {}
explicit Thread(QObject *parent = nullptr) : QThread(parent), io_priority_(Utilities::IOPRIO_CLASS_NONE) {}
void SetIoPriority(Utilities::IoPriority priority) {
io_priority_ = priority;

View File

@ -100,4 +100,3 @@ void AlbumCoverExport::ForceSizeToggled(int state) {
ui_->width->setEnabled(state == Qt::Checked);
ui_->height->setEnabled(state == Qt::Checked);
}

View File

@ -154,4 +154,3 @@ void AlbumCoverFetcher::SingleCoverFetched(const quint64 request_id, const QUrl
emit AlbumCoverFetched(request_id, cover_url, image, search->statistics());
}

View File

@ -144,4 +144,3 @@ class AlbumCoverLoader : public QObject {
};
#endif // ALBUMCOVERLOADER_H

View File

@ -53,7 +53,7 @@ class AlbumCoverManagerList : public QListWidget {
void dropEvent(QDropEvent *event) override;
private:
AlbumCoverManager* manager_;
AlbumCoverManager *manager_;
};
#endif // ALBUMCOVERMANAGERLIST_H

View File

@ -285,4 +285,3 @@ void AlbumCoverSearcher::keyPressEvent(QKeyEvent *e) {
void AlbumCoverSearcher::CoverDoubleClicked(const QModelIndex &idx) {
if (idx.isValid()) accept();
}

View File

@ -199,4 +199,3 @@ void CoverExportRunnable::ExportCover() {
void CoverExportRunnable::EmitCoverExported() { emit CoverExported(); }
void CoverExportRunnable::EmitCoverSkipped() { emit CoverSkipped(); }

View File

@ -101,4 +101,3 @@ void CoverFromURLDialog::LoadCoverFromURLFinished() {
}
}

View File

@ -64,4 +64,3 @@ QString CoverSearchStatistics::AverageDimensions() const {
return QString::number(chosen_width_ / chosen_images_) + "x" + QString::number(chosen_height_ / chosen_images_);
}

View File

@ -447,11 +447,11 @@ SongList OrganizeDialog::LoadSongsBlocking(const QStringList &filenames) {
}
void OrganizeDialog::SetCopy(const bool copy) {
ui_->aftercopying->setCurrentIndex(copy ? 0 : 1);
ui_->aftercopying->setCurrentIndex(copy ? 0 : 1);
}
void OrganizeDialog::SetPlaylist(const QString &playlist) {
playlist_ = playlist;
playlist_ = playlist;
}
void OrganizeDialog::InsertTag(const QString &tag) {

View File

@ -477,4 +477,3 @@ void PlaylistBackend::SetPlaylistUiPath(int id, const QString &path) {
transaction.Commit();
}

View File

@ -177,4 +177,3 @@ void PlaylistHeader::ResetColumns() {
void PlaylistHeader::ToggleRatingEditStatus() {
emit SectionRatingLockStatusChanged(action_rating_lock_->isChecked());
}

View File

@ -154,4 +154,3 @@ bool PlaylistItem::HasCurrentForegroundColor() const {
}
void PlaylistItem::SetShouldSkip(bool val) { should_skip_ = val; }
bool PlaylistItem::GetShouldSkip() const { return should_skip_; }

View File

@ -641,4 +641,3 @@ void PlaylistManager::RateCurrentSong(const double rating) {
void PlaylistManager::RateCurrentSong(const int rating) {
RateCurrentSong(rating / 5.0);
}

View File

@ -59,4 +59,3 @@ void PlaylistSaveOptionsDialog::accept() {
Playlist::Path PlaylistSaveOptionsDialog::path_type() const {
return static_cast<Playlist::Path>(ui->filePaths->itemData(ui->filePaths->currentIndex()).toInt());
}

View File

@ -39,8 +39,7 @@ SongLoaderInserter::SongLoaderInserter(TaskManager *task_manager, CollectionBack
enqueue_(false),
enqueue_next_(false),
collection_(collection),
player_(player) {
}
player_(player) {}
SongLoaderInserter::~SongLoaderInserter() { qDeleteAll(pending_); }
@ -214,4 +213,3 @@ void SongLoaderInserter::AsyncLoad() {
deleteLater();
}

View File

@ -1343,4 +1343,3 @@ void QobuzRequest::Warn(const QString &error, const QVariant &debug) {
if (debug.isValid()) qLog(Debug) << debug;
}

View File

@ -246,4 +246,3 @@ void QobuzStreamURLRequest::Error(const QString &error, const QVariant &debug) {
if (debug.isValid()) qLog(Debug) << debug;
}

View File

@ -192,4 +192,3 @@ void QueueView::PlaylistDestroyed() {
current_playlist_ = nullptr;
// We'll get another CurrentPlaylistChanged() soon
}

View File

@ -109,6 +109,7 @@ void MoodbarSettingsPage::InitMoodbarPreviews() {
return;
}
QByteArray file_data = file.readAll();
file.close();
// Render and set each preview
for (int i = 0; i < MoodbarRenderer::StyleCount; ++i) {

View File

@ -35,7 +35,7 @@ class SettingsDialog;
const char *PlaylistSettingsPage::kSettingsGroup = "Playlist";
PlaylistSettingsPage::PlaylistSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_PlaylistSettingsPage) {
PlaylistSettingsPage::PlaylistSettingsPage(SettingsDialog *dialog) : SettingsPage(dialog), ui_(new Ui_PlaylistSettingsPage) {
ui_->setupUi(this);
setWindowIcon(IconLoader::Load("document-new"));
@ -101,8 +101,6 @@ void PlaylistSettingsPage::Load() {
void PlaylistSettingsPage::Save() {
QSettings s;
Playlist::Path path = Playlist::Path_Automatic;
if (ui_->radiobutton_automaticpath->isChecked()) {
path = Playlist::Path_Automatic;
@ -117,6 +115,7 @@ void PlaylistSettingsPage::Save() {
path = Playlist::Path_Ask_User;
}
QSettings s;
s.beginGroup(kSettingsGroup);
s.setValue("glow_effect", ui_->checkbox_glowcurrenttrack->isChecked());
s.setValue("warn_close_playlist", ui_->checkbox_warncloseplaylist->isChecked());

View File

@ -277,5 +277,3 @@ void ScrobblerSettingsPage::ListenBrainz_AuthenticationComplete(const bool succe
void ScrobblerSettingsPage::ListenBrainz_RefreshControls(bool authenticated) {
ui_->widget_listenbrainz_login_state->SetLoggedIn(authenticated ? LoginStateWidget::LoggedIn : LoginStateWidget::LoggedOut);
}

View File

@ -370,4 +370,3 @@ void SettingsDialog::CurrentItemChanged(QTreeWidgetItem *item) {
}
}

View File

@ -146,4 +146,3 @@ void SettingsPage::ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combo
combobox->setCurrentIndex(i);
}

View File

@ -71,4 +71,3 @@ UrlHandler::LoadResult SubsonicUrlHandler::StartLoading(const QUrl &url) {
return LoadResult(url, LoadResult::TrackAvailable, stream_url);
}

View File

@ -458,4 +458,3 @@ QString TranscodeDialog::GetOutputFileName(const QString &input, const Transcode
}
}

View File

@ -33,7 +33,7 @@
// TODO: Add more options than only bitrate as soon as gst doesn't crash anymore while using the cbr parmameter (like cbr=false)
const char* TranscoderOptionsOpus::kSettingsGroup = "Transcoder/opusenc";
const char *TranscoderOptionsOpus::kSettingsGroup = "Transcoder/opusenc";
TranscoderOptionsOpus::TranscoderOptionsOpus(QWidget *parent) : TranscoderOptionsInterface(parent), ui_(new Ui_TranscoderOptionsOpus) {
ui_->setupUi(this);

View File

@ -38,9 +38,9 @@ class TranscoderOptionsOpus : public TranscoderOptionsInterface {
void Save() override;
private:
static const char* kSettingsGroup;
static const char *kSettingsGroup;
Ui_TranscoderOptionsOpus* ui_;
Ui_TranscoderOptionsOpus *ui_;
};
#endif // TRANSCODEROPTIONSOPUS_H

View File

@ -192,4 +192,3 @@ void AutoExpandingTreeView::DownAndFocus() {
setCurrentIndex(moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier));
setFocus();
}

View File

@ -84,4 +84,3 @@ void BusyIndicator::set_text(const QString &text) {
QString BusyIndicator::text() const {
return label_->text();
}

View File

@ -43,7 +43,7 @@ class MultiLoadingIndicator : public QWidget {
static const int kHorizontalPadding;
static const int kSpacing;
void SetTaskManager(TaskManager* task_manager);
void SetTaskManager(TaskManager *task_manager);
QSize sizeHint() const override;

View File

@ -52,4 +52,3 @@ void RenameTabLineEdit::focusOutEvent(QFocusEvent *e) {
//we don't call the default event since it will trigger editingFished()
}

View File

@ -35,7 +35,7 @@ class RenameTabLineEdit : public QLineEdit {
Q_OBJECT
public:
explicit RenameTabLineEdit(QWidget* parent = nullptr);
explicit RenameTabLineEdit(QWidget *parent = nullptr);
signals:
void EditingCanceled();
@ -43,8 +43,8 @@ class RenameTabLineEdit : public QLineEdit {
public slots:
protected:
void focusOutEvent(QFocusEvent* e) override;
void keyPressEvent(QKeyEvent* e) override;
void focusOutEvent(QFocusEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
};
#endif // RENAMETABLINEEDIT_H

View File

@ -36,7 +36,7 @@ class StickySlider : public QSlider {
Q_PROPERTY(int sticky_threshold READ sticky_threshold WRITE set_sticky_threshold)
public:
explicit StickySlider(QWidget* parent = nullptr);
explicit StickySlider(QWidget *parent = nullptr);
int sticky_center() const { return sticky_center_; }
int sticky_threshold() const { return sticky_threshold_; }
@ -44,7 +44,7 @@ class StickySlider : public QSlider {
void set_sticky_threshold(int threshold) { sticky_threshold_ = threshold; }
protected:
void mouseMoveEvent(QMouseEvent* e) override;
void mouseMoveEvent(QMouseEvent *e) override;
private:
int sticky_center_;

View File

@ -168,9 +168,9 @@ void StretchHeaderView::SetSectionHidden(const int logical, const bool hidden) {
}
void StretchHeaderView::resizeEvent(QResizeEvent *event) {
void StretchHeaderView::resizeEvent(QResizeEvent *e) {
QHeaderView::resizeEvent(event);
QHeaderView::resizeEvent(e);
if (!stretch_enabled_) return;

View File

@ -82,7 +82,7 @@ class StretchHeaderView : public QHeaderView {
protected:
// QWidget
void mouseMoveEvent(QMouseEvent *e) override;
void resizeEvent(QResizeEvent *event) override;
void resizeEvent(QResizeEvent *e) override;
private:
// Scales column_widths_ values so the total is 1.0.

View File

@ -41,7 +41,7 @@ class TrackSlider : public QWidget {
Q_OBJECT
public:
explicit TrackSlider(QWidget* parent = nullptr);
explicit TrackSlider(QWidget *parent = nullptr);
~TrackSlider() override;
void SetApplication(Application* app);

View File

@ -45,7 +45,7 @@ const int TrackSliderPopup::kPointWidth = 4;
const int TrackSliderPopup::kBorderRadius = 4;
const qreal TrackSliderPopup::kBlurRadius = 20.0;
TrackSliderPopup::TrackSliderPopup(QWidget* parent)
TrackSliderPopup::TrackSliderPopup(QWidget *parent)
: QWidget(parent),
font_metrics_(fontMetrics()),
small_font_metrics_(fontMetrics()) {
@ -61,17 +61,17 @@ TrackSliderPopup::TrackSliderPopup(QWidget* parent)
}
void TrackSliderPopup::SetText(const QString& text) {
void TrackSliderPopup::SetText(const QString &text) {
text_ = text;
UpdatePixmap();
}
void TrackSliderPopup::SetSmallText(const QString& text) {
void TrackSliderPopup::SetSmallText(const QString &text) {
small_text_ = text;
UpdatePixmap();
}
void TrackSliderPopup::SetPopupPosition(const QPoint& pos) {
void TrackSliderPopup::SetPopupPosition(const QPoint &pos) {
pos_ = pos;
UpdatePosition();
}

View File

@ -38,13 +38,13 @@ class QPaintEvent;
class TrackSliderPopup : public QWidget {
Q_OBJECT
public:
public:
explicit TrackSliderPopup(QWidget *parent);
public slots:
void SetText(const QString& text);
void SetSmallText(const QString& small_text);
void SetPopupPosition(const QPoint& pos);
void SetText(const QString &text);
void SetSmallText(const QString &small_text);
void SetPopupPosition(const QPoint &pos);
protected:
void paintEvent(QPaintEvent*) override;
@ -58,7 +58,7 @@ public:
void UpdatePixmap();
void UpdatePosition();
void SendMouseEventToParent(QMouseEvent* e);
void SendMouseEventToParent(QMouseEvent *e);
private:
QString text_;

View File

@ -62,7 +62,7 @@ class TrackSliderSlider : public QSlider {
void enterEvent(QEvent *e) override;
#endif
void leaveEvent(QEvent *e) override;
void keyPressEvent(QKeyEvent* event) override;
void keyPressEvent(QKeyEvent *event) override;
private slots:
void UpdateDeltaTime();

View File

@ -56,7 +56,7 @@ SliderSlider::SliderSlider(Qt::Orientation orientation, QWidget* parent, uint ma
setRange(0, max);
}
void SliderSlider::wheelEvent(QWheelEvent* e) {
void SliderSlider::wheelEvent(QWheelEvent *e) {
if (orientation() == Qt::Vertical) {
// Will be handled by the parent widget
@ -95,7 +95,7 @@ void SliderSlider::mouseMoveEvent(QMouseEvent *e) {
}
void SliderSlider::slideEvent(QMouseEvent* e) {
void SliderSlider::slideEvent(QMouseEvent *e) {
QStyleOptionSlider option;
initStyleOption(&option);
@ -118,7 +118,7 @@ void SliderSlider::slideEvent(QMouseEvent* e) {
}
void SliderSlider::mousePressEvent(QMouseEvent* e) {
void SliderSlider::mousePressEvent(QMouseEvent *e) {
QStyleOptionSlider option;
initStyleOption(&option);
@ -157,20 +157,20 @@ void SliderSlider::setValue(int newValue) {
#define THICKNESS 7
#define MARGIN 3
PrettySlider::PrettySlider(Qt::Orientation orientation, SliderMode mode, QWidget* parent, uint max)
PrettySlider::PrettySlider(Qt::Orientation orientation, SliderMode mode, QWidget *parent, uint max)
: SliderSlider(orientation, parent, max), m_mode(mode) {
if (m_mode == Pretty) {
setFocusPolicy(Qt::NoFocus);
}
}
void PrettySlider::mousePressEvent(QMouseEvent* e) {
void PrettySlider::mousePressEvent(QMouseEvent *e) {
SliderSlider::mousePressEvent(e);
slideEvent(e);
}
void PrettySlider::slideEvent(QMouseEvent* e) {
void PrettySlider::slideEvent(QMouseEvent *e) {
if (m_mode == Pretty)
QSlider::setValue(
orientation() == Qt::Horizontal
@ -207,7 +207,7 @@ QSize PrettySlider::sizeHint() const {
/// CLASS VolumeSlider
//////////////////////////////////////////////////////////////////////////////////////////
VolumeSlider::VolumeSlider(QWidget* parent, uint max)
VolumeSlider::VolumeSlider(QWidget *parent, uint max)
: SliderSlider(Qt::Horizontal, parent, max),
m_animCount(0),
m_animTimer(new QTimer(this)),
@ -268,7 +268,7 @@ void VolumeSlider::slotAnimTimer() {
}
void VolumeSlider::mousePressEvent(QMouseEvent* e) {
void VolumeSlider::mousePressEvent(QMouseEvent *e) {
if (e->button() != Qt::RightButton) {
SliderSlider::mousePressEvent(e);
@ -277,7 +277,7 @@ void VolumeSlider::mousePressEvent(QMouseEvent* e) {
}
void VolumeSlider::contextMenuEvent(QContextMenuEvent* e) {
void VolumeSlider::contextMenuEvent(QContextMenuEvent *e) {
QMap<QAction*, int> values;
QMenu menu;
@ -289,7 +289,7 @@ void VolumeSlider::contextMenuEvent(QContextMenuEvent* e) {
values[menu.addAction("20%")] = 20;
values[menu.addAction("0%")] = 0;
QAction* ret = menu.exec(mapToGlobal(e->pos()));
QAction *ret = menu.exec(mapToGlobal(e->pos()));
if (ret) {
QSlider::setValue(values[ret]);
emit sliderReleased(values[ret]);
@ -297,11 +297,11 @@ void VolumeSlider::contextMenuEvent(QContextMenuEvent* e) {
}
void VolumeSlider::slideEvent(QMouseEvent* e) {
void VolumeSlider::slideEvent(QMouseEvent *e) {
QSlider::setValue(QStyle::sliderValueFromPosition(minimum(), maximum(), e->pos().x(), width() - 2));
}
void VolumeSlider::wheelEvent(QWheelEvent* e) {
void VolumeSlider::wheelEvent(QWheelEvent *e) {
const uint step = e->angleDelta().y() / (e->angleDelta().x() == 0 ? 30 : -30);
QSlider::setValue(QSlider::value() + step);

View File

@ -130,7 +130,7 @@ class VolumeSlider : public SliderSlider {
void drawVolumeSliderHandle();
VolumeSlider(const VolumeSlider&); // undefined
VolumeSlider& operator=(const VolumeSlider&); // undefined
VolumeSlider &operator=(const VolumeSlider&); // undefined
////////////////////////////////////////////////////////////////
static const int ANIM_INTERVAL = 18;
@ -138,7 +138,7 @@ class VolumeSlider : public SliderSlider {
bool m_animEnter;
int m_animCount;
QTimer* m_animTimer;
QTimer *m_animTimer;
QPixmap m_pixmapInset;
QPixmap m_pixmapGradient;