#include "tycho.h"

MapModel::MapModel(Project *parent) :
	IMapModel(parent)
{
	dbgPrintFunc();
}

MapModel::~MapModel()
{
	dbgPrintFunc();
}

void MapModel::deselect()
{
	IMapModel::deselect();

	emit deselected();
}

void MapModel::select(QModelIndex const &index)
{
	auto idx = index.internalId();

	IMapModel::select(idx);

	emit selected(idx);
}

QVariant MapModel::data(const QModelIndex &index, int role) const
{
	switch(role) {
		case Qt::DecorationRole: {
			return QVariant::fromValue(::getIcon(propIcon(index.row())));
		}
		default:
			return IMapModel::data(index, role);
	}
}

// EOF
