Commit 02b0fcce authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Automatically import from ~/.ssh/config

parent 454eda2a
......@@ -41,6 +41,12 @@ SSHManagerModel::SSHManagerModel(QObject *parent)
if (invisibleRootItem()->rowCount() == 0) {
addTopLevelItem(i18n("Default"));
}
m_sshConfigWatcher.addPath(SshDir + QStringLiteral("config"));
connect(&m_sshConfigWatcher, &QFileSystemWatcher::fileChanged, this, [this] {
startImportFromSshConfig();
});
startImportFromSshConfig();
}
SSHManagerModel::~SSHManagerModel() noexcept
......
......@@ -8,6 +8,7 @@
#ifndef SSHMANAGERMODEL_H
#define SSHMANAGERMODEL_H
#include <QFileSystemWatcher>
#include <QStandardItemModel>
#include <memory>
......@@ -43,6 +44,7 @@ public:
private:
QStandardItem *m_sshConfigTopLevelItem = nullptr;
QFileSystemWatcher m_sshConfigWatcher;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment