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
6e26de1f
Commit
6e26de1f
authored
Jul 15, 2020
by
Gustavo Carneiro
Browse files
Move HistoryType class to a new file.
parent
88ed01d6
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
6e26de1f
...
...
@@ -82,6 +82,7 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
CompactHistoryBlockList.cpp
CompactHistoryLine.cpp
CompactHistoryScroll.cpp
HistoryType.cpp
HistorySizeDialog.cpp
widgets/HistorySizeWidget.cpp
widgets/IncrementalSearchBar.cpp
...
...
src/History.cpp
View file @
6e26de1f
...
...
@@ -60,15 +60,6 @@ using namespace Konsole;
at constant costs.
*/
//////////////////////////////////////////////////////////////////////
// History Types
//////////////////////////////////////////////////////////////////////
HistoryType
::
HistoryType
()
=
default
;
HistoryType
::~
HistoryType
()
=
default
;
//////////////////////////////
HistoryTypeNone
::
HistoryTypeNone
()
=
default
;
bool
HistoryTypeNone
::
isEnabled
()
const
...
...
src/History.h
View file @
6e26de1f
...
...
@@ -41,6 +41,7 @@
#include "CompactHistoryBlockList.h"
#include "CompactHistoryLine.h"
#include "CompactHistoryScroll.h"
#include "HistoryType.h"
// Konsole
#include "Character.h"
...
...
@@ -53,40 +54,6 @@ namespace Konsole {
// where history lines are allocated in (avoids heap fragmentation)
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// History type
//////////////////////////////////////////////////////////////////////
class
KONSOLEPRIVATE_EXPORT
HistoryType
{
public:
HistoryType
();
virtual
~
HistoryType
();
/**
* Returns true if the history is enabled ( can store lines of output )
* or false otherwise.
*/
virtual
bool
isEnabled
()
const
=
0
;
/**
* Returns the maximum number of lines which this history type
* can store or -1 if the history can store an unlimited number of lines.
*/
virtual
int
maximumLineCount
()
const
=
0
;
/**
* Converts from one type of HistoryScroll to another or if given the
* same type, returns it.
*/
virtual
HistoryScroll
*
scroll
(
HistoryScroll
*
)
const
=
0
;
/**
* Returns true if the history size is unlimited.
*/
bool
isUnlimited
()
const
{
return
maximumLineCount
()
==
-
1
;
}
};
class
KONSOLEPRIVATE_EXPORT
HistoryTypeNone
:
public
HistoryType
{
public:
...
...
src/HistoryType.cpp
0 → 100644
View file @
6e26de1f
/*
This file is part of Konsole, an X terminal.
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
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 "HistoryType.h"
using
namespace
Konsole
;
HistoryType
::
HistoryType
()
=
default
;
HistoryType
::~
HistoryType
()
=
default
;
bool
HistoryType
::
isUnlimited
()
const
{
return
maximumLineCount
()
==
-
1
;
}
src/HistoryType.h
0 → 100644
View file @
6e26de1f
/*
This file is part of Konsole, an X terminal.
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
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 HISTORYTYPE_H
#define HISTORYTYPE_H
#include "HistoryScroll.h"
#include "konsoleprivate_export.h"
namespace
Konsole
{
class
KONSOLEPRIVATE_EXPORT
HistoryType
{
public:
HistoryType
();
virtual
~
HistoryType
();
/**
* Returns true if the history is enabled ( can store lines of output )
* or false otherwise.
*/
virtual
bool
isEnabled
()
const
=
0
;
/**
* Returns the maximum number of lines which this history type
* can store or -1 if the history can store an unlimited number of lines.
*/
virtual
int
maximumLineCount
()
const
=
0
;
/**
* Converts from one type of HistoryScroll to another or if given the
* same type, returns it.
*/
virtual
HistoryScroll
*
scroll
(
HistoryScroll
*
)
const
=
0
;
/**
* Returns true if the history size is unlimited.
*/
bool
isUnlimited
()
const
;
};
}
#endif
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