Formatting

This commit is contained in:
Jonas Kvinge
2022-03-22 21:09:05 +01:00
parent 8cb4e75f70
commit f6b70fda71
106 changed files with 446 additions and 479 deletions

View File

@@ -156,7 +156,7 @@ void CddaSongLoader::LoadSongs() {
GstMessage *msg_tag = nullptr;
while ((msg = gst_bus_timed_pop_filtered(GST_ELEMENT_BUS(pipeline), GST_SECOND, static_cast<GstMessageType>(GST_MESSAGE_TOC | GST_MESSAGE_TAG)))) {
if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_TOC) {
if (msg_toc) gst_message_unref(msg_toc); // Shouldn't happen, but just in case
if (msg_toc) gst_message_unref(msg_toc); // Shouldn't happen, but just in case
msg_toc = msg;
}
else if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_TAG) {

View File

@@ -141,7 +141,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
private:
void AddLister(DeviceLister *lister);
template <typename T> void AddDeviceClass();
template<typename T> void AddDeviceClass();
DeviceDatabaseBackend::Device InfoToDatabaseDevice(const DeviceInfo &info) const;
@@ -173,7 +173,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
};
template <typename T>
template<typename T>
void DeviceManager::AddDeviceClass() {
QStringList schemes = T::url_schemes();
QMetaObject obj = T::staticMetaObject;

View File

@@ -40,10 +40,10 @@
class DeviceLister;
FilesystemDevice::FilesystemDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, const int database_id, const bool first_time, QObject *parent)
: FilesystemMusicStorage(url.toLocalFile()),
ConnectedDevice(url, lister, unique_id, manager, app, database_id, first_time, parent),
watcher_(new CollectionWatcher(Song::Source_Device)),
watcher_thread_(new QThread(this)) {
: FilesystemMusicStorage(url.toLocalFile()),
ConnectedDevice(url, lister, unique_id, manager, app, database_id, first_time, parent),
watcher_(new CollectionWatcher(Song::Source_Device)),
watcher_thread_(new QThread(this)) {
watcher_->moveToThread(watcher_thread_);
watcher_thread_->start(QThread::IdlePriority);

View File

@@ -70,10 +70,9 @@ bool GioLister::DeviceInfo::is_suitable() const {
if (filesystem_type.isEmpty()) return true;
return filesystem_type != "udf" && filesystem_type != "smb" && filesystem_type != "cifs" && filesystem_type != "ssh" && filesystem_type != "isofs";
}
template <typename T, typename F>
template<typename T, typename F>
void OperationFinished(F f, GObject *object, GAsyncResult *result) {
T *obj = reinterpret_cast<T*>(object);

View File

@@ -137,7 +137,7 @@ class GioLister : public DeviceLister {
QString FindUniqueIdByMount(GMount *mount) const;
QString FindUniqueIdByVolume(GVolume *volume) const;
template <typename T>
template<typename T>
T LockAndGetDeviceInfo(const QString &id, T DeviceInfo::*field);
private:
@@ -148,7 +148,7 @@ class GioLister : public DeviceLister {
QMap<QString, DeviceInfo> devices_;
};
template <typename T>
template<typename T>
T GioLister::LockAndGetDeviceInfo(const QString &id, T DeviceInfo::*field) {
QMutexLocker l(&mutex_);
if (!devices_.contains(id)) return T();

View File

@@ -84,12 +84,12 @@ class MacOsDeviceLister : public DeviceLister {
private:
bool Init();
static void DiskAddedCallback(DADiskRef disk, void* context);
static void DiskRemovedCallback(DADiskRef disk, void* context);
static void DiskAddedCallback(DADiskRef disk, void *context);
static void DiskRemovedCallback(DADiskRef disk, void *context);
static void USBDeviceAddedCallback(void *refcon, io_iterator_t it);
static void USBDeviceRemovedCallback(void *refcon, io_iterator_t it);
static void DiskUnmountCallback(DADiskRef disk, DADissenterRef dissenter, void* context);
static void DiskUnmountCallback(DADiskRef disk, DADissenterRef dissenter, void *context);
void FoundMTPDevice(const MTPDevice &device, const QString &serial);
void RemovedMTPDevice(const QString &serial);