Show Syncthing version in Dolphin integration
So even if there are no actions there's at least some bit of information showing to verify the integration could connect to Syncthing.
This commit is contained in:
parent
af1529c396
commit
a79a594238
|
@ -262,6 +262,19 @@ QList<QAction *> SyncthingFileItemAction::createActions(const KFileItemListPrope
|
|||
connect(&data, &SyncthingFileItemActionStaticData::currentErrorChanged, errorAction, &QAction::changed);
|
||||
actions << errorAction;
|
||||
|
||||
// show Syncthing version
|
||||
if (!connection.syncthingVersion().isEmpty()) {
|
||||
static const auto versionRegex = QRegularExpression("(syncthing.*v.* \".*\").*");
|
||||
auto *const versionAction = new QAction(parent);
|
||||
if (const auto match = versionRegex.match(connection.syncthingVersion()); match.isValid()) {
|
||||
versionAction->setText(match.captured(1));
|
||||
} else {
|
||||
versionAction->setText(connection.syncthingVersion());
|
||||
}
|
||||
versionAction->setEnabled(false);
|
||||
actions << versionAction;
|
||||
}
|
||||
|
||||
// add config items
|
||||
QAction *const configFileAction = new QAction(QIcon::fromTheme(QStringLiteral("settings-configure")), tr("Select Syncthing config ..."), parent);
|
||||
connect(configFileAction, &QAction::triggered, &data, &SyncthingFileItemActionStaticData::selectSyncthingConfig);
|
||||
|
|
Loading…
Reference in New Issue