contentstorage/caclient/stub/src/caobjectadapter.cpp
changeset 86 e492551a0d54
parent 85 7feec50967db
child 87 9d806967057c
equal deleted inserted replaced
85:7feec50967db 86:e492551a0d54
    13  *
    13  *
    14  * Description:  ?Description
    14  * Description:  ?Description
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <cadefs.h>
    18 #include <QDir>
       
    19 #include <HbIcon>
       
    20 
    19 
    21 
    20 #include "caobjectadapter.h"
    22 #include "caobjectadapter.h"
    21 #include "caentry.h"
    23 #include "caentry.h"
    22 #include "caicondescription.h"
    24 #include "caicondescription.h"
    23 
    25 #include <cadefs.h>
    24 
    26 
    25 //----------------------------------------------------------------------------
    27 //----------------------------------------------------------------------------
    26 //
    28 //
    27 //----------------------------------------------------------------------------
    29 //----------------------------------------------------------------------------
    28 QPixmap CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size)
    30 HbIcon CaObjectAdapter::makeIcon(const CaEntry &entry, const QSize &size)
    29 {
    31 {
    30     QPixmap icon;
    32     HbIcon icon;
    31     if (!entry.iconDescription().filename().isEmpty()) {
    33     QString filename(entry.iconDescription().filename());
    32         icon = QPixmap(entry.iconDescription().filename()).scaled(size);
    34     if(!filename.isEmpty()) {
       
    35         icon = HbIcon(filename);
    33     }
    36     }
    34     if (icon.isNull()) {
    37     if (icon.isNull() || !(icon.size().isValid())) {
    35         if (entry.role() == GroupEntryRole) {
    38         icon = HbIcon(QDir(".").absoluteFilePath("resource/application.png"));
    36             icon = QPixmap("./resource/folder.png").scaled(size);
       
    37         }
       
    38         else {
       
    39             icon = QPixmap("./resource/application.png").scaled(size);
       
    40         }
       
    41     }
    39     }
    42     return icon;
    40     return icon;
    43 }
    41 }
       
    42 
    44 
    43 
    45 //----------------------------------------------------------------------------
    44 //----------------------------------------------------------------------------
    46 //
    45 //
    47 //----------------------------------------------------------------------------
    46 //----------------------------------------------------------------------------
    48 void CaObjectAdapter::setId(CaEntry &entry,
    47 void CaObjectAdapter::setId(CaEntry &entry,