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
95b8d555
Commit
95b8d555
authored
Jan 26, 2012
by
Jekyll Wu
Browse files
Add dbus method for setting and querying history size per session
FEATURE: 120040
FIXED-IN: 4.9
parent
debfec2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Session.cpp
View file @
95b8d555
...
...
@@ -1275,6 +1275,34 @@ QString Session::tabTitleFormat(int context) const
}
}
void
Session
::
setHistorySize
(
int
lines
)
{
if
(
lines
<
0
)
{
setHistoryType
(
HistoryTypeFile
());
}
else
if
(
lines
==
0
)
{
setHistoryType
(
HistoryTypeNone
());
}
else
{
setHistoryType
(
CompactHistoryType
(
lines
));
}
}
int
Session
::
historySize
()
const
{
const
HistoryType
&
currentHistory
=
historyType
();
if
(
currentHistory
.
isEnabled
())
{
if
(
currentHistory
.
isUnlimited
())
{
return
-
1
;
}
else
{
return
currentHistory
.
maximumLineCount
();
}
}
else
{
return
0
;
}
}
int
Session
::
foregroundProcessId
()
{
int
pid
;
...
...
src/Session.h
View file @
95b8d555
...
...
@@ -522,6 +522,23 @@ public slots:
*/
Q_SCRIPTABLE
QString
tabTitleFormat
(
int
context
)
const
;
/**
* Sets the history capacity of this session.
*
* @param size The history capacity in unit of lines. Its value can be:
* <ul>
* <li> positive integer - fixed size history</li>
* <li> 0 - no history</li>
* <li> negative integer - unlimited history</li>
* </ul>
*/
Q_SCRIPTABLE
void
setHistorySize
(
int
lines
)
;
/**
* Returns the history capacity of this session.
*/
Q_SCRIPTABLE
int
historySize
()
const
;
signals:
/** Emitted when the terminal process starts. */
...
...
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