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
0c5a853e
Commit
0c5a853e
authored
Sep 04, 2011
by
Jekyll Wu
Browse files
Add helper method createTempProfile() to reduce duplicated code.
parent
709445ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/EditProfileDialog.cpp
View file @
0c5a853e
...
...
@@ -90,8 +90,7 @@ EditProfileDialog::EditProfileDialog(QWidget* parent)
connect
(
_ui
->
tabWidget
,
SIGNAL
(
currentChanged
(
int
))
,
this
,
SLOT
(
preparePage
(
int
))
);
_tempProfile
=
Profile
::
Ptr
(
new
Profile
);
_tempProfile
->
setHidden
(
true
);
createTempProfile
();
}
EditProfileDialog
::~
EditProfileDialog
()
{
...
...
@@ -113,8 +112,8 @@ void EditProfileDialog::save()
_previewedProperties
.
remove
(
iter
.
key
());
}
_t
empProfile
=
Profile
::
Ptr
(
new
Profile
);
_tempProfile
->
setHidden
(
true
);
createT
empProfile
(
);
enableButtonApply
(
false
);
}
void
EditProfileDialog
::
reject
()
...
...
@@ -178,8 +177,7 @@ void EditProfileDialog::setProfile(Profile::Ptr profile)
if
(
_tempProfile
)
{
_tempProfile
=
Profile
::
Ptr
(
new
Profile
);
_tempProfile
->
setHidden
(
true
);
createTempProfile
();
}
}
const
Profile
::
Ptr
EditProfileDialog
::
lookupProfile
()
const
...
...
@@ -823,6 +821,12 @@ void EditProfileDialog::updateTransparencyWarning()
}
}
void
EditProfileDialog
::
createTempProfile
()
{
_tempProfile
=
Profile
::
Ptr
(
new
Profile
);
_tempProfile
->
setHidden
(
true
);
}
void
EditProfileDialog
::
updateTempProfileProperty
(
Profile
::
Property
property
,
const
QVariant
&
value
)
{
_tempProfile
->
setProperty
(
property
,
value
);
...
...
src/EditProfileDialog.h
View file @
0c5a853e
...
...
@@ -212,6 +212,10 @@ private:
// always come after the preview operation.
void
updateTempProfileProperty
(
Profile
::
Property
,
const
QVariant
&
value
);
// helper method for creating an empty & hidden profile and assigning
// it to _tempProfile.
void
createTempProfile
();
// Enable or disable apply button, used only within
// updateTempProfileProperty().
void
updateButtonApply
();
...
...
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