KTextEditor

history.cpp
1/*
2 SPDX-FileCopyrightText: KDE Developers
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "history.h"
8
9using namespace KateVi;
10
11namespace
12{
13const int HISTORY_SIZE_LIMIT = 100;
14}
15
16void History::append(const QString &historyItem)
17{
18 if (historyItem.isEmpty()) {
19 return;
20 }
21
22 m_items.removeAll(historyItem);
23
24 if (m_items.size() == HISTORY_SIZE_LIMIT) {
25 m_items.removeFirst();
26 }
27
28 m_items.append(historyItem);
29}
30
31void History::clear()
32{
33 m_items.clear();
34}
void append(QList< T > &&value)
void clear()
qsizetype removeAll(const AT &t)
void removeFirst()
qsizetype size() const const
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:17:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.