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

@@ -52,11 +52,11 @@
#include "collectionquery.h"
#include "sqlrow.h"
CollectionBackend::CollectionBackend(QObject *parent) :
CollectionBackendInterface(parent),
db_(nullptr),
source_(Song::Source_Unknown),
original_thread_(nullptr) {
CollectionBackend::CollectionBackend(QObject *parent)
: CollectionBackendInterface(parent),
db_(nullptr),
source_(Song::Source_Unknown),
original_thread_(nullptr) {
original_thread_ = thread();

View File

@@ -50,14 +50,14 @@ class CollectionBackendInterface : public QObject {
struct Album {
Album() {}
Album(const QString &_album_artist, const QString &_album, const QUrl &_art_automatic, const QUrl &_art_manual, const QList<QUrl> &_urls, const Song::FileType _filetype, const QString &_cue_path) :
album_artist(_album_artist),
album(_album),
art_automatic(_art_automatic),
art_manual(_art_manual),
urls(_urls),
filetype(_filetype),
cue_path(_cue_path) {}
Album(const QString &_album_artist, const QString &_album, const QUrl &_art_automatic, const QUrl &_art_manual, const QList<QUrl> &_urls, const Song::FileType _filetype, const QString &_cue_path)
: album_artist(_album_artist),
album(_album),
art_automatic(_art_automatic),
art_manual(_art_manual),
urls(_urls),
filetype(_filetype),
cue_path(_cue_path) {}
QString album_artist;
QString album;

View File

@@ -94,13 +94,10 @@ QVariant CollectionDirectoryModel::data(const QModelIndex &idx, int role) const
case MusicStorage::Role_Storage:
case MusicStorage::Role_StorageForceConnect:
return QVariant::fromValue(storage_[idx.row()]);
case MusicStorage::Role_FreeSpace:
return Utilities::FileSystemFreeSpace(data(idx, Qt::DisplayRole).toString());
return Utilities::FileSystemFreeSpace(data(idx, Qt::DisplayRole).toString());
case MusicStorage::Role_Capacity:
return Utilities::FileSystemCapacity(data(idx, Qt::DisplayRole).toString());
return Utilities::FileSystemCapacity(data(idx, Qt::DisplayRole).toString());
default:
return QStandardItemModel::data(idx, role);
}

View File

@@ -76,8 +76,8 @@ const char *CollectionModel::kPixmapDiskCacheDir = "pixmapcache";
QNetworkDiskCache *CollectionModel::sIconCache = nullptr;
CollectionModel::CollectionModel(CollectionBackend *backend, Application *app, QObject *parent) :
SimpleTreeModel<CollectionItem>(new CollectionItem(this), parent),
CollectionModel::CollectionModel(CollectionBackend *backend, Application *app, QObject *parent)
: SimpleTreeModel<CollectionItem>(new CollectionItem(this), parent),
backend_(backend),
app_(app),
dir_model_(new CollectionDirectoryModel(backend, this)),

View File

@@ -270,7 +270,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
QVariant AlbumIcon(const QModelIndex &idx);
QVariant data(const CollectionItem *item, const int role) const;
bool CompareItems(const CollectionItem *a, const CollectionItem *b) const;
static qint64 MaximumCacheSize(QSettings *s, const char *size_id, const char *size_unit_id, const qint64 cache_size_default) ;
static qint64 MaximumCacheSize(QSettings *s, const char *size_id, const char *size_unit_id, const qint64 cache_size_default);
private:
CollectionBackend *backend_;

View File

@@ -63,7 +63,7 @@
// This is defined by one of the windows headers that is included by taglib.
#ifdef RemoveDirectory
#undef RemoveDirectory
# undef RemoveDirectory
#endif
using namespace std::chrono_literals;
@@ -580,7 +580,7 @@ void CollectionWatcher::ScanSubdirectory(const QString &path, const Subdirectory
}
}
else { // Search the DB by fingerprint.
else { // Search the DB by fingerprint.
QString fingerprint;
#ifdef HAVE_SONGFINGERPRINTING
if (song_tracking_) {
@@ -681,7 +681,7 @@ void CollectionWatcher::ScanSubdirectory(const QString &path, const Subdirectory
t->touched_subdirs << updated_subdir;
}
if (updated_subdir.mtime == 0) { // Subdirectory deleted, mark it for removal from the watcher.
if (updated_subdir.mtime == 0) { // Subdirectory deleted, mark it for removal from the watcher.
t->deleted_subdirs << updated_subdir;
}
@@ -1109,7 +1109,7 @@ void CollectionWatcher::RescanTracksNow() {
stop_requested_ = false;
// Currently we are too stupid to rescan one file at a time, so we'll just scan the full directories
QStringList scanned_dirs; // To avoid double scans
QStringList scanned_dirs; // To avoid double scans
while (!song_rescan_queue_.isEmpty()) {
if (stop_requested_) break;
Song song = song_rescan_queue_.takeFirst();

View File

@@ -215,12 +215,12 @@ class CollectionWatcher : public QObject {
int expire_unavailable_songs_days_;
bool stop_requested_;
bool rescan_in_progress_; // True if RescanTracksNow() has been called and is working.
bool rescan_in_progress_; // True if RescanTracksNow() has been called and is working.
QMap<int, Directory> watched_dirs_;
QTimer *rescan_timer_;
QTimer *periodic_scan_timer_;
QMap<int, QStringList> rescan_queue_; // dir id -> list of subdirs to be scanned
QMap<int, QStringList> rescan_queue_; // dir id -> list of subdirs to be scanned
bool rescan_paused_;
int total_watches_;
@@ -229,7 +229,7 @@ class CollectionWatcher : public QObject {
static QStringList sValidImages;
SongList song_rescan_queue_; // Set by ui thread
SongList song_rescan_queue_; // Set by UI thread
qint64 last_scan_time_;

View File

@@ -31,7 +31,7 @@
struct Directory {
Directory() : id(-1) {}
bool operator ==(const Directory &other) const {
bool operator==(const Directory &other) const {
return path == other.path && id == other.id;
}
@@ -56,5 +56,5 @@ Q_DECLARE_METATYPE(Subdirectory)
typedef QList<Subdirectory> SubdirectoryList;
Q_DECLARE_METATYPE(SubdirectoryList)
#endif // DIRECTORY_H
#endif // DIRECTORY_H