summaryrefslogtreecommitdiff
path: root/kde-apps/kio-extras/files/kio-extras-21.04.3-libmtp-0.1.19.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kde-apps/kio-extras/files/kio-extras-21.04.3-libmtp-0.1.19.patch')
-rw-r--r--kde-apps/kio-extras/files/kio-extras-21.04.3-libmtp-0.1.19.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/kde-apps/kio-extras/files/kio-extras-21.04.3-libmtp-0.1.19.patch b/kde-apps/kio-extras/files/kio-extras-21.04.3-libmtp-0.1.19.patch
new file mode 100644
index 000000000000..400fdd859652
--- /dev/null
+++ b/kde-apps/kio-extras/files/kio-extras-21.04.3-libmtp-0.1.19.patch
@@ -0,0 +1,26 @@
+From a6ecc8855a0a2a8f76234f77422940b863960944 Mon Sep 17 00:00:00 2001
+From: Antonio Rojas <arojas@archlinux.org>
+Date: Sat, 2 Oct 2021 12:53:27 +0200
+Subject: [PATCH] Fix kio-mtp with libmtp 1.1.19
+
+In libmtp 1.1.19, an empty string is returned instead of NULL for devices without a deviceName, which breaks accessing those devices with kio-mtp
+---
+ mtp/kiod_module/mtpdevice.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mtp/kiod_module/mtpdevice.cpp b/mtp/kiod_module/mtpdevice.cpp
+index 8fe4abb2..f32cd1a4 100644
+--- a/mtp/kiod_module/mtpdevice.cpp
++++ b/mtp/kiod_module/mtpdevice.cpp
+@@ -40,7 +40,7 @@ MTPDevice::MTPDevice(const QString &dbusObjectPath, LIBMTP_mtpdevice_t *device,
+ const char *deviceModel = LIBMTP_Get_Modelname(device);
+
+ // prefer friendly devicename over model
+- if (!deviceName) {
++ if (!deviceName || strlen(deviceName) == 0) {
+ m_friendlyName = QString::fromUtf8(deviceModel);
+ } else {
+ m_friendlyName = QString::fromUtf8(deviceName);
+--
+GitLab
+