Commit 73dabe19 authored by Carlos Alves's avatar Carlos Alves
Browse files

Pointer to smart pointer in HighlighScrolledLines

Using std::unique_ptr
parent 93380119
......@@ -24,9 +24,6 @@ HighlightScrolledLines::HighlightScrolledLines()
HighlightScrolledLines::~HighlightScrolledLines()
{
if (_timer != nullptr) {
delete _timer;
}
}
bool HighlightScrolledLines::isEnabled()
......@@ -62,10 +59,10 @@ void HighlightScrolledLines::setPreviousScrollCount(int scrollCount)
void HighlightScrolledLines::setTimer(TerminalScrollBar *parent)
{
if (_enabled && _timer == nullptr) {
_timer = new QTimer();
_timer = std::make_unique<QTimer>();
_timer->setSingleShot(true);
_timer->setInterval(250);
_timer->connect(_timer, &QTimer::timeout, parent, &TerminalScrollBar::highlightScrolledLinesEvent);
_timer->connect(_timer.get(), &QTimer::timeout, parent, &TerminalScrollBar::highlightScrolledLinesEvent);
}
}
......
......@@ -75,7 +75,7 @@ private:
bool _enabled;
QRect _rect;
int _previousScrollCount;
QTimer *_timer;
std::unique_ptr<QTimer> _timer;
bool _needToClear;
};
} // namespace Konsole
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment