Commit 21069461 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Save the pointer to the SSH Config Folder

parent 55d82783
......@@ -34,6 +34,10 @@ SSHManagerModel::SSHManagerModel(QObject *parent)
: QStandardItemModel(parent)
{
load();
if (!m_sshConfigTopLevelItem) {
// this also sets the m_sshConfigTopLevelItem if the text is `SSH Config`.
addTopLevelItem(i18n("SSH Config"));
}
if (invisibleRootItem()->rowCount() == 0) {
addTopLevelItem(i18n("Default"));
}
......@@ -57,6 +61,11 @@ QStandardItem *SSHManagerModel::addTopLevelItem(const QString &name)
newItem->setToolTip(i18n("%1 is a folder for SSH entries", name));
invisibleRootItem()->appendRow(newItem);
invisibleRootItem()->sortChildren(0);
if (name == i18n("SSH Config")) {
m_sshConfigTopLevelItem = newItem;
}
return newItem;
}
......
......@@ -38,6 +38,9 @@ public:
void importFromSshConfigFile(const QString &file);
void load();
void save();
private:
QStandardItem *m_sshConfigTopLevelItem = nullptr;
};
#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