From e1139e731f46794ac9992afd1cf153ade0146abd Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Wed, 14 Jan 2015 22:55:20 +0100 Subject: [PATCH] run make format --- ext/clementine-spotifyblob/spotifyclient.cpp | 14 ++++++----- src/internet/spotify/spotifyserver.cpp | 16 ++++++------ src/internet/spotify/spotifyserver.h | 5 ++-- src/internet/spotify/spotifyservice.cpp | 26 +++++++++++--------- src/internet/spotify/spotifyservice.h | 7 +++--- 5 files changed, 38 insertions(+), 30 deletions(-) diff --git a/ext/clementine-spotifyblob/spotifyclient.cpp b/ext/clementine-spotifyblob/spotifyclient.cpp index 87e6bc6607..d9135bbc51 100644 --- a/ext/clementine-spotifyblob/spotifyclient.cpp +++ b/ext/clementine-spotifyblob/spotifyclient.cpp @@ -372,7 +372,8 @@ void SpotifyClient::PlaylistContainerLoadedCallback(sp_playlistcontainer* pc, SpotifyClient* me = reinterpret_cast(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; } diff --git a/src/internet/spotify/spotifyserver.cpp b/src/internet/spotify/spotifyserver.cpp index ff56bdbbc2..3bdf4d8cdd 100644 --- a/src/internet/spotify/spotifyserver.cpp +++ b/src/internet/spotify/spotifyserver.cpp @@ -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& songs_urls, - int playlist_index) { +void SpotifyServer::AddSongsToPlaylist( + const pb::spotify::PlaylistType playlist_type, + const QList& 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& songs_indices_to_remove) { +void SpotifyServer::RemoveSongsFromStarred( + const QList& songs_indices_to_remove) { RemoveSongsFromPlaylist(pb::spotify::Starred, songs_indices_to_remove); } -void SpotifyServer::RemoveSongsFromUserPlaylist(int playlist_index, - const QList& songs_indices_to_remove) { - RemoveSongsFromPlaylist(pb::spotify::UserPlaylist, songs_indices_to_remove, playlist_index); +void SpotifyServer::RemoveSongsFromUserPlaylist( + int playlist_index, const QList& songs_indices_to_remove) { + RemoveSongsFromPlaylist(pb::spotify::UserPlaylist, songs_indices_to_remove, + playlist_index); } void SpotifyServer::RemoveSongsFromPlaylist( diff --git a/src/internet/spotify/spotifyserver.h b/src/internet/spotify/spotifyserver.h index 9e2731e471..518d3273bb 100644 --- a/src/internet/spotify/spotifyserver.h +++ b/src/internet/spotify/spotifyserver.h @@ -48,7 +48,8 @@ class SpotifyServer : public AbstractMessageHandler { void LoadUserPlaylist(int index); void SyncUserPlaylist(int index); void AddSongsToStarred(const QList& songs_urls); - void AddSongsToUserPlaylist(int playlist_index, const QList& songs_urls); + void AddSongsToUserPlaylist(int playlist_index, + const QList& songs_urls); void RemoveSongsFromUserPlaylist(int playlist_index, const QList& songs_indices_to_remove); void RemoveSongsFromStarred(const QList& songs_indices_to_remove); @@ -67,7 +68,7 @@ class SpotifyServer : public AbstractMessageHandler { void StartPlayback(const QString& uri, quint16 port); void Seek(qint64 offset_nsec); - signals: +signals: void LoginCompleted(bool success, const QString& error, pb::spotify::LoginResponse_Error error_code); void PlaylistsUpdated(const pb::spotify::Playlists& playlists); diff --git a/src/internet/spotify/spotifyservice.cpp b/src/internet/spotify/spotifyservice.cpp index f57f8d0690..acc052a13b 100644 --- a/src/internet/spotify/spotifyservice.cpp +++ b/src/internet/spotify/spotifyservice.cpp @@ -380,7 +380,7 @@ void SpotifyService::AddCurrentSongToUserPlaylist(QAction* action) { } void SpotifyService::AddSongsToUserPlaylist(int playlist_index, - const QList& songs_urls) { + const QList& songs_urls) { EnsureServerCreated(); server_->AddSongsToUserPlaylist(playlist_index, songs_urls); } @@ -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 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()); @@ -671,7 +672,7 @@ void SpotifyService::EnsureMenuCreated() { IconLoader::Load("list-remove"), tr("Remove from playlist"), this, SLOT(RemoveCurrentFromPlaylist())); song_context_menu_->addAction(tr("Get a URL to share this Spotify song"), - this, SLOT(GetCurrentSongUrlToShare())); + this, SLOT(GetCurrentSongUrlToShare())); song_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(); @@ -829,7 +831,7 @@ void SpotifyService::GetCurrentPlaylistUrlToShare() const { // URLs we use can be opened with Spotify application, but I believe it's // better to give website links instead. url.replace(QRegExp("spotify:user:([^:]*):playlist:([^:]*)"), - "https://play.spotify.com/user/\\1/playlist/\\2"); + "https://play.spotify.com/user/\\1/playlist/\\2"); InternetService::ShowUrlBox(tr("Spotify playlist's URL"), url); } @@ -915,8 +917,8 @@ void SpotifyService::RemoveCurrentFromPlaylist() { Type_StarredPlaylist) { is_starred = true; } else if (index.parent().data(InternetModel::Role_Type).toInt() != - InternetModel::Type_UserPlaylist) { - continue; + InternetModel::Type_UserPlaylist) { + continue; } if (index.data(InternetModel::Role_Type).toInt() != diff --git a/src/internet/spotify/spotifyservice.h b/src/internet/spotify/spotifyservice.h index 1deaae7be0..da60dbf0f7 100644 --- a/src/internet/spotify/spotifyservice.h +++ b/src/internet/spotify/spotifyservice.h @@ -95,7 +95,7 @@ class SpotifyService : public InternetService { static void SongFromProtobuf(const pb::spotify::Track& track, Song* song); - signals: +signals: void BlobStateChanged(); void LoginFinished(bool success); void ImageLoaded(const QString& id, const QImage& image); @@ -112,7 +112,8 @@ class SpotifyService : public InternetService { const google::protobuf::RepeatedPtrField& tracks); void FillPlaylist(QStandardItem* item, const pb::spotify::LoadPlaylistResponse& response); - void AddSongsToUserPlaylist(int playlist_index, const QList& songs_urls); + void AddSongsToUserPlaylist(int playlist_index, + const QList& songs_urls); void AddSongsToStarred(const QList& songs_urls); void EnsureMenuCreated(); // Create a new "show config" action. The caller is responsible for deleting @@ -133,7 +134,7 @@ class SpotifyService : public InternetService { void AddCurrentSongToUserPlaylist(QAction* action); void AddCurrentSongToStarredPlaylist(); void RemoveSongsFromUserPlaylist(int playlist_index, - const QList& songs_indices_to_remove); + const QList& songs_indices_to_remove); void RemoveSongsFromStarred(const QList& songs_indices_to_remove); void PlaylistsUpdated(const pb::spotify::Playlists& response); void InboxLoaded(const pb::spotify::LoadPlaylistResponse& response);