void AtticaManager::uploadRating( const Content& c ) { m_resolverStates[ c.id() ].userRating = c.rating(); for ( int i = 0; i < m_resolvers.count(); i++ ) { if ( m_resolvers[ i ].id() == c.id() ) { Attica::Content atticaContent = m_resolvers[ i ]; atticaContent.setRating( c.rating() ); m_resolvers[ i ] = atticaContent; break; } } TomahawkSettings::instance()->setAtticaResolverStates( m_resolverStates ); PostJob* job = m_resolverProvider.voteForContent( c.id(), (uint)c.rating() ); connect( job, SIGNAL( finished( Attica::BaseJob* ) ), job, SLOT( deleteLater() ) ); job->start(); emit resolverStateChanged( c.id() ); }
PostJob* Provider::postInvitation(const QString& to, const QString& message) { PostJob *job = new PostJob(); KUrl url = createUrl( "friend/outbox/" + to ); job->setUrl( url ); job->setData( "message", message ); job->start(); return job; }
PostJob* Provider::postActivity(const QString& message) { PostJob *job = new PostJob(); KUrl url = createUrl( "activity" ); job->setUrl( url ); job->setData( "message", message ); job->start(); return job; }
PostJob* Provider::postLocation(qreal latitude, qreal longitude, const QString& city, const QString& country) { PostJob *job = new PostJob(); KUrl url = createUrl( "person/self" ); job->setUrl( url ); job->setData( "latitude", QString("%1").arg(latitude) ); job->setData( "longitude", QString("%1").arg(longitude) ); job->setData( "city", city ); job->setData( "country", country ); job->start(); return job; }
PostJob* Provider::postMessage( const Message &message ) { PostJob *job = new PostJob(); KUrl url = createUrl( "message/2" ); job->setUrl( url ); job->setData( "message", message.body() ); job->setData( "subject", message.subject() ); job->setData( "to", message.to() ); job->start(); return job; }