/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __DBSDQMIMEICONLOADER_H
#define __DBSDQMIMEICONLOADER_H

#include <dbsdiconloader.h>

#include <qpixmap.h>
#include <qstring.h>

class DBSDQMimeIconLoader : public DBSDIconLoader {
public:
	virtual QPixmap  loadIcon(QString  name) {
		/* FIXME: Doesn't work with other file
		 *        formats than PNG.
		 */
		if(!name.endsWith(".png"))
			name += ".png";

		return  QPixmap::fromMimeSource(name);
	}

	/** No resizing is done! */
	virtual QPixmap  loadIcon(QString  name,  __unused  Size) {
		return  loadIcon(name);
	}
};

#endif
