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

@@ -58,6 +58,7 @@ SCollection::SCollection(Application *app, QObject *parent)
backend_ = new CollectionBackend();
backend()->moveToThread(app->database()->thread());
qLog(Debug) << backend_ << "moved to thread" << app->database()->thread();
backend_->Init(app->database(), Song::Source_Collection, kSongsTable, kDirsTable, kSubdirsTable, kFtsTable);
@@ -89,6 +90,7 @@ void SCollection::Init() {
watcher_->moveToThread(watcher_thread_);
watcher_thread_->start(QThread::IdlePriority);
qLog(Debug) << watcher_ << "moved to thread" << watcher_thread_;
watcher_->set_backend(backend_);
watcher_->set_task_manager(app_->task_manager());