radioapp/radiouiengine/src/radiohistoryitem_p.cpp
changeset 19 afea38384506
parent 16 f54ebcfc1b80
child 37 451b2e1545b2
equal deleted inserted replaced
16:f54ebcfc1b80 19:afea38384506
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 // System includes
       
    19 #include <QSqlRecord>
       
    20 #include <QVariant>
       
    21 
       
    22 // User includes
    18 #include "radiohistoryitem.h"
    23 #include "radiohistoryitem.h"
    19 #include "radiohistoryitem_p.h"
    24 #include "radiohistoryitem_p.h"
    20 
    25 
    21 /*!
    26 /*!
    22  *
    27  *
    39  *
    44  *
    40  */
    45  */
    41 void RadioHistoryItemPrivate::init( const QString& artist, const QString& title )
    46 void RadioHistoryItemPrivate::init( const QString& artist, const QString& title )
    42 {
    47 {
    43     ref = 1;
    48     ref = 1;
       
    49     mId = -1;
    44     mArtist = artist;
    50     mArtist = artist;
    45     mTitle = title;
    51     mTitle = title;
    46     mFrequency = 0;
    52     mFrequency = 0;
    47     mFavorite = false;
    53     mTagged = false;
    48     mPlayCount = 1;
    54     mFromRds = true;
    49 }
    55 }
       
    56 
       
    57 /*!
       
    58  *
       
    59  */
       
    60 void RadioHistoryItemPrivate::initFromRecord( const QSqlRecord& record )
       
    61 {
       
    62     mId = record.value( RadioHistoryValue::Id ).toInt();
       
    63     mArtist = record.value( RadioHistoryValue::Artist ).toString();
       
    64     mTitle = record.value( RadioHistoryValue::Title ).toString();
       
    65     mFrequency = record.value( RadioHistoryValue::Frequency ).toUInt() * 1000;
       
    66     mStation = record.value( RadioHistoryValue::Station ).toString();
       
    67     mTagged = record.value( RadioHistoryValue::Tagged ).toBool();
       
    68     mFromRds = record.value( RadioHistoryValue::FromRds ).toBool();
       
    69     mTime = record.value( RadioHistoryValue::Time ).toDateTime();
       
    70 }