run make format

This commit is contained in:
Arnaud Bienner 2015-01-14 22:55:20 +01:00
parent 7039c2a2bf
commit e1139e731f
5 changed files with 38 additions and 30 deletions

View File

@ -372,7 +372,8 @@ void SpotifyClient::PlaylistContainerLoadedCallback(sp_playlistcontainer* pc,
SpotifyClient* me = reinterpret_cast<SpotifyClient*>(userdata);
// Install callbacks on all the playlists
sp_playlist_add_callbacks(sp_session_starred_create(me->session_), &me->get_playlists_callbacks_, me);
sp_playlist_add_callbacks(sp_session_starred_create(me->session_),
&me->get_playlists_callbacks_, me);
const int count = sp_playlistcontainer_num_playlists(pc);
for (int i = 0; i < count; ++i) {
sp_playlist* playlist = sp_playlistcontainer_playlist(pc, i);
@ -612,10 +613,11 @@ void SpotifyClient::PlaylistStateChangedForGetPlaylists(sp_playlist* pl,
void SpotifyClient::AddTracksToPlaylist(
const pb::spotify::AddTracksToPlaylistRequest& req) {
// Get the playlist we want to update
sp_playlist* playlist = GetPlaylist(req.playlist_type(), req.playlist_index());
sp_playlist* playlist =
GetPlaylist(req.playlist_type(), req.playlist_index());
if (!playlist) {
qLog(Error) << "Playlist " << req.playlist_type() << "," <<
req.playlist_index() << "not found";
qLog(Error) << "Playlist " << req.playlist_type() << ","
<< req.playlist_index() << "not found";
return;
}
@ -653,8 +655,8 @@ void SpotifyClient::RemoveTracksFromPlaylist(
sp_playlist* playlist =
GetPlaylist(req.playlist_type(), req.playlist_index());
if (!playlist) {
qLog(Error) << "Playlist " << req.playlist_type() << "," <<
req.playlist_index() << "not found";
qLog(Error) << "Playlist " << req.playlist_type() << ","
<< req.playlist_index() << "not found";
return;
}

View File

@ -219,9 +219,9 @@ void SpotifyServer::AddSongsToUserPlaylist(int playlist_index,
AddSongsToPlaylist(pb::spotify::UserPlaylist, songs_urls, playlist_index);
}
void SpotifyServer::AddSongsToPlaylist(const pb::spotify::PlaylistType playlist_type,
const QList<QUrl>& songs_urls,
int playlist_index) {
void SpotifyServer::AddSongsToPlaylist(
const pb::spotify::PlaylistType playlist_type,
const QList<QUrl>& songs_urls, int playlist_index) {
pb::spotify::Message message;
pb::spotify::AddTracksToPlaylistRequest* req =
message.mutable_add_tracks_to_playlist();
@ -233,13 +233,15 @@ void SpotifyServer::AddSongsToPlaylist(const pb::spotify::PlaylistType playlist_
SendOrQueueMessage(message);
}
void SpotifyServer::RemoveSongsFromStarred(const QList<int>& songs_indices_to_remove) {
void SpotifyServer::RemoveSongsFromStarred(
const QList<int>& songs_indices_to_remove) {
RemoveSongsFromPlaylist(pb::spotify::Starred, songs_indices_to_remove);
}
void SpotifyServer::RemoveSongsFromUserPlaylist(int playlist_index,
const QList<int>& songs_indices_to_remove) {
RemoveSongsFromPlaylist(pb::spotify::UserPlaylist, songs_indices_to_remove, playlist_index);
void SpotifyServer::RemoveSongsFromUserPlaylist(
int playlist_index, const QList<int>& songs_indices_to_remove) {
RemoveSongsFromPlaylist(pb::spotify::UserPlaylist, songs_indices_to_remove,
playlist_index);
}
void SpotifyServer::RemoveSongsFromPlaylist(

View File

@ -48,7 +48,8 @@ class SpotifyServer : public AbstractMessageHandler<pb::spotify::Message> {
void LoadUserPlaylist(int index);
void SyncUserPlaylist(int index);
void AddSongsToStarred(const QList<QUrl>& songs_urls);
void AddSongsToUserPlaylist(int playlist_index, const QList<QUrl>& songs_urls);
void AddSongsToUserPlaylist(int playlist_index,
const QList<QUrl>& songs_urls);
void RemoveSongsFromUserPlaylist(int playlist_index,
const QList<int>& songs_indices_to_remove);
void RemoveSongsFromStarred(const QList<int>& songs_indices_to_remove);

View File

@ -471,7 +471,8 @@ void SpotifyService::PlaylistsUpdated(const pb::spotify::Playlists& response) {
item->setData(msg.is_mine(), InternetModel::Role_CanBeModified);
item->setData(InternetModel::PlayBehaviour_MultipleItems,
InternetModel::Role_PlayBehaviour);
item->setData(QUrl(QStringFromStdString(msg.uri())), InternetModel::Role_Url);
item->setData(QUrl(QStringFromStdString(msg.uri())),
InternetModel::Role_Url);
root_->appendRow(item);
playlists_ << item;
@ -605,8 +606,8 @@ QList<QAction*> SpotifyService::playlistitem_actions(const Song& song) {
delete action;
}
QAction* add_to_starred = new QAction(QIcon(":/star-on.png"),
tr("Add to Spotify starred"), this);
QAction* add_to_starred =
new QAction(QIcon(":/star-on.png"), tr("Add to Spotify starred"), this);
connect(add_to_starred, SIGNAL(triggered()),
SLOT(AddCurrentSongToStarredPlaylist()));
playlistitem_actions_.append(add_to_starred);
@ -660,9 +661,9 @@ void SpotifyService::EnsureMenuCreated() {
playlist_sync_action_ = playlist_context_menu_->addAction(
IconLoader::Load("view-refresh"), tr("Make playlist available offline"),
this, SLOT(SyncPlaylist()));
get_url_to_share_playlist_ =
playlist_context_menu_->addAction(tr("Get a URL to share this playlist"),
this, SLOT(GetCurrentPlaylistUrlToShare()));
get_url_to_share_playlist_ = playlist_context_menu_->addAction(
tr("Get a URL to share this playlist"), this,
SLOT(GetCurrentPlaylistUrlToShare()));
playlist_context_menu_->addSeparator();
playlist_context_menu_->addAction(GetNewShowConfigAction());
@ -798,7 +799,8 @@ void SpotifyService::ShowContextMenu(const QPoint& global_pos) {
playlist_sync_action_->setData(qVariantFromValue(item));
playlist_context_menu_->popup(global_pos);
current_playlist_url_ = item->data(InternetModel::Role_Url).toUrl();
get_url_to_share_playlist_->setVisible(type == InternetModel::Type_UserPlaylist);
get_url_to_share_playlist_->setVisible(type ==
InternetModel::Type_UserPlaylist);
return;
} else if (type == InternetModel::Type_Track) {
current_song_url_ = item->data(InternetModel::Role_Url).toUrl();

View File

@ -112,7 +112,8 @@ class SpotifyService : public InternetService {
const google::protobuf::RepeatedPtrField<pb::spotify::Track>& tracks);
void FillPlaylist(QStandardItem* item,
const pb::spotify::LoadPlaylistResponse& response);
void AddSongsToUserPlaylist(int playlist_index, const QList<QUrl>& songs_urls);
void AddSongsToUserPlaylist(int playlist_index,
const QList<QUrl>& songs_urls);
void AddSongsToStarred(const QList<QUrl>& songs_urls);
void EnsureMenuCreated();
// Create a new "show config" action. The caller is responsible for deleting