diff -r 3738fe97f027 -r 8aed59de29f9 videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionutils.cpp --- a/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionutils.cpp Thu Apr 01 23:32:44 2010 +0300 +++ b/videocollection/videocollectionwrapper/tsrc/testvideomodel/stub/src/videocollectionutils.cpp Fri Apr 16 18:13:14 2010 +0300 @@ -20,6 +20,8 @@ #include #include "videocollectionutils.h" +#include +#include QString VideoCollectionUtils::mPrepareLengthStringReturnValue = "test duration"; QString VideoCollectionUtils::mPrepareSizeStringReturnValue = "test size"; @@ -110,53 +112,28 @@ } // ----------------------------------------------------------------------------- -// VideoCollectionUtils::prepareLengthStrings() +// VideoCollectionUtils::prepareShortLengthString() // ----------------------------------------------------------------------------- // -const QStringList VideoCollectionUtils::prepareLengthStrings(quint32 total) +const QString VideoCollectionUtils::prepareShortLengthString(quint32 total) { - const int secondsInMinute( 60 ); + const int secondsInMinute( 60 ); + const int secondsInHour( 3600 ); - quint32 minutes(0); - quint32 seconds(0); - - if ( total > 0 ) - { - minutes = (total / secondsInMinute); - seconds = (total % secondsInMinute); - } - - QString mins(""); - QString secs(""); - - if (minutes < 10) - { - mins = "0" + QString::number(minutes); - - } - else - { - mins = QString::number(minutes); - } - - QString secondsStr(""); - - if (seconds < 10) - { - secs = "0" + QString::number(seconds); - - } - else - { - secs = QString::number(seconds); - } - - QStringList retVal; - - retVal.append(mins); - retVal.append(secs); - - return retVal; + int hour = total / secondsInHour; + total = total % secondsInHour; + int minutes = total / secondsInMinute; + total = total % secondsInMinute; + int second = total; + + QTime time( hour ,minutes ,second ); + QString str; + + HbExtendedLocale locale = HbExtendedLocale::system(); + + str = locale.format( time, r_qtn_time_durat_long_with_zero ); + + return str; }