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
This commit is contained in:
parent
d7adcaf950
commit
af1529c396
|
@ -239,13 +239,19 @@ QList<QAction *> 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());
|
||||
|
|
Loading…
Reference in New Issue