SocketAPI: Fix string claiming a folder is a file
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 4 Jun 2019 10:50:30 +0000 (12:50 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:51 +0000 (10:58 +0100)
Issue #7206

src/gui/socketapi.cpp

index 88dc7af8b48f19b4e3f9e24c709a2f4f119e93ca..6f3b534e907efe8d3e55e9a6cfe0871dbacfefb2 100644 (file)
@@ -876,7 +876,8 @@ void SocketApi::sendSharingContextMenuOptions(const FileData &fileData, SocketLi
     // If sharing is globally disabled, do not show any sharing entries.
     // If there is no permission to share for this file, add a disabled entry saying so
     if (isOnTheServer && !record._remotePerm.isNull() && !record._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
-        listener->sendMessage(QLatin1String("MENU_ITEM:DISABLED:d:") + tr("Resharing this file is not allowed"));
+        listener->sendMessage(QLatin1String("MENU_ITEM:DISABLED:d:") + (!record.isDirectory()
+            ? tr("Resharing this file is not allowed") : tr("Resharing this folder is not allowed")));
     } else {
         listener->sendMessage(QLatin1String("MENU_ITEM:SHARE") + flagString + tr("Share options"));