Improvements to device manager

- Mount and unmount devices in lister thread
- Safely close watcher and backends for devices
- Enable abort loading device
- Fix MTP connection
This commit is contained in:
Jonas Kvinge
2019-09-07 23:30:35 +02:00
parent ad5e04bbcc
commit 8962644ba8
28 changed files with 411 additions and 156 deletions

View File

@@ -68,7 +68,9 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
size_(0),
transcode_mode_(MusicStorage::Transcode_Unsupported),
transcode_format_(Song::FileType_Unknown),
task_percentage_(-1) {}
task_percentage_(-1),
unmount_(false),
forget_(false) {}
DeviceInfo(Type type, DeviceInfo *parent = nullptr)
: SimpleTreeItem<DeviceInfo>(type, parent),
@@ -76,7 +78,9 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
size_(0),
transcode_mode_(MusicStorage::Transcode_Unsupported),
transcode_format_(Song::FileType_Unknown),
task_percentage_(-1) {}
task_percentage_(-1),
unmount_(false),
forget_(false) {}
// A device can be discovered in different ways (udisks2, gio, etc.)
// Sometimes the same device is discovered more than once. In this case the device will have multiple "backends".
@@ -116,6 +120,9 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
int task_percentage_;
bool unmount_;
bool forget_;
};
#endif // DEVICEINFO_H