Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
dc6cb83e
Commit
dc6cb83e
authored
Nov 30, 2021
by
Tomaz Canabrava
Browse files
Do not add duplicate entries
parent
02b0fcce
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/SSHManager/sshmanagermodel.cpp
View file @
dc6cb83e
...
...
@@ -256,12 +256,11 @@ void SSHManagerModel::importFromSshConfigFile(const QString &file)
ignoreEntry
=
false
;
}
if
(
!
data
.
host
.
isEmpty
())
{
// When we hit this, that means that we just finished reading the
// *previous* host. so we need to add it to the list, if we can,
// and read the next value.
if
(
!
data
.
host
.
isEmpty
()
&&
!
hasHost
(
data
.
host
))
{
// We already registered this entity.
if
(
hasHost
(
data
.
host
))
{
ignoreEntry
=
true
;
continue
;
}
if
(
data
.
name
.
isEmpty
())
{
data
.
name
=
data
.
host
;
...
...
@@ -270,9 +269,9 @@ void SSHManagerModel::importFromSshConfigFile(const QString &file)
data
.
importedFromSshConfig
=
true
;
data
.
profileName
=
Konsole
::
ProfileManager
::
instance
()
->
defaultProfile
()
->
name
();
addChildItem
(
data
,
tr
(
"SSH Config"
));
data
=
{};
}
data
=
{};
data
.
host
=
lists
.
at
(
1
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment