Commit 3021b26e authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Use the correct name of the profile, without modifiers

The SSH Manager used the modfiied names of the profiles
with the addition of "(Default)" for the profile names.
if you changed the default profile, everything would break.
parent 528f90f7
......@@ -20,6 +20,7 @@
#include <QStandardPaths>
#include <QTextStream>
#include "profile/ProfileManager.h"
#include "sshconfigurationdata.h"
Q_LOGGING_CATEGORY(SshManagerPlugin, "org.kde.konsole.plugin.sshmanager")
......@@ -234,6 +235,7 @@ void SSHManagerModel::importFromSshConfigFile(const QString &file)
}
data.useSshConfig = true;
data.importedFromSshConfig = true;
data.profileName = Konsole::ProfileManager::instance()->defaultProfile()->name();
addChildItem(data, tr("SSH Config"));
data = {};
}
......
......@@ -87,6 +87,7 @@ SSHManagerTreeWidget::SSHManagerTreeWidget(QWidget *parent)
});
ui->profile->setModel(Konsole::ProfileModel::instance());
ui->profile->setModelColumn(Konsole::ProfileModel::PROFILE);
ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->treeView, &QTreeView::customContextMenuRequested, [this](const QPoint &pos) {
......
......@@ -118,8 +118,11 @@ QVariant ProfileModel::data(const QModelIndex &idx, int role) const
switch (role) {
case ProfilePtrRole:
return QVariant::fromValue(profile);
case Qt::DisplayRole:
return profile->name();
case Qt::DecorationRole:
return QIcon::fromTheme(profile->icon());
}
break;
}
}
......
......@@ -26,12 +26,14 @@ public:
enum Roles {
ProfilePtrRole = Qt::UserRole + 1,
};
enum Column {
NAME,
SHORTCUT,
PROFILE,
COLUMNS,
};
void populate();
void add(QExplicitlySharedDataPointer<Profile> profile);
void remove(QExplicitlySharedDataPointer<Profile> profile);
......
Supports Markdown
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