2 * This file is a part of QComicBook.
4 * Copyright (C) 2005-2006 Pawel Stolowski <yogin@linux.bydg.org>
6 * QComicBook is free software; you can redestribute it and/or modify it
7 * under terms of GNU General Public License by Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY. See GPL for more details.
15 using namespace Utility;
17 History::History(const QStringList &l, int max): size(max)
22 History::History(int max)
31 void History::append(const QString &txt)
33 QStringList::iterator it = hlist.find(txt);
35 // text not found on the list - append it
36 if (it == hlist.end())
38 hlist.push_front(txt);
40 // remove last text item if history reached its max size
41 if (hlist.count() > size)
44 else //put the item to the front
47 hlist.push_front(txt);
51 void History::remove(const QString &txt)
56 void History::set(const QStringList &l)
61 QString History::first()
66 QStringList History::getAll() const