contentstorage/caclient/stub/src/camenuiconutility.cpp
changeset 66 32469d7d46ff
child 83 156f692b1687
equal deleted inserted replaced
61:8e5041d13c84 66:32469d7d46ff
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  */
       
    17 
       
    18 #include <HbIcon>
       
    19 #include <QDir>
       
    20 #include <cadefs.h>
       
    21 
       
    22 #include "camenuiconutility.h"
       
    23 #include "caicondescription.h"
       
    24 #include "caentry.h"
       
    25 
       
    26 /*!
       
    27  Get icon when uid is defined.
       
    28  \param entry const reference to CaEntry.
       
    29  \param sie const reference to icon size.
       
    30  \retval icon.
       
    31  */
       
    32 HbIcon CaMenuIconUtility::getApplicationIcon(int uid,
       
    33         const QSize &size)
       
    34 {
       
    35     HbIcon icon;
       
    36     return icon;
       
    37 }
       
    38 
       
    39 /*!
       
    40  Get icon.
       
    41  \param entry const reference to CaEntry.
       
    42  \param sie const reference to icon size.
       
    43  \retval icon.
       
    44  */
       
    45 HbIcon CaMenuIconUtility::getEntryIcon(const CaEntry& entry,
       
    46         const QSize &size)
       
    47 {
       
    48     HbIcon icon;
       
    49     QString filename(entry.iconDescription().filename());
       
    50     if (!filename.isEmpty()) {
       
    51         icon = HbIcon(filename);
       
    52     }
       
    53     if (icon.isNull() || !(icon.size().isValid())) {
       
    54         icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
       
    55     }
       
    56     return icon;
       
    57 }
       
    58 
       
    59