void frmMain::lastFmHandShake()
{
qDebug("lastFmHandShake()");
delete lfmBuffer;
if (!lfmServer)
lfmServer
= new QHttp("post.audioscrobbler.com");
else
{
lfmServer->disconnect();
lfmServer->abort();
}
connect(lfmServer, SIGNAL(done(bool)), this, SLOT(lastFmResolved(bool)));
connect(lfmServer, SIGNAL(stateChanged(int)), this, SLOT(lastFmServerStatus(int)));
lfmServer->get(
QString("/?hs=true&p=1.1&c=%1&v=%2&u=%3") .arg("fap")
.arg("0.1")
.arg(lfmUser),
lfmBuffer);
}
/*
void frmMain::lastFmServerStatus(int i)
{
switch (i)
{
case QHttp::Unconnected:
qDebug("There is no connection to the host");
break;
case QHttp::HostLookup:
qDebug("A host name lookup is in progress.");
break;
case QHttp::Connecting:
qDebug("An attempt to connect to the host is in progress.");
break;
case QHttp::Sending:
qDebug("The client is sending its request to the server.");
break;
case QHttp::Reading:
qDebug("The client's request has been sent and the client is reading the server's response.");
break;
case QHttp::Connected:
qDebug("The connection to the host is open, but the client is neither sending a request, nor waiting for a response.");
break;
case QHttp::Closing:
qDebug("The connection is closing down, but is not yet closed. (The state will be Unconnected when the connection is closed.");
break;
}
}
*/
void frmMain::lastFmHandShake()
{
qDebug("lastFmHandShake()");
delete lfmBuffer;
lfmBuffer = new QBuffer;
if (!lfmServer)
lfmServer = new QHttp("post.audioscrobbler.com");
else
{
lfmServer->disconnect();
lfmServer->abort();
}
connect(lfmServer, SIGNAL(done(bool)), this, SLOT(lastFmResolved(bool)));
connect(lfmServer, SIGNAL(stateChanged(int)), this, SLOT(lastFmServerStatus(int)));
lfmServer->get(
QString("/?hs=true&p=1.1&c=%1&v=%2&u=%3")
.arg("fap")
.arg("0.1")
.arg(lfmUser),
lfmBuffer);
}
/*
void frmMain::lastFmServerStatus(int i)
{
switch (i)
{
case QHttp::Unconnected:
qDebug("There is no connection to the host");
break;
case QHttp::HostLookup:
qDebug("A host name lookup is in progress.");
break;
case QHttp::Connecting:
qDebug("An attempt to connect to the host is in progress.");
break;
case QHttp::Sending:
qDebug("The client is sending its request to the server.");
break;
case QHttp::Reading:
qDebug("The client's request has been sent and the client is reading the server's response.");
break;
case QHttp::Connected:
qDebug("The connection to the host is open, but the client is neither sending a request, nor waiting for a response.");
break;
case QHttp::Closing:
qDebug("The connection is closing down, but is not yet closed. (The state will be Unconnected when the connection is closed.");
break;
}
}
*/
To copy to clipboard, switch view to plain text mode
Bookmarks