From 4834b635377807e07e45bc4b1b9fcbacb05628c5 Mon Sep 17 00:00:00 2001 From: Erik Duisters Date: Wed, 16 Jan 2019 14:55:12 +0100 Subject: [PATCH] Just set UDSEntry::UDS_NAME to the actual directory name instead of the hardcoded string "folder" and don't set UDSEntry::UDS_DISPLAY_NAME at all Summary: There is no reason to set UDSEntry::UDS_NAME to "folder" and then override it with UDSEntry::UDS_DISPLAY_NAME Test Plan: Apply patch, click android device in dolphin's Devices list Verify phones sdcards are listed as befor Reviewers: #kde_connect, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: albertvaka, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D18223 --- kio/kiokdeconnect.cpp | 4 ++-- plugins/sftp/sftpplugin.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp index 0bf62a845..7e9f6c99a 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -162,8 +162,7 @@ void KioKdeconnect::listDevice() const QString icon = QStringLiteral("folder"); KIO::UDSEntry entry; - entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("files")); - entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, name); + entry.insert(KIO::UDSEntry::UDS_NAME, name); entry.insert(KIO::UDSEntry::UDS_ICON_NAME, icon); entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); @@ -178,6 +177,7 @@ void KioKdeconnect::listDevice() entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); entry.insert(KIO::UDSEntry::UDS_SIZE, 0); entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH); + listEntry(entry); infoMessage(QLatin1String("")); diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index 3a071f39b..7ab6e5ea1 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -68,6 +68,7 @@ SftpPlugin::~SftpPlugin() void SftpPlugin::addToDolphin() { removeFromDolphin(); + QUrl kioUrl("kdeconnect://"+deviceId+"/"); d->m_placesModel.addPlace(device()->name(), kioUrl, QStringLiteral("kdeconnect")); qCDebug(KDECONNECT_PLUGIN_SFTP) << "add to dolphin";