Start/ | End/ | |||
True | False | - | Line | Source |
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: Music Player Query Manager. | |||
15 | * | |||
16 | */ | |||
17 | ||||
18 | #include "mpquerymanager.h" | |||
19 | #include <QObject> | |||
20 | #include <QList> | |||
21 | #include <QFile> | |||
22 | #include <QUrl> | |||
23 | ||||
24 | #include "mpdetailssharedialog.h" | |||
25 | #include "mptrace.h" | |||
26 | #include "logger.h" | |||
27 | ||||
28 | const int KRecommendationNum = 2; | |||
29 | ||||
Top | ||||
4 | 4 | 30 | MpQueryManager::MpQueryManager(QObject *parent) | |
31 | :QObject(parent) | |||
32 | { | |||
33 | TX_ENTRY_ARGS("STUB") | |||
34 | mRecommendationAlbumArtsName << "C:\\Data\\albumOne.png" << "C:\\Data\\albumTwo.png"; | |||
35 | TX_EXIT_ARGS("STUB") | |||
36 | } | |||
37 | ||||
Top | ||||
4 | 4 | 38 | MpQueryManager::~MpQueryManager() | |
39 | { | |||
40 | TX_ENTRY_ARGS("STUB") | |||
41 | TX_EXIT_ARGS("STUB") | |||
42 | } | |||
43 | ||||
44 | ||||
Top | ||||
0 | 0 | - | 45 | void MpQueryManager::clearNetworkReplies() |
46 | { | |||
47 | TX_ENTRY_ARGS("STUB Reply count = "); | |||
48 | TX_EXIT_ARGS("STUB") | |||
49 | } | |||
50 | ||||
51 | ||||
Top | ||||
0 | 0 | - | 52 | void MpQueryManager::queryLocalMusicStore(QString artist,QString album,QString title) |
53 | { | |||
54 | TX_ENTRY_ARGS("STUB") | |||
55 | mArtist=artist; | |||
56 | mAlbum=album; | |||
57 | mTitle=title; | |||
58 | TX_EXIT_ARGS("STUB") | |||
59 | } | |||
60 | ||||
Top | ||||
0 | 0 | - | 61 | void MpQueryManager::queryInspireMeItems(QString artist,QString album,QString title) |
62 | { | |||
63 | TX_ENTRY_ARGS("STUB") | |||
64 | mArtist=artist; | |||
65 | mAlbum=album; | |||
66 | mTitle=title; | |||
67 | TX_EXIT_ARGS("STUB") | |||
68 | } | |||
69 | ||||
Top | ||||
0 | 0 | - | 70 | void MpQueryManager::clearRecommendations() |
71 | { | |||
72 | TX_ENTRY_ARGS("STUB") | |||
73 | mDownloadedAlbumArts = 0; | |||
74 | mAlbumArtsReadyCount = 0; | |||
0 | 0 | - | 75 | for ( int i = 0; i < KRecommendationNum; i++ ) { |
76 | mRecommendationSongs.clear(); | |||
77 | mRecommendationArtists.clear(); | |||
78 | mRecommendationAlbumArtsLink.clear(); | |||
79 | mRecommendationAlbumArtsMap.clear(); | |||
80 | QFile file( mRecommendationAlbumArtsName.at( i ) ); | |||
0 | 0 | - | 81 | if ( file.exists() ) { |
0 | 0 | - | 82 | if ( file.remove() ) { |
83 | TX_LOG_ARGS( "File removed - " << file.fileName() ); | |||
84 | } | |||
85 | else { | |||
86 | TX_LOG_ARGS( "Cannot remove file - " << file.fileName() ); | |||
87 | } | |||
88 | } else { | |||
89 | TX_LOG_ARGS( "File doesn't exist - " << file.fileName() ); | |||
90 | } | |||
91 | } | |||
92 | TX_EXIT_ARGS("STUB") | |||
93 | } | |||
94 | ||||
95 | /*! | |||
96 | Return recommendation songs | |||
97 | */ | |||
Top | ||||
0 | 0 | - | 98 | QStringList MpQueryManager::recommendationSongs() |
99 | { | |||
100 | TX_LOG | |||
0 | - | 101 | return mRecommendationSongs; | |
102 | } | |||
103 | ||||
104 | /*! | |||
105 | Return recommendation artists | |||
106 | */ | |||
Top | ||||
0 | 0 | - | 107 | QStringList MpQueryManager::recommendationArtists() |
108 | { | |||
109 | TX_LOG | |||
0 | - | 110 | return mRecommendationArtists; | |
111 | } | |||
112 | ||||
113 | /*! | |||
114 | Return recommendation album arts links | |||
115 | */ | |||
Top | ||||
0 | 0 | - | 116 | QStringList MpQueryManager::recommendationAlbumArtsLink() |
117 | { | |||
118 | TX_LOG | |||
0 | - | 119 | return mRecommendationAlbumArtsLink; | |
120 | } | |||
121 | ||||
122 | /*! | |||
123 | Return map of name and pixmap | |||
124 | */ | |||
Top | ||||
0 | 0 | - | 125 | QMap<QString, QPixmap> MpQueryManager::recommendationAlbumArtsMap() |
126 | { | |||
127 | TX_LOG | |||
0 | - | 128 | return mRecommendationAlbumArtsMap; | |
129 | } | |||
130 | ||||
131 | /*! | |||
132 | Return the number of ready album arts | |||
133 | */ | |||
Top | ||||
0 | 0 | - | 134 | int &MpQueryManager::albumArtsReadyCount() |
135 | { | |||
136 | TX_LOG | |||
0 | - | 137 | return mAlbumArtsReadyCount; | |
138 | } | |||
139 | ||||
140 | /*! | |||
141 | Insert one uri & pixmap item into map | |||
142 | */ | |||
Top | ||||
0 | 0 | - | 143 | void MpQueryManager::insertMapItem( const QString &uri, const QPixmap &pixmap ) |
144 | { | |||
145 | TX_ENTRY_ARGS("STUB Map Item URI: " << uri ); | |||
146 | mRecommendationAlbumArtsMap.insert( uri, pixmap ); | |||
147 | TX_EXIT_ARGS("STUB") | |||
148 | } | |||
149 | ||||
***TER 9% (2/23) of SOURCE FILE mpquerymanager.cpp |