Tests/SmfTestMusicnActivty/SmfTestMusicnActivity.cpp
author cgandhi
Tue, 12 Oct 2010 15:23:52 +0530
changeset 27 b3e1347ac96a
parent 26 83d6a149c755
permissions -rw-r--r--
Updating the information for test applications and results.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     1
/****************************************************************************
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     2
**
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     3
** Trolltech hereby grants a license to use the Qt/Eclipse Integration
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     4
** plug-in (the software contained herein), in binary form, solely for the
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     5
** purpose of creating code to be used with Trolltech's Qt software.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     6
**
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     7
** Qt Designer is licensed under the terms of the GNU General Public
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     8
** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
     9
** right to use certain no GPL licensed software under the terms of its GPL
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    10
** Exception version 1.2 (http://trolltech.com/products/qt/gplexception).
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    11
**
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    12
** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "AS
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    13
** IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    14
** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    15
** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    16
** OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    17
** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    18
** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    19
** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    20
** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    21
** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    22
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    23
**
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    24
** Since we now have the GPL exception I think that the "special exception
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    25
** is no longer needed. The license text proposed above (other than the
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    26
** special exception portion of it) is the BSD license and we have added
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    27
** the BSD license as a permissible license under the exception.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    28
**
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    29
****************************************************************************/
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    30
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    31
#include <qdebug.h>
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    32
#include <smfclient.h>
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    33
#include <smfcontactfetcher.h>
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    34
#include <smfmusic.h>
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    35
#include <smfplaylist.h>
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    36
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    37
#include "SmfTestMusicnActivity.h"
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    38
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    39
SmfTestApp::SmfTestApp(QWidget *parent)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    40
    : QWidget(parent)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    41
{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    42
	ui.setupUi(this);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    43
	m_contactFetcher = NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    44
	m_providerList = NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    45
	m_tracksofartist=NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    46
	m_tracksimilar=NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    47
	m_trackofAlbum=NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    48
	m_Playlist=NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    49
	m_Stores=NULL;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    50
}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    51
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    52
SmfTestApp::~SmfTestApp()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    53
{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    54
	if(m_contactFetcher)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    55
		delete m_contactFetcher;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    56
	if(m_providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    57
		delete m_providerList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    58
	if(m_tracksofartist)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    59
		delete m_tracksofartist;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    60
	if(m_tracksimilar)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    61
		delete m_tracksimilar;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    62
	if(m_trackofAlbum)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    63
		delete m_trackofAlbum;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    64
	if(m_Playlist)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    65
		delete m_Playlist;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    66
	if(m_Stores)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    67
		delete m_Stores;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    68
}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    69
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    70
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    71
void SmfTestApp::getTracksOfArtists()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    72
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    73
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    74
	qDebug()<<"Inside SmfTestApp::tracksofartist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    75
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    76
			QString intfName("org.symbian.smf.client.music.search");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    77
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    78
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    79
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    80
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    81
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    82
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    83
		         		if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    84
		         			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    85
							pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    86
		         			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    87
		         			m_tracksofartist = new SmfMusicSearch(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    88
		         			SmfTrackInfo TInfo;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    89
		         			TInfo.setTitle("Aja Nachle");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    90
		         			SmfArtists Artists; 
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    91
		 			        QStringList QList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    92
		         			QList.append("Adnan Sami");//A.R.Rehman");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    93
		         			Artists.setNames(QList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    94
		         			SmfError err=m_tracksofartist->tracksOfArtist(Artists,1,10);//artist,1,1);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    95
		         			qDebug()<<"Return Value of tracksOfArtist :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    96
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    97
		         			bool connected = connect(m_tracksofartist, SIGNAL(trackSearchAvailable(SmfTrackInfoList *, SmfError ,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    98
		         		     			this,SLOT(trackSearchAvailableSlot(SmfTrackInfoList*, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
    99
		         			//trackSearchAvailable
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   100
		        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   101
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   102
		         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   103
		         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   104
		  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   105
		  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   106
		  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   107
		  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   108
		  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   109
		  	qDebug()<<"Returning from SmfTestApp::getTracksOfArtists()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   110
			   	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   111
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   112
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   113
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   114
void SmfTestApp::getTracksSimilar()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   115
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   116
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   117
	qDebug()<<"Inside SmfTestApp::getTracksSimilar()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   118
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   119
			QString intfName("org.symbian.smf.client.music.search");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   120
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   121
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   122
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   123
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   124
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   125
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   126
		         		if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   127
		         			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   128
							pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   129
		         			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   130
		         			m_tracksimilar = new SmfMusicSearch(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   131
		         			SmfTrackInfo TInfo;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   132
		         				         			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   133
							TInfo.setTitle("Tera Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   134
							//TInfo.setTitle("Bambhole");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   135
						
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   136
							SmfArtists Artists; 
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   137
				
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   138
							
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   139
							QStringList QList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   140
						
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   141
							QList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   142
							Artists.setNames(QList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   143
							TInfo.setArtists(Artists);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   144
								
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   145
							//SmfError err=m_tracksimilar->tracksSimilar(TInfo,1,1);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   146
							SmfMusicFingerPrint signature;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   147
							signature.setId("+1-q7D7-iHR9cQ");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   148
							SmfError err=m_tracksimilar->trackInfo(signature,1,1);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   149
		         			bool connected = connect(m_tracksimilar, SIGNAL(trackSearchAvailable(SmfTrackInfoList *, SmfError ,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   150
		         		     			this,SLOT(trackSearchAvailableSlot(SmfTrackInfoList*, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   151
		         			//trackSearchAvailable
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   152
		        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   153
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   154
		         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   155
		         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   156
		  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   157
		  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   158
		  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   159
		  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   160
		  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   161
		  	qDebug()<<"Returning from SmfTestApp::getTracksSimilar()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   162
			   	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   163
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   164
//tracksOfAlbum
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   165
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   166
void SmfTestApp::getTracksOfAlbom()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   167
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   168
	// Tujha Chehra
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   169
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   170
	qDebug()<<"Inside SmfTestApp::getTracksOfAlbom()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   171
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   172
			QString intfName("org.symbian.smf.client.music.search");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   173
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   174
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   175
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   176
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   177
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   178
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   179
		         		if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   180
		         			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   181
							pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   182
		         			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   183
		            			m_trackofAlbum = new SmfMusicSearch(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   184
		            			SmfTrackInfo TInfo;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   185
		            			TInfo.setTitle("Summer of 69");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   186
		            			SmfAlbum album;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   187
		            			SmfArtists art;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   188
		            			QStringList strList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   189
		            			strList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   190
		            			art.setNames(strList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   191
		            			album.setName("Tujha Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   192
		            			album.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   193
		        				SmfError err = m_trackofAlbum->tracksOfAlbum(album,1,2);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   194
		            			qDebug()<<"Return Value of tracksOfAlbum :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   195
		            			bool connected = connect(m_trackofAlbum, SIGNAL(trackSearchAvailable(SmfTrackInfoList *, SmfError ,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   196
		         		     			this,SLOT(trackSearchAvailableSlot(SmfTrackInfoList*, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   197
		         			//trackSearchAvailable
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   198
		        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   199
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   200
		         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   201
		         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   202
		  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   203
		  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   204
		  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   205
		  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   206
		  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   207
		  	qDebug()<<"Returning from SmfTestApp::getTracksOfAlbom()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   208
			   	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   209
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   210
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   211
//////////////////////////////////addToPlaylist//////////////////////////////////////////////////////////////////////////
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   212
/*
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   213
playlistID (Required) : The ID of the playlist - this is available in user.getPlaylists.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   214
track (Required) : The track name to add to the playlist.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   215
artist (Required) : The artist name that corresponds to the track to be added.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   216
api_key (Required) : A Last.fm API key.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   217
api_sig (Required) : A Last.fm method signature. See authentication for more information.
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   218
sk (Required) : A session key generated by authenticating a user via the authentication protocol. 
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   219
 */////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   220
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   221
void SmfTestApp::addToPlaylist()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   222
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   223
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   224
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   225
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   226
	qDebug()<<"Inside SmfTestApp::addToPlaylist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   227
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   228
			QString intfName("org.symbian.smf.plugin.music.playlist");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   229
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   230
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   231
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   232
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   233
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   234
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   235
			if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   236
				{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   237
				pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   238
    			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   239
	    			m_Playlist = new SmfPlaylistService(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   240
	    			SmfPlaylist pl_list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   241
	    			pl_list.setPlayListTitle("playlist_2");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   242
	    			pl_list.setId("4b2es_playlist_2");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   243
	    			SmfAlbum album;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   244
	    			QList <SmfTrackInfo> list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   245
	    			SmfTrackInfo track;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   246
					SmfArtists art;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   247
					QStringList strList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   248
					strList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   249
					art.setNames(strList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   250
					album.setName("Teri Kasam");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   251
					//album.setName("Tujha Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   252
					//album.setId();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   253
					album.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   254
					track.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   255
					track.setAlbum(album);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   256
					track.setTitle("Kasam ");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   257
					//track.setTitle("Hi Hawa Mand Wahe");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   258
					list.append(track);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   259
	    			SmfError err=m_Playlist->addToPlaylist(pl_list,&list);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   260
	    			qDebug()<<"Return Value of PlayLists is :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   261
																//playlistsListAvailable(SmfPlaylistList * _t1, SmfError _t2, SmfResultPage _t3)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   262
        			bool connected = connect(m_Playlist, SIGNAL(playlistsListAvailable(SmfPlaylistList *, SmfError ,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   263
     		     			this,SLOT(playlistsListAvailableSlot(SmfPlaylistList *, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   264
   			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   265
        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   266
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   267
         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   268
         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   269
  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   270
  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   271
  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   272
  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   273
  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   274
  	qDebug()<<"Returning from SmfTestApp::getPlaylist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   275
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   276
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   277
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   278
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   279
void SmfTestApp::getPlaylist()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   280
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   281
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   282
	qDebug()<<"Inside SmfTestApp::getPlaylist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   283
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   284
			QString intfName("org.symbian.smf.plugin.music.playlist");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   285
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   286
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   287
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   288
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   289
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   290
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   291
			if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   292
				{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   293
				pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   294
    			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   295
	    			m_Playlist = new SmfPlaylistService(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   296
	    		/*	SmfPlaylist pl_list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   297
	    			pl_list.setPlayListTitle("playlist_2");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   298
	    			pl_list.setId("4b2es_playlist_2");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   299
	    			SmfAlbum album;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   300
	    			QList <SmfTrackInfo> *list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   301
					SmfTrackInfo track;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   302
					SmfArtists art;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   303
					QStringList strList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   304
					strList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   305
					art.setNames(strList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   306
					album.setName("Tujha Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   307
					album.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   308
					track.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   309
					track.setAlbum(album);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   310
					track.setTitle("Hi Hawa Mand Wahe");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   311
					list->append(track);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   312
				*/	//SmfError err=m_Stores->stores(track ,1,1);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   313
	    			SmfError err=m_Playlist->playlists(1,5);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   314
	    		//	SmfError err=m_Playlist->addToPlaylist(pl_list,list);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   315
	    			//SmfError err=m_Playlist->postCurrentPlayingPlaylist(pl_list);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   316
	    			qDebug()<<"Return Value of PlayLists is :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   317
																//playlistsListAvailable(SmfPlaylistList * _t1, SmfError _t2, SmfResultPage _t3)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   318
        			bool connected = connect(m_Playlist, SIGNAL(playlistsListAvailable(SmfPlaylistList *, SmfError ,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   319
     		     			this,SLOT(playlistsListAvailableSlot(SmfPlaylistList *, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   320
	    			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   321
        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   322
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   323
         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   324
         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   325
  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   326
  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   327
  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   328
  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   329
  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   330
  	qDebug()<<"Returning from SmfTestApp::getPlaylist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   331
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   332
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   333
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   334
void SmfTestApp::postCurrentPlayingPlaylist()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   335
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   336
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   337
	qDebug()<<"Inside SmfTestApp::postCurrentPlayingPlaylist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   338
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   339
			QString intfName("org.symbian.smf.plugin.music.playlist");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   340
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   341
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   342
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   343
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   344
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   345
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   346
			if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   347
				{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   348
				pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   349
    			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   350
	    			m_Playlist = new SmfPlaylistService(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   351
	    			SmfPlaylist pl_list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   352
	    			pl_list.setPlayListTitle("playlist_2");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   353
	    			pl_list.setId("4b2es_playlist_2");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   354
	    		//	SmfAlbum album;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   355
	    		//	QList <SmfTrackInfo> *list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   356
				//	SmfTrackInfo track;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   357
				//	SmfArtists art;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   358
				//	QStringList strList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   359
				//	strList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   360
				//	art.setNames(strList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   361
				//	album.setName("Tujha Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   362
				//	album.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   363
				//	track.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   364
				//	track.setAlbum(album);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   365
				//	track.setTitle("Hi Hawa Mand Wahe");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   366
				//	list->append(track);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   367
	    			//SmfError err=m_Playlist->addToPlaylist(pl_list,list);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   368
	    			SmfError err=m_Playlist->postCurrentPlayingPlaylist(pl_list);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   369
	    			qDebug()<<"Return Value of postCurrentPlayingPlaylist is :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   370
																//playlistsListAvailable(SmfPlaylistList * _t1, SmfError _t2, SmfResultPage _t3)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   371
        			bool connected = connect(m_Playlist, SIGNAL(playlistsListAvailable(SmfPlaylistList *, SmfError ,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   372
     		     			this,SLOT(playlistsListAvailableSlot(SmfPlaylistList *, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   373
	    			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   374
        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   375
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   376
         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   377
         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   378
  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   379
  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   380
  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   381
  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   382
  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   383
  	qDebug()<<"Returning from SmfTestApp::postCurrentPlayingPlaylist()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   384
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   385
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   386
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   387
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   388
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   389
void SmfTestApp::getStoresOfTrac()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   390
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   391
	// Tujha Chehra
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   392
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   393
	qDebug()<<"Inside SmfTestApp::getStoresOfTrac()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   394
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   395
			QString intfName("org.symbian.smf.client.music.search");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   396
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   397
			SmfProviderList *providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   398
			qDebug()<<"client.GetServices returned a list with count = "<<providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   399
			bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   400
		      foreach(SmfProvider provider, *providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   401
		         		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   402
		         		if("last.fm" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   403
		         			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   404
							pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   405
		         			qDebug()<<"Plugin for last.fm found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   406
		            	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   407
		         			/*	m_trackofAlbum = new SmfMusicSearch(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   408
		            			SmfTrackInfo TInfo;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   409
		            			TInfo.setTitle("Summer of 69");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   410
		            			SmfAlbum album;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   411
		            			SmfArtists art;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   412
		            			QStringList strList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   413
		            			strList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   414
		            			art.setNames(strList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   415
		            			album.setName("Tujha Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   416
		            			album.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   417
		        				SmfError err = m_trackofAlbum->tracksOfAlbum(album,1,2);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   418
		            			qDebug()<<"Return Value of tracksOfAlbum :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   419
		            			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   420
		            			*/
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   421
		         			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   422
                  			m_Stores = new SmfMusicSearch(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   423
                   			SmfTrackInfo TInfo;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   424
                   			TInfo.setTitle("Kabhi Aisa Lagay");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   425
                   			SmfComment com;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   426
                   			com.setText("Excellent");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   427
	            			SmfAlbum album;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   428
                   			SmfTrackInfo track;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   429
                   			SmfArtists art;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   430
							QStringList strList;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   431
							strList.append("Adnan Sami");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   432
							art.setNames(strList);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   433
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   434
							album.setName("Tujha Chehra");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   435
							album.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   436
							track.setArtists(art);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   437
							track.setAlbum(album);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   438
							SmfError err=m_Stores->stores(track ,1,1);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   439
                  			qDebug()<<"Return Value of Stores :"<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   440
																					//SmfProviderList * _t1, SmfError _t2, SmfResultPage _t3
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   441
                   			bool connected = connect(m_Stores, SIGNAL(storeSearchAvailable(SmfProviderList*,SmfError,SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   442
                   			                     								this,SLOT(storelistsListAvailable(SmfProviderList* ,SmfError ,SmfResultPage)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   443
     	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   444
		         			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   445
		        			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   446
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   447
		         			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   448
		         		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   449
		  	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   450
		  		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   451
		  		qDebug()<<"Plugin for Last.fm not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   452
		  		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   453
		  	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   454
		  	qDebug()<<"Returning from SmfTestApp::getStoresOfTrac()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   455
			   	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   456
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   457
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   458
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   459
void SmfTestApp::storelistsListAvailable(SmfProviderList* list ,SmfError error,SmfResultPage resultPage)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   460
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   461
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   462
	Q_UNUSED(resultPage)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   463
		qDebug()<<"Inside SmfTestApp::storelistsListAvailable()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   464
				
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   465
		if(error)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   466
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   467
			SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   468
			QString errStr = client.errorString(error);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   469
			qDebug()<<"Error found, code = "<<error;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   470
			qDebug()<<"Error string is = "<<errStr;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   471
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   472
			return;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   473
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   474
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   475
		//display friends information
27
b3e1347ac96a Updating the information for test applications and results.
cgandhi
parents: 26
diff changeset
   476
		
26
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   477
		qDebug()<<"Number of friends retrieved = "<<list->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   478
		if(0 == list->count())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   479
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   480
			qDebug()<<"No of tracks available!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   481
			return;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   482
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   483
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   484
		foreach(SmfProvider tracs, *list)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   485
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   486
			qDebug()<<"Authentication AppName = "<<tracs.authenticationAppName();//playListTitle();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   487
			qDebug()<<"App URL = "<<tracs.applicationUrl();//playListTitle();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   488
			qDebug()<<"Authentication AppName = "<<tracs.serviceName();//playListTitle();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   489
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   490
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   491
		
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   492
		delete list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   493
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   494
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   495
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   496
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   497
void SmfTestApp::playlistsListAvailableSlot(SmfPlaylistList* playlist ,SmfError error,SmfResultPage page)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   498
{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   499
	Q_UNUSED(page)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   500
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   501
for(int i = 0;i<playlist->count();i++)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   502
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   503
{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   504
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   505
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   506
//qDebug()<<"Data Author"<<playlist.at(i).author();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   507
qDebug()<<"Data Author"<<playlist->at(i).author();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   508
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   509
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   510
qDebug()<<"Data Creation Date"<<playlist->at(i).creationDate();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   511
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   512
//qDebug()<<"Data Comments"<<playlist.at(i).comments.at(0);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   513
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   514
qDebug()<<"Data Id"<<playlist->at(i).id();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   515
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   516
qDebug()<<"Data playListTitle"<<playlist->at(i).playListTitle();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   517
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   518
qDebug()<<"Data location"<<playlist->at(i).location();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   519
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   520
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   521
}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   522
		
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   523
}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   524
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   525
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   526
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   527
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   528
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   529
void SmfTestApp::trackSearchAvailableSlot(SmfTrackInfoList* list, SmfError error, SmfResultPage resultPage)//SmfTrackInfoList *s1 ,SmfError err)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   530
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   531
	qDebug()<<"tracks of artist";	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   532
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   533
	Q_UNUSED(resultPage)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   534
		qDebug()<<"Inside SmfTestApp::trackSearchAvailableSlot()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   535
				
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   536
		if(error)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   537
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   538
			SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   539
			QString errStr = client.errorString(error);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   540
			qDebug()<<"Error found, code = "<<error;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   541
			qDebug()<<"Error string is = "<<errStr;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   542
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   543
			return;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   544
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   545
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   546
		//display friends information
27
b3e1347ac96a Updating the information for test applications and results.
cgandhi
parents: 26
diff changeset
   547
		
26
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   548
		qDebug()<<"Number of friends retrieved = "<<list->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   549
		if(0 == list->count())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   550
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   551
			qDebug()<<"No of tracks available!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   552
			return;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   553
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   554
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   555
		foreach(SmfTrackInfo tracs, *list)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   556
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   557
			qDebug()<<"Track Title = "<<tracs.title();//playListTitle();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   558
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   559
		
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   560
		delete list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   561
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   562
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   563
		         		
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   564
void SmfTestApp::getFacebookFriends()
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   565
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   566
	qDebug()<<"Inside SmfTestApp::getFacebookFriends()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   567
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   568
	// Get the list of providers
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   569
	SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   570
	QString intfName("org.symbian.smf.plugin.contact.fetcher");
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   571
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   572
	m_providerList = client.GetServices(intfName);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   573
	qDebug()<<"client.GetServices returned a list with count = "<<m_providerList->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   574
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   575
	// flag to check if required plugin is there
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   576
	bool pluginFound = false;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   577
	foreach(SmfProvider provider, *m_providerList)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   578
		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   579
		if("Facebook" == provider.serviceName())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   580
			{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   581
			qDebug()<<"Plugin for Facebook found";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   582
			pluginFound = true;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   583
			m_contactFetcher = new SmfContactFetcher(&provider);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   584
			SmfError err = m_contactFetcher->friends(1, 10);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   585
			qDebug()<<"Ret value of friends() = "<<err;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   586
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   587
			bool connected = connect(m_contactFetcher, SIGNAL(friendsListAvailable(SmfContactList*, SmfError , SmfResultPage)),
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   588
					this, SLOT(friendsListAvailable(SmfContactList*, SmfError , SmfResultPage)));
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   589
			qDebug()<<"Signal-slot connected ? = "<<connected;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   590
			}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   591
		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   592
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   593
	if(!pluginFound)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   594
		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   595
		qDebug()<<"Plugin for Facebook not found!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   596
		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   597
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   598
	qDebug()<<"Returning from SmfTestApp::getFacebookFriends()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   599
	}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   600
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   601
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   602
void SmfTestApp::friendsListAvailable ( SmfContactList* list, SmfError error, SmfResultPage resultPage )
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   603
	{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   604
	Q_UNUSED(resultPage)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   605
	qDebug()<<"Inside SmfTestApp::friendsListAvailable()";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   606
			
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   607
	if(error)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   608
		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   609
		SmfClient client;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   610
		QString errStr = client.errorString(error);
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   611
		qDebug()<<"Error found, code = "<<error;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   612
		qDebug()<<"Error string is = "<<errStr;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   613
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   614
		return;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   615
		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   616
		
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   617
	//display friends information
27
b3e1347ac96a Updating the information for test applications and results.
cgandhi
parents: 26
diff changeset
   618
	
26
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   619
	qDebug()<<"Number of friends retrieved = "<<list->count();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   620
	if(0 == list->count())
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   621
		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   622
		qDebug()<<"No friends available!!!";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   623
		return;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   624
		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   625
		
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   626
	foreach(SmfContact contact, *list)
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   627
		{
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   628
		qDebug()<<"Friends name = "<<contact.value("Name").value<QContactName>().firstName();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   629
		qDebug()<<"Friends status msg desc = "<<contact.value("Presence").value<QContactPresence>().customMessage();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   630
		qDebug()<<"Friends profile image URL = "<<contact.value("Avatar").value<QContactAvatar>().imageUrl();
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   631
		qDebug()<<"";
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   632
		}
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   633
	
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   634
	delete list;
83d6a149c755 Submitting following changes -
cgandhi
parents:
diff changeset
   635
	}