From 01337aa5d64a50532fbf4087f76ed386326b8a75 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 12 Jul 2021 21:02:40 +0300 Subject: [PATCH] kioslave: send ERR_NO_CONTENT from MTP slave when appropriate Signed-off-by: Ivailo Monev --- kioslave/mtp/devicecache.cpp | 2 +- kioslave/mtp/kio_mtp.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kioslave/mtp/devicecache.cpp b/kioslave/mtp/devicecache.cpp index d54b681c..817612e8 100644 --- a/kioslave/mtp/devicecache.cpp +++ b/kioslave/mtp/devicecache.cpp @@ -144,7 +144,7 @@ void DeviceCache::checkDevice(Solid::Device solidDevice) if (solidSerial == rawDeviceSerial) { kDebug( KIO_MTP ) << "Found device matching the Solid description"; } else { - LIBMTP_Release_Device( mtpDevice); + LIBMTP_Release_Device(mtpDevice); continue; } diff --git a/kioslave/mtp/kio_mtp.cpp b/kioslave/mtp/kio_mtp.cpp index 3204cc8c..f0e6c192 100644 --- a/kioslave/mtp/kio_mtp.cpp +++ b/kioslave/mtp/kio_mtp.cpp @@ -303,6 +303,8 @@ void MTPSlave::listDir(const KUrl& url) kDebug(KIO_MTP) << "[SUCCESS] :: Storages"; } else { warning(i18n("No Storages found. Maybe you need to unlock your device?")); + error(ERR_NO_CONTENT, url.path()); + kDebug(KIO_MTP) << "[ERROR]"; } // Storage, list files and folders of storage root } else { -- 2.11.0