Fix various clazy warnings

This commit is contained in:
Jonas Kvinge
2021-03-21 04:47:11 +01:00
parent 20c1c1d4be
commit 78588d8cdf
92 changed files with 337 additions and 234 deletions

View File

@@ -80,7 +80,8 @@ ConnectedDevice::~ConnectedDevice() {
void ConnectedDevice::InitBackendDirectory(const QString &mount_point, const bool first_time, const bool rewrite_path) {
if (first_time || backend_->GetAllDirectories().isEmpty()) {
QList<Directory> directories = backend_->GetAllDirectories();
if (first_time || directories.isEmpty()) {
backend_->AddDirectory(mount_point);
}
else {
@@ -91,7 +92,7 @@ void ConnectedDevice::InitBackendDirectory(const QString &mount_point, const boo
// 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).
Directory dir = backend_->GetAllDirectories()[0];
Directory dir = directories[0];
if (dir.path != mount_point) {
// The directory is different, commence the munging.
qLog(Info) << "Changing path from" << dir.path << "to" << mount_point;