OSDN Git Service

kioslave: send ERR_NO_CONTENT from MTP slave when appropriate
authorIvailo Monev <xakepa10@gmail.com>
Mon, 12 Jul 2021 18:02:40 +0000 (21:02 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 12 Jul 2021 18:02:40 +0000 (21:02 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kioslave/mtp/devicecache.cpp
kioslave/mtp/kio_mtp.cpp

index d54b681..817612e 100644 (file)
@@ -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;
                     }
 
index 3204cc8..f0e6c19 100644 (file)
@@ -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 {