Skip to content
GitLab
Menu
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
0cf3a751
Commit
0cf3a751
authored
Oct 09, 2021
by
Ahmad Samir
Committed by
Kurt Hindenburg
Oct 19, 2021
Browse files
Rename ProfileSettings::profilesList to profileListView
To differentiate between it and the ProfileList class.
parent
b0189029
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/settings/ProfileSettings.cpp
View file @
0cf3a751
...
...
@@ -30,12 +30,12 @@ ProfileSettings::ProfileSettings(QWidget *parent)
{
setupUi
(
this
);
profile
s
List
->
setModel
(
ProfileModel
::
instance
());
profile
s
List
->
setItemDelegateForColumn
(
ProfileModel
::
SHORTCUT
,
new
ShortcutItemDelegate
(
this
));
profile
s
List
->
setSelectionMode
(
QAbstractItemView
::
SingleSelection
);
profileList
View
->
setModel
(
ProfileModel
::
instance
());
profileList
View
->
setItemDelegateForColumn
(
ProfileModel
::
SHORTCUT
,
new
ShortcutItemDelegate
(
this
));
profileList
View
->
setSelectionMode
(
QAbstractItemView
::
SingleSelection
);
// double clicking the profile name opens the profile edit dialog
connect
(
profile
s
List
,
&
QAbstractItemView
::
doubleClicked
,
this
,
&
Konsole
::
ProfileSettings
::
doubleClicked
);
connect
(
profileList
View
,
&
QAbstractItemView
::
doubleClicked
,
this
,
&
Konsole
::
ProfileSettings
::
doubleClicked
);
// populate the table with profiles
populateTable
();
...
...
@@ -71,23 +71,23 @@ void ProfileSettings::populateTable()
{
QStyleOptionViewItem
opt
;
opt
.
features
=
QStyleOptionViewItem
::
HasCheckIndicator
|
QStyleOptionViewItem
::
HasDecoration
;
auto
*
listHeader
=
profile
s
List
->
header
();
auto
*
listHeader
=
profileList
View
->
header
();
profile
s
List
->
resizeColumnToContents
(
ProfileModel
::
NAME
);
profileList
View
->
resizeColumnToContents
(
ProfileModel
::
NAME
);
listHeader
->
setSectionResizeMode
(
ProfileModel
::
NAME
,
QHeaderView
::
ResizeMode
::
Stretch
);
listHeader
->
setSectionResizeMode
(
ProfileModel
::
SHORTCUT
,
QHeaderView
::
ResizeMode
::
ResizeToContents
);
listHeader
->
setStretchLastSection
(
false
);
listHeader
->
setSectionsMovable
(
false
);
profile
s
List
->
hideColumn
(
ProfileModel
::
PROFILE
);
profileList
View
->
hideColumn
(
ProfileModel
::
PROFILE
);
// listen for changes in the table selection and update the state of the form's buttons
// accordingly.
//
// 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.
connect
(
profile
s
List
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
Konsole
::
ProfileSettings
::
tableSelectionChanged
);
connect
(
profileList
View
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
Konsole
::
ProfileSettings
::
tableSelectionChanged
);
}
void
ProfileSettings
::
tableSelectionChanged
(
const
QItemSelection
&
selected
)
...
...
@@ -173,7 +173,7 @@ void ProfileSettings::editSelected()
Profile
::
Ptr
ProfileSettings
::
currentProfile
()
const
{
QItemSelectionModel
*
selection
=
profile
s
List
->
selectionModel
();
QItemSelectionModel
*
selection
=
profileList
View
->
selectionModel
();
if
((
selection
==
nullptr
)
||
!
selection
->
hasSelection
())
{
return
Profile
::
Ptr
();
...
...
@@ -200,5 +200,5 @@ bool ProfileSettings::isProfileWritable(Profile::Ptr profile) const
void
ProfileSettings
::
setShortcutEditorVisible
(
bool
visible
)
{
profile
s
List
->
setColumnHidden
(
ProfileModel
::
SHORTCUT
,
!
visible
);
profileList
View
->
setColumnHidden
(
ProfileModel
::
SHORTCUT
,
!
visible
);
}
src/settings/ProfileSettings.ui
View file @
0cf3a751
...
...
@@ -98,7 +98,7 @@
</spacer>
</item>
<item
row=
"0"
column=
"0"
rowspan=
"2"
>
<widget
class=
"QTreeView"
name=
"profile
s
List"
>
<widget
class=
"QTreeView"
name=
"profileList
View
"
>
<property
name=
"alternatingRowColors"
>
<bool>
true
</bool>
</property>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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