messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp
changeset 52 12db4185673b
parent 31 ebfee66fde93
equal deleted inserted replaced
44:36f374c67aa8 52:12db4185673b
    18 #include "univiewerdetailswidget.h"
    18 #include "univiewerdetailswidget.h"
    19 
    19 
    20 // SYSTEM INCLUDES
    20 // SYSTEM INCLUDES
    21 #include <HbTextItem>
    21 #include <HbTextItem>
    22 #include <HbIconItem>
    22 #include <HbIconItem>
       
    23 #include <HbExtendedLocale>
    23 #include <QDateTime>
    24 #include <QDateTime>
       
    25 #include <QStringBuilder>
    24 
    26 
    25 // USER INCLUDES
    27 // USER INCLUDES
    26 #include "convergedmessage.h"
    28 #include "convergedmessage.h"
    27 #include "debugtraces.h"
    29 #include "debugtraces.h"
    28 
    30 
    29 // LOCALIZATION
    31 // LOCALIZATION
    30 #define LOC_MESSAGE_RESEND hbTrId("txt_common_menu_resend_message")
    32 #define LOC_MESSAGE_RESEND hbTrId("txt_common_menu_resend_message")
    31 
    33 
    32 // LOCAL CONSTANTS
    34 // @see hbi18ndef.h
    33 const QString DATE_TIME_FORMAT("dd/MM/yy hh:mm ap"); //Date format.
    35 static const char DATE_FORMAT[] = r_qtn_date_usual_with_zero;
    34 const QString TIME_FORMAT("hh:mm ap");
    36 static const char TIME_FORMAT[] = r_qtn_time_usual_with_zero;
    35 
    37 
    36 const QString MSG_HIGH_PRIORITY_ICON("qtg_small_priority_high");
    38 const QString MSG_HIGH_PRIORITY_ICON("qtg_small_priority_high");
    37 const QString MSG_LOW_PRIORITY_ICON("qtg_small_priority_low");
    39 const QString MSG_LOW_PRIORITY_ICON("qtg_small_priority_low");
    38 
    40 
    39 //---------------------------------------------------------------
    41 //---------------------------------------------------------------
    76 //UniViewerDetailsWidget :: setTimeStamp
    78 //UniViewerDetailsWidget :: setTimeStamp
    77 // @see header file
    79 // @see header file
    78 //---------------------------------------------------------------
    80 //---------------------------------------------------------------
    79 void UniViewerDetailsWidget::setTimeStamp(const QDateTime &aTimeStamp, const int &aSendingState)
    81 void UniViewerDetailsWidget::setTimeStamp(const QDateTime &aTimeStamp, const int &aSendingState)
    80 {
    82 {
       
    83     HbExtendedLocale locale = HbExtendedLocale::system();
       
    84     QString date = locale.format(aTimeStamp.date(), DATE_FORMAT);
       
    85     QString time = locale.format(aTimeStamp.time(), TIME_FORMAT);
    81 
    86 
    82     if (aSendingState == ConvergedMessage::Resend) {
    87     if (aSendingState == ConvergedMessage::Resend) {
    83         mTime->setText(LOC_MESSAGE_RESEND + aTimeStamp.toString(TIME_FORMAT));
    88         mTime->setText(LOC_MESSAGE_RESEND % time);
    84     }
    89     }
    85     else {
    90     else {
    86         mTime->setText(aTimeStamp.toString(DATE_TIME_FORMAT));        
    91         mTime->setText(date % QChar(' ') % time);
    87     }
    92     }
    88 }
    93 }
    89 
    94 
    90 //---------------------------------------------------------------
    95 //---------------------------------------------------------------
    91 // UniViewerDetailsWidget::setPriorityIcon
    96 // UniViewerDetailsWidget::setPriorityIcon