logsui/logsengine/tsrc/hbstubs/hbstubs.cpp
changeset 15 76d2cf7a585e
parent 2 7119b73b84d6
equal deleted inserted replaced
13:52d644758b05 15:76d2cf7a585e
    14 * Description:  
    14 * Description:  
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Orbit classes
    18 // Orbit classes
       
    19 #include <hbnotificationdialog.h>
    19 #include <hbicon.h>
    20 #include <hbicon.h>
    20 #include <hblineedit.h>
    21 #include <hblineedit.h>
    21 #include <QVariant>
    22 #include <QVariant>
       
    23 #include <hbstringutil.h>
       
    24 #include "hbstubs_helper.h"
       
    25 
    22 
    26 
    23 
    27 
    24 QString mUTClipboard;
    28 QString mUTClipboard;
    25 static QIcon* logsTestIcon = 0;
    29 static QIcon* logsTestIcon = 0;
    26 
    30 
    33 if ( !logsTestIcon ){ \
    37 if ( !logsTestIcon ){ \
    34     logsTestIcon = new QIcon(); \
    38     logsTestIcon = new QIcon(); \
    35 }
    39 }
    36 
    40 
    37 // -----------------------------------------------------------------------------
    41 // -----------------------------------------------------------------------------
       
    42 // HbStubsHelper
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 
       
    46 QString testNotifDialogText;
       
    47 bool testConversionEnabled = false;
       
    48 
       
    49 void HbStubHelper::reset()
       
    50 {
       
    51     testNotifDialogText.clear();
       
    52     testConversionEnabled = false;
       
    53 }
       
    54 
       
    55 QString HbStubHelper::notificationDialogTxt()
       
    56 {
       
    57     return testNotifDialogText;
       
    58 }
       
    59 
       
    60 void HbStubHelper::stringUtilDigitConversion(bool enabled)
       
    61 {
       
    62     testConversionEnabled = enabled;
       
    63 }
       
    64 
       
    65 
       
    66 // -----------------------------------------------------------------------------
    38 // HbIcon::HbIcon
    67 // HbIcon::HbIcon
    39 // -----------------------------------------------------------------------------
    68 // -----------------------------------------------------------------------------
    40 //
    69 //
    41 HbIcon::HbIcon()
    70 HbIcon::HbIcon()
    42 {   
    71 {   
    68 // HbIcon::HbIcon
    97 // HbIcon::HbIcon
    69 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
    70 //
    99 //
    71 HbIcon::HbIcon(const HbIcon &icon)
   100 HbIcon::HbIcon(const HbIcon &icon)
    72 {
   101 {
    73     mName = "c:\\data\\images\\designer.png";
   102     mName = icon.mName;
    74     ENSURE_DEFAULT_ICON
   103     ENSURE_DEFAULT_ICON
    75 }
   104 }
    76 
   105 
    77 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
    78 // HbIcon::~HbIcon
   107 // HbIcon::~HbIcon
   191 //
   220 //
   192 QString HbLineEdit::text() const
   221 QString HbLineEdit::text() const
   193 {
   222 {
   194 	return mText;
   223 	return mText;
   195 }
   224 }
       
   225 
       
   226 // -----------------------------------------------------------------------------
       
   227 // HbNotificationDialog::launchDialog
       
   228 // -----------------------------------------------------------------------------
       
   229 //
       
   230 void HbNotificationDialog::launchDialog(const QString &title, QGraphicsScene *scene)
       
   231 {
       
   232     Q_UNUSED(scene);
       
   233     testNotifDialogText = title;
       
   234 }
       
   235 
       
   236 // -----------------------------------------------------------------------------
       
   237 // HbStringUtil
       
   238 // -----------------------------------------------------------------------------
       
   239 //
       
   240 
       
   241 QString HbStringUtil::convertDigits( const QString str )
       
   242 {
       
   243     // Normally this method converts to current locale digits but for testing purpose
       
   244     // is enough to see just that some conversion occured.
       
   245     return convertDigitsTo(str, WesternDigit);
       
   246 }
       
   247 
       
   248 QString HbStringUtil::convertDigitsTo( const QString str, const DigitType digitType )
       
   249 {
       
   250     Q_UNUSED(digitType);
       
   251     if ( testConversionEnabled && !str.isEmpty() ){
       
   252         return ( QString("conv") + str );
       
   253     }
       
   254     return str;
       
   255 }