contentstorage/caclient/stub/src/caobjectadapter.cpp
author hgs
Tue, 23 Mar 2010 23:28:12 +0200
changeset 86 e492551a0d54
parent 85 7feec50967db
child 87 9d806967057c
permissions -rw-r--r--
201005

    /*
 * 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 <QDir>
#include <HbIcon>


#include "caobjectadapter.h"
#include "caentry.h"
#include "caicondescription.h"
#include <cadefs.h>

//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
HbIcon CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size)
{
    HbIcon icon;
    QString filename(entry.iconDescription().filename());
    if(!filename.isEmpty()) {
        icon = HbIcon(filename);
    }
    if (icon.isNull() || !(icon.size().isValid())) {
        icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
    }
    return icon;
}


//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
void CaObjectAdapter::setId(CaEntry &entry,
    int id)
{
    entry.setId(id);
}

//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
void CaObjectAdapter::setId(CaIconDescription &iconDescription,
    int id)
{
    iconDescription.setId(id);
}