emailuis/nmailuiengine/src/nmicons.cpp
changeset 30 759dc5235cdb
parent 20 ecc8def7944a
equal deleted inserted replaced
27:9ba4404ef423 30:759dc5235cdb
    64     Get icon function. Use this function with enumeration value to get
    64     Get icon function. Use this function with enumeration value to get
    65     corresponding icon. Icon is created if it does not exist previously.
    65     corresponding icon. Icon is created if it does not exist previously.
    66 */
    66 */
    67 HbIcon &NmIcons::getIcon(NmIcons::Icon icon)
    67 HbIcon &NmIcons::getIcon(NmIcons::Icon icon)
    68 {
    68 {
       
    69     NM_FUNCTION;
       
    70     
    69     if (!icons[icon]) {
    71     if (!icons[icon]) {
    70         for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
    72         for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
    71             if (icon_res[i].id == icon) {
    73             if (icon_res[i].id == icon) {
    72                 // Branding icon check here. If branded icon is not found
    74                 // Branding icon check here. If branded icon is not found
    73                 // default icon is to be loaded.
    75                 // default icon is to be loaded.
    79                 break;
    81                 break;
    80             }
    82             }
    81         }
    83         }
    82     }
    84     }
    83     if (!icons[icon]) {
    85     if (!icons[icon]) {
    84         NMLOG(QString("nmailuiengine: Cannot open icon file: ###").arg(__FILE__));
    86         NM_ERROR(1,QString("nmailuiengine: cannot open icon file: %1").arg(__FILE__));
    85     }
    87     }
    86     return *icons[icon];
    88     return *icons[icon];
    87 }
    89 }
    88 
    90 
    89 /*!
    91 /*!
    90     Icon array reset functionality. Called when application exists.
    92     Icon array reset functionality. Called when application exists.
    91 */
    93 */
    92 void NmIcons::freeIcons()
    94 void NmIcons::freeIcons()
    93 {
    95 {
    94     NMLOG("nmailuiengine: Enter freeIcons");
    96     NM_FUNCTION;
       
    97     
    95     for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
    98     for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
    96         if (icons[i]) {
    99         if (icons[i]) {
    97             delete icons[i];
   100             delete icons[i];
    98             icons[i] = NULL;
   101             icons[i] = NULL;
    99         }
   102         }