chore: tidy code and hello 2025 :)
This commit is contained in:
		| @ -678,7 +678,7 @@ void MainWindow::on_actionHelp_triggered() | |||||||
|         "\n" |         "\n" | ||||||
|         "[Source Code](https://github.com/BLumia/pineapple-music)\n" |         "[Source Code](https://github.com/BLumia/pineapple-music)\n" | ||||||
|         "\n" |         "\n" | ||||||
|         "Copyright © 2024 [BLumia](https://github.com/BLumia/)" |         "Copyright © 2025 [BLumia](https://github.com/BLumia/)" | ||||||
|         ); |         ); | ||||||
|     infoBox.setTextFormat(Qt::MarkdownText); |     infoBox.setTextFormat(Qt::MarkdownText); | ||||||
|     infoBox.exec(); |     infoBox.exec(); | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| // SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net> | // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net> | ||||||
| // | // | ||||||
| // SPDX-License-Identifier: MIT | // SPDX-License-Identifier: MIT | ||||||
|  |  | ||||||
| @ -16,9 +16,7 @@ PlaylistModel::PlaylistModel(QObject *parent) | |||||||
| } | } | ||||||
|  |  | ||||||
| PlaylistModel::~PlaylistModel() | PlaylistModel::~PlaylistModel() | ||||||
| { | = default; | ||||||
|  |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void PlaylistModel::setPlaylist(const QList<QUrl> &urls) | void PlaylistModel::setPlaylist(const QList<QUrl> &urls) | ||||||
| { | { | ||||||
| @ -29,7 +27,7 @@ void PlaylistModel::setPlaylist(const QList<QUrl> &urls) | |||||||
|  |  | ||||||
| QModelIndex PlaylistModel::loadPlaylist(const QList<QUrl> & urls) | QModelIndex PlaylistModel::loadPlaylist(const QList<QUrl> & urls) | ||||||
| { | { | ||||||
|     if (urls.isEmpty()) return QModelIndex(); |     if (urls.isEmpty()) return {}; | ||||||
|     if (urls.count() == 1) { |     if (urls.count() == 1) { | ||||||
|         return loadPlaylist(urls.constFirst()); |         return loadPlaylist(urls.constFirst()); | ||||||
|     } else { |     } else { | ||||||
| @ -128,7 +126,7 @@ int PlaylistModel::rowCount(const QModelIndex &parent) const | |||||||
|  |  | ||||||
| QVariant PlaylistModel::data(const QModelIndex &index, int role) const | QVariant PlaylistModel::data(const QModelIndex &index, int role) const | ||||||
| { | { | ||||||
|     if (!index.isValid()) return QVariant(); |     if (!index.isValid()) return {}; | ||||||
|  |  | ||||||
|     switch (role) { |     switch (role) { | ||||||
|     case Qt::DisplayRole: |     case Qt::DisplayRole: | ||||||
| @ -137,7 +135,7 @@ QVariant PlaylistModel::data(const QModelIndex &index, int role) const | |||||||
|         return m_playlist.at(index.row()); |         return m_playlist.at(index.row()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     return QVariant(); |     return {}; | ||||||
| } | } | ||||||
|  |  | ||||||
| PlaylistManager::PlaylistManager(QObject *parent) | PlaylistManager::PlaylistManager(QObject *parent) | ||||||
| @ -196,7 +194,7 @@ int PlaylistManager::totalCount() const | |||||||
| QModelIndex PlaylistManager::previousIndex() const | QModelIndex PlaylistManager::previousIndex() const | ||||||
| { | { | ||||||
|     int count = totalCount(); |     int count = totalCount(); | ||||||
|     if (count == 0) return QModelIndex(); |     if (count == 0) return {}; | ||||||
|  |  | ||||||
|     return m_model.index(m_currentIndex - 1 < 0 ? count - 1 : m_currentIndex - 1); |     return m_model.index(m_currentIndex - 1 < 0 ? count - 1 : m_currentIndex - 1); | ||||||
| } | } | ||||||
| @ -204,7 +202,7 @@ QModelIndex PlaylistManager::previousIndex() const | |||||||
| QModelIndex PlaylistManager::nextIndex() const | QModelIndex PlaylistManager::nextIndex() const | ||||||
| { | { | ||||||
|     int count = totalCount(); |     int count = totalCount(); | ||||||
|     if (count == 0) return QModelIndex(); |     if (count == 0) return {}; | ||||||
|  |  | ||||||
|     return m_model.index(m_currentIndex + 1 == count ? 0 : m_currentIndex + 1); |     return m_model.index(m_currentIndex + 1 == count ? 0 : m_currentIndex + 1); | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| // SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net> | // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net> | ||||||
| // | // | ||||||
| // SPDX-License-Identifier: MIT | // SPDX-License-Identifier: MIT | ||||||
|  |  | ||||||
| @ -18,7 +18,7 @@ public: | |||||||
|     Q_PROPERTY(QStringList autoLoadFilterSuffixes MEMBER m_autoLoadSuffixes NOTIFY autoLoadFilterSuffixesChanged) |     Q_PROPERTY(QStringList autoLoadFilterSuffixes MEMBER m_autoLoadSuffixes NOTIFY autoLoadFilterSuffixesChanged) | ||||||
|  |  | ||||||
|     explicit PlaylistModel(QObject *parent = nullptr); |     explicit PlaylistModel(QObject *parent = nullptr); | ||||||
|     ~PlaylistModel(); |     ~PlaylistModel() override; | ||||||
|  |  | ||||||
|     void setPlaylist(const QList<QUrl> & urls); |     void setPlaylist(const QList<QUrl> & urls); | ||||||
|     QModelIndex loadPlaylist(const QList<QUrl> & urls); |     QModelIndex loadPlaylist(const QList<QUrl> & urls); | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| // SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net> | // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net> | ||||||
| // | // | ||||||
| // SPDX-License-Identifier: MIT | // SPDX-License-Identifier: MIT | ||||||
|  |  | ||||||
| @ -12,7 +12,7 @@ class SeekableSlider : public QSlider | |||||||
|     Q_OBJECT |     Q_OBJECT | ||||||
| public: | public: | ||||||
|     explicit SeekableSlider(QWidget *parent = nullptr); |     explicit SeekableSlider(QWidget *parent = nullptr); | ||||||
|     ~SeekableSlider() = default; |     ~SeekableSlider() override = default; | ||||||
|  |  | ||||||
| signals: | signals: | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user