Commit 0cf3a751 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Rename ProfileSettings::profilesList to profileListView

To differentiate between it and the ProfileList class.
parent b0189029
...@@ -30,12 +30,12 @@ ProfileSettings::ProfileSettings(QWidget *parent) ...@@ -30,12 +30,12 @@ ProfileSettings::ProfileSettings(QWidget *parent)
{ {
setupUi(this); setupUi(this);
profilesList->setModel(ProfileModel::instance()); profileListView->setModel(ProfileModel::instance());
profilesList->setItemDelegateForColumn(ProfileModel::SHORTCUT, new ShortcutItemDelegate(this)); profileListView->setItemDelegateForColumn(ProfileModel::SHORTCUT, new ShortcutItemDelegate(this));
profilesList->setSelectionMode(QAbstractItemView::SingleSelection); profileListView->setSelectionMode(QAbstractItemView::SingleSelection);
// double clicking the profile name opens the profile edit dialog // double clicking the profile name opens the profile edit dialog
connect(profilesList, &QAbstractItemView::doubleClicked, this, &Konsole::ProfileSettings::doubleClicked); connect(profileListView, &QAbstractItemView::doubleClicked, this, &Konsole::ProfileSettings::doubleClicked);
// populate the table with profiles // populate the table with profiles
populateTable(); populateTable();
...@@ -71,23 +71,23 @@ void ProfileSettings::populateTable() ...@@ -71,23 +71,23 @@ void ProfileSettings::populateTable()
{ {
QStyleOptionViewItem opt; QStyleOptionViewItem opt;
opt.features = QStyleOptionViewItem::HasCheckIndicator | QStyleOptionViewItem::HasDecoration; opt.features = QStyleOptionViewItem::HasCheckIndicator | QStyleOptionViewItem::HasDecoration;
auto *listHeader = profilesList->header(); auto *listHeader = profileListView->header();
profilesList->resizeColumnToContents(ProfileModel::NAME); profileListView->resizeColumnToContents(ProfileModel::NAME);
listHeader->setSectionResizeMode(ProfileModel::NAME, QHeaderView::ResizeMode::Stretch); listHeader->setSectionResizeMode(ProfileModel::NAME, QHeaderView::ResizeMode::Stretch);
listHeader->setSectionResizeMode(ProfileModel::SHORTCUT, QHeaderView::ResizeMode::ResizeToContents); listHeader->setSectionResizeMode(ProfileModel::SHORTCUT, QHeaderView::ResizeMode::ResizeToContents);
listHeader->setStretchLastSection(false); listHeader->setStretchLastSection(false);
listHeader->setSectionsMovable(false); listHeader->setSectionsMovable(false);
profilesList->hideColumn(ProfileModel::PROFILE); profileListView->hideColumn(ProfileModel::PROFILE);
// listen for changes in the table selection and update the state of the form's buttons // listen for changes in the table selection and update the state of the form's buttons
// accordingly. // accordingly.
// //
// it appears that the selection model is changed when the model itself is replaced, // it appears that the selection model is changed when the model itself is replaced,
// so the signals need to be reconnected each time the model is updated. // so the signals need to be reconnected each time the model is updated.
connect(profilesList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::ProfileSettings::tableSelectionChanged); connect(profileListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::ProfileSettings::tableSelectionChanged);
} }
void ProfileSettings::tableSelectionChanged(const QItemSelection &selected) void ProfileSettings::tableSelectionChanged(const QItemSelection &selected)
...@@ -173,7 +173,7 @@ void ProfileSettings::editSelected() ...@@ -173,7 +173,7 @@ void ProfileSettings::editSelected()
Profile::Ptr ProfileSettings::currentProfile() const Profile::Ptr ProfileSettings::currentProfile() const
{ {
QItemSelectionModel *selection = profilesList->selectionModel(); QItemSelectionModel *selection = profileListView->selectionModel();
if ((selection == nullptr) || !selection->hasSelection()) { if ((selection == nullptr) || !selection->hasSelection()) {
return Profile::Ptr(); return Profile::Ptr();
...@@ -200,5 +200,5 @@ bool ProfileSettings::isProfileWritable(Profile::Ptr profile) const ...@@ -200,5 +200,5 @@ bool ProfileSettings::isProfileWritable(Profile::Ptr profile) const
void ProfileSettings::setShortcutEditorVisible(bool visible) void ProfileSettings::setShortcutEditorVisible(bool visible)
{ {
profilesList->setColumnHidden(ProfileModel::SHORTCUT, !visible); profileListView->setColumnHidden(ProfileModel::SHORTCUT, !visible);
} }
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="0" rowspan="2"> <item row="0" column="0" rowspan="2">
<widget class="QTreeView" name="profilesList"> <widget class="QTreeView" name="profileListView">
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
......
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