diff -r 1a2a00e78665 -r 7feec50967db contentstorage/caclient/stub/src/caobjectadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/caclient/stub/src/caobjectadapter.cpp Tue Mar 23 23:17:02 2010 +0200 @@ -0,0 +1,62 @@ + /* + * Copyright (c)2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ + +#include + +#include "caobjectadapter.h" +#include "caentry.h" +#include "caicondescription.h" + + +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- +QPixmap CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size) +{ + QPixmap icon; + if (!entry.iconDescription().filename().isEmpty()) { + icon = QPixmap(entry.iconDescription().filename()).scaled(size); + } + if (icon.isNull()) { + if (entry.role() == GroupEntryRole) { + icon = QPixmap("./resource/folder.png").scaled(size); + } + else { + icon = QPixmap("./resource/application.png").scaled(size); + } + } + return icon; +} + +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- +void CaObjectAdapter::setId(CaEntry &entry, + int id) +{ + entry.setId(id); +} + +//---------------------------------------------------------------------------- +// +//---------------------------------------------------------------------------- +void CaObjectAdapter::setId(CaIconDescription &iconDescription, + int id) +{ + iconDescription.setId(id); +} +