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.
16 using namespace QComicBook;
18 QString Icons::iconpath = QString::null;
19 QDict<QIconSet> Icons::set;
21 bool Icons::init(const QString& path)
23 QDir dir(iconpath = path);
24 set.setAutoDelete(true); //icons in the set will be deleted on set deletion
28 const QIconSet& Icons::get(const QString &name)
30 QIconSet *icon = set.find(name);
33 QPixmap pixmap(iconpath + "/" + name);
34 set.insert(name, icon = new QIconSet(pixmap));