Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Konsole
Commits
d85fb86b
Commit
d85fb86b
authored
Jul 26, 2020
by
Gustavo Carneiro
Committed by
Kurt Hindenburg
Jul 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ShouldApplyProperty Class to a new file.
parent
9f71cc38
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
19 deletions
+81
-19
src/CMakeLists.txt
src/CMakeLists.txt
+1
-0
src/ShouldApplyProperty.cpp
src/ShouldApplyProperty.cpp
+35
-0
src/ShouldApplyProperty.h
src/ShouldApplyProperty.h
+43
-0
src/session/SessionManager.cpp
src/session/SessionManager.cpp
+1
-0
src/session/SessionManager.h
src/session/SessionManager.h
+1
-19
No files found.
src/CMakeLists.txt
View file @
d85fb86b
...
...
@@ -147,6 +147,7 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
session/SessionGroup.cpp
session/SessionController.cpp
session/SessionManager.cpp
ShouldApplyProperty.cpp
session/SessionListModel.cpp
session/SessionTask.cpp
widgets/TabTitleFormatButton.cpp
...
...
src/ShouldApplyProperty.cpp
0 → 100644
View file @
d85fb86b
/*
This source file is part of Konsole, a terminal emulator.
Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#include "ShouldApplyProperty.h"
using
namespace
Konsole
;
ShouldApplyProperty
::
ShouldApplyProperty
(
const
Profile
::
Ptr
&
profile
,
bool
modifiedOnly
)
:
_profile
(
profile
)
,
_modifiedPropertiesOnly
(
modifiedOnly
)
{
}
bool
ShouldApplyProperty
::
shouldApply
(
Profile
::
Property
property
)
const
{
return
!
_modifiedPropertiesOnly
||
_profile
->
isPropertySet
(
property
);
}
src/ShouldApplyProperty.h
0 → 100644
View file @
d85fb86b
/*
This source file is part of Konsole, a terminal emulator.
Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#ifndef SHOULDAPPLYPROPERTY_H
#define SHOULDAPPLYPROPERTY_H
#include "Profile.h"
namespace
Konsole
{
/** Utility class to simplify code in SessionManager::applyProfile(). */
class
ShouldApplyProperty
{
public:
ShouldApplyProperty
(
const
Profile
::
Ptr
&
profile
,
bool
modifiedOnly
);
bool
shouldApply
(
Profile
::
Property
property
)
const
;
private:
const
Profile
::
Ptr
_profile
;
bool
_modifiedPropertiesOnly
;
};
}
#endif
src/session/SessionManager.cpp
View file @
d85fb86b
...
...
@@ -33,6 +33,7 @@
#include <KConfigGroup>
// Konsole
#include "ShouldApplyProperty.h"
#include "session/Session.h"
#include "profile/ProfileManager.h"
#include "ProfileCommandParser.h"
...
...
src/session/SessionManager.h
View file @
d85fb86b
...
...
@@ -138,24 +138,6 @@ private:
bool
_isClosingAllSessions
;
};
/** Utility class to simplify code in SessionManager::applyProfile(). */
class
ShouldApplyProperty
{
public:
ShouldApplyProperty
(
const
QExplicitlySharedDataPointer
<
Profile
>
&
profile
,
bool
modifiedOnly
)
:
_profile
(
profile
),
_modifiedPropertiesOnly
(
modifiedOnly
)
{
}
bool
shouldApply
(
Profile
::
Property
property
)
const
{
return
!
_modifiedPropertiesOnly
||
_profile
->
isPropertySet
(
property
);
}
private:
const
QExplicitlySharedDataPointer
<
Profile
>
_profile
;
bool
_modifiedPropertiesOnly
;
};
}
#endif //SESSIONMANAGER_H
Write
Preview
Markdown
is supported
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