Code cleanup.

This commit is contained in:
Jonas Kvinge
2018-03-10 13:02:56 +01:00
parent 07a95b56ff
commit 16cabf33a2
25 changed files with 179 additions and 590 deletions

View File

@@ -45,7 +45,7 @@ ConnectedDevice::ConnectedDevice(const QUrl &url, DeviceLister *lister, const QS
model_(nullptr),
song_count_(0) {
qLog(Info) << "connected" << url << unique_id << first_time;
qLog(Info) << "Connected" << url << unique_id << first_time;
// Create the backend in the database thread.
backend_ = new CollectionBackend();
@@ -61,6 +61,7 @@ ConnectedDevice::ConnectedDevice(const QUrl &url, DeviceLister *lister, const QS
// Create the model
model_ = new CollectionModel(backend_, app_, this);
}
ConnectedDevice::~ConnectedDevice() { backend_->deleteLater(); }
@@ -77,8 +78,7 @@ void ConnectedDevice::InitBackendDirectory(const QString &mount_point, bool firs
// the database to fix it. This can be done entirely in sqlite so it's
// relatively fast...
// Get the directory it was mounted at last time. Devices only have one
// directory (the root).
// Get the directory it was mounted at last time. Devices only have one directory (the root).
Directory dir = backend_->GetAllDirectories()[0];
if (dir.path != mount_point) {
// The directory is different, commence the munging.
@@ -90,6 +90,7 @@ void ConnectedDevice::InitBackendDirectory(const QString &mount_point, bool firs
// Load the directory properly now
backend_->LoadDirectoriesAsync();
}
}
void ConnectedDevice::Eject() {