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
50f87107
Commit
50f87107
authored
Aug 04, 2022
by
Ahmad Samir
Browse files
Use a type alias for the Profile Property map
parent
a27a22ff
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/profile/Profile.cpp
View file @
50f87107
...
...
@@ -220,7 +220,7 @@ void Profile::useBuiltin()
}
Profile
::
Profile
(
const
Profile
::
Ptr
&
parent
)
:
_propertyValues
(
QHash
<
Property
,
QVariant
>
())
:
_propertyValues
(
Property
Map
())
,
_parent
(
parent
)
,
_hidden
(
false
)
{
...
...
@@ -270,7 +270,7 @@ bool Profile::isEmpty() const
return
_propertyValues
.
isEmpty
();
}
QHash
<
Profile
::
Property
,
QVariant
>
Profile
::
setProperties
()
const
Profile
::
Property
Map
Profile
::
setProperties
()
const
{
return
_propertyValues
;
}
...
...
src/profile/Profile.h
View file @
50f87107
...
...
@@ -366,6 +366,8 @@ public:
Q_ENUM
(
Property
)
using
PropertyMap
=
QHash
<
Property
,
QVariant
>
;
/**
* Constructs a new profile
*
...
...
@@ -430,7 +432,7 @@ public:
virtual
bool
isPropertySet
(
Property
p
)
const
;
/** Returns a map of the properties set in this Profile instance. */
virtual
QHash
<
Property
,
QVariant
>
setProperties
()
const
;
virtual
Property
Map
setProperties
()
const
;
/** Returns true if no properties have been set in this Profile instance. */
bool
isEmpty
()
const
;
...
...
@@ -795,7 +797,7 @@ private:
// returns true if the property can be inherited
static
bool
canInheritProperty
(
Property
p
);
QHash
<
Property
,
QVariant
>
_propertyValues
;
Property
Map
_propertyValues
;
Ptr
_parent
;
bool
_hidden
;
...
...
src/profile/ProfileCommandParser.cpp
View file @
50f87107
...
...
@@ -18,9 +18,9 @@
using
namespace
Konsole
;
QHash
<
Profile
::
Property
,
QVariant
>
ProfileCommandParser
::
parse
(
const
QString
&
input
)
Profile
::
Property
Map
ProfileCommandParser
::
parse
(
const
QString
&
input
)
{
QHash
<
Profile
::
Property
,
QVariant
>
changes
;
Profile
::
Property
Map
changes
;
// regular expression to parse profile change requests.
//
...
...
src/profile/ProfileCommandParser.h
View file @
50f87107
...
...
@@ -44,7 +44,7 @@ public:
* and assigned values and returns a table of
* properties and values.
*/
QHash
<
Profile
::
Property
,
QVariant
>
parse
(
const
QString
&
input
);
Profile
::
Property
Map
parse
(
const
QString
&
input
);
};
}
...
...
src/profile/ProfileManager.cpp
View file @
50f87107
...
...
@@ -267,7 +267,7 @@ QString ProfileManager::saveProfile(const Profile::Ptr &profile)
return
newPath
;
}
void
ProfileManager
::
changeProfile
(
Profile
::
Ptr
profile
,
QHash
<
Profile
::
Property
,
QVariant
>
propertyMap
,
bool
persistent
)
void
ProfileManager
::
changeProfile
(
Profile
::
Ptr
profile
,
Profile
::
Property
Map
propertyMap
,
bool
persistent
)
{
Q_ASSERT
(
profile
);
...
...
src/profile/ProfileManager.h
View file @
50f87107
...
...
@@ -132,7 +132,7 @@ public:
* set this to false if you want to preview possible changes to a profile but do not
* wish to make them permanent.
*/
void
changeProfile
(
Profile
::
Ptr
profile
,
QHash
<
Profile
::
Property
,
QVariant
>
propertyMap
,
bool
persistent
=
true
);
void
changeProfile
(
Profile
::
Ptr
profile
,
Profile
::
Property
Map
propertyMap
,
bool
persistent
=
true
);
/**
* Sets the @p profile as the default profile for creating new sessions
...
...
src/session/SessionManager.cpp
View file @
50f87107
...
...
@@ -312,7 +312,7 @@ void SessionManager::sessionProfileCommandReceived(Session *session, const QStri
}
ProfileCommandParser
parser
;
QHash
<
Profile
::
Property
,
QVariant
>
changes
=
parser
.
parse
(
text
);
Profile
::
Property
Map
changes
=
parser
.
parse
(
text
);
Profile
::
Ptr
newProfile
;
if
(
!
_sessionRuntimeProfiles
.
contains
(
session
))
{
...
...
src/widgets/EditProfileDialog.cpp
View file @
50f87107
...
...
@@ -1043,7 +1043,7 @@ void EditProfileDialog::unpreviewAll()
_delayedPreviewTimer
->
stop
();
_delayedPreviewProperties
.
clear
();
QHash
<
Profile
::
Property
,
QVariant
>
map
;
Profile
::
Property
Map
map
;
QHashIterator
<
int
,
QVariant
>
iter
(
_previewedProperties
);
while
(
iter
.
hasNext
())
{
iter
.
next
();
...
...
@@ -1064,7 +1064,7 @@ void EditProfileDialog::unpreview(int property)
return
;
}
QHash
<
Profile
::
Property
,
QVariant
>
map
;
Profile
::
Property
Map
map
;
map
.
insert
(
static_cast
<
Profile
::
Property
>
(
property
),
_previewedProperties
[
property
]);
ProfileManager
::
instance
()
->
changeProfile
(
_profile
,
map
,
false
);
...
...
@@ -1092,7 +1092,7 @@ void EditProfileDialog::delayedPreviewActivate()
void
EditProfileDialog
::
preview
(
int
property
,
const
QVariant
&
value
)
{
QHash
<
Profile
::
Property
,
QVariant
>
map
;
Profile
::
Property
Map
map
;
map
.
insert
(
static_cast
<
Profile
::
Property
>
(
property
),
value
);
_delayedPreviewProperties
.
remove
(
property
);
...
...
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