author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:33:45 +0100 | |
branch | GCC_SURGE |
changeset 37 | 451b2e1545b2 |
parent 19 | afea38384506 |
parent 32 | 189d20c34778 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <QSqlRecord> |
|
20 |
#include <QVariant> |
|
21 |
||
22 |
// User includes |
|
23 |
#include "radiohistoryitem.h" |
|
24 |
#include "radiohistoryitem_p.h" |
|
25 |
||
26 |
/*! |
|
27 |
* |
|
28 |
*/ |
|
29 |
RadioHistoryItemPrivate::RadioHistoryItemPrivate() |
|
30 |
{ |
|
31 |
init( "", "" ); |
|
32 |
} |
|
33 |
||
34 |
/*! |
|
35 |
* |
|
36 |
*/ |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
37 |
RadioHistoryItemPrivate::RadioHistoryItemPrivate( const RadioHistoryItemPrivate& other ) : |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
38 |
QSharedData( other ), |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
39 |
mId( other.mId ), |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
40 |
mArtist( other.mArtist ), |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
41 |
mTitle( other.mTitle ), |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
42 |
mFrequency( other.mFrequency ), |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
43 |
mTagged( other.mTagged ), |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
44 |
mFromRds( other.mFromRds ) |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
45 |
{ |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
46 |
} |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
47 |
|
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
48 |
/*! |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
49 |
* |
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
50 |
*/ |
24 | 51 |
RadioHistoryItemPrivate::RadioHistoryItemPrivate( const QString& artist, |
52 |
const QString& title ) |
|
53 |
{ |
|
54 |
init( artist, title ); |
|
55 |
} |
|
56 |
||
57 |
/*! |
|
58 |
* |
|
59 |
*/ |
|
60 |
void RadioHistoryItemPrivate::init( const QString& artist, const QString& title ) |
|
61 |
{ |
|
62 |
mId = -1; |
|
63 |
mArtist = artist; |
|
64 |
mTitle = title; |
|
65 |
mFrequency = 0; |
|
66 |
mTagged = false; |
|
67 |
mFromRds = true; |
|
68 |
} |
|
69 |
||
70 |
/*! |
|
71 |
* |
|
72 |
*/ |
|
73 |
void RadioHistoryItemPrivate::initFromRecord( const QSqlRecord& record ) |
|
74 |
{ |
|
75 |
mId = record.value( RadioHistoryValue::Id ).toInt(); |
|
76 |
mArtist = record.value( RadioHistoryValue::Artist ).toString(); |
|
77 |
mTitle = record.value( RadioHistoryValue::Title ).toString(); |
|
78 |
mFrequency = record.value( RadioHistoryValue::Frequency ).toUInt() * 1000; |
|
79 |
mStation = record.value( RadioHistoryValue::Station ).toString(); |
|
80 |
mTagged = record.value( RadioHistoryValue::Tagged ).toBool(); |
|
81 |
mFromRds = record.value( RadioHistoryValue::FromRds ).toBool(); |
|
82 |
mTime = record.value( RadioHistoryValue::Time ).toDateTime(); |
|
83 |
} |