From 95330a3d7c0894b3dfaa893ccf663969391ed573 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Mon, 4 Nov 2013 18:44:07 +0100 Subject: [PATCH] Deal more gracefully with a device's library not having any directories on second mount. Fixes issue #3940 --- src/devices/connecteddevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/connecteddevice.cpp b/src/devices/connecteddevice.cpp index 91154fa25..56bb714da 100644 --- a/src/devices/connecteddevice.cpp +++ b/src/devices/connecteddevice.cpp @@ -67,9 +67,9 @@ ConnectedDevice::~ConnectedDevice() { void ConnectedDevice::InitBackendDirectory( const QString& mount_point, bool first_time, bool rewrite_path) { - if (first_time) + if (first_time || backend_->GetAllDirectories().isEmpty()) { backend_->AddDirectory(mount_point); - else { + } else { if (rewrite_path) { // This is a bit of a hack. The device might not be mounted at the same // path each time, so if it's different we have to munge all the paths in