From af1529c396652844e14a07573cab0df1a6c6ef16 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 11 Oct 2022 18:46:13 +0200 Subject: [PATCH] Show note in Dolphin integration when current directory is not shared * Otherwise it can be confusing if no actions are present * See https://github.com/Martchus/syncthingtray/issues/159 --- fileitemactionplugin/syncthingfileitemaction.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fileitemactionplugin/syncthingfileitemaction.cpp b/fileitemactionplugin/syncthingfileitemaction.cpp index 7280362..57984fd 100644 --- a/fileitemactionplugin/syncthingfileitemaction.cpp +++ b/fileitemactionplugin/syncthingfileitemaction.cpp @@ -239,13 +239,19 @@ QList SyncthingFileItemAction::createActions(const KFileItemListPrope actions << *statusActions; } - // add separator - if (!actions.isEmpty()) { - QAction *const separator = new QAction(parent); - separator->setSeparator(true); - actions << separator; + // add note if no actions are available within the current folder + if (actions.isEmpty()) { + auto *const note = new QAction(parent); + note->setText(tr("Not a shared directory")); + note->setEnabled(false); + actions << note; } + // add separator + auto *const separator = new QAction(parent); + separator->setSeparator(true); + actions << separator; + // add error action QAction *const errorAction = new SyncthingInfoAction(parent); errorAction->setText(data.currentError());