Canary commit for various c++11 features.

* range-based for loops
* auto
* unique_ptr
This commit is contained in:
John Maguire 2014-01-07 17:28:46 +01:00
parent 20b15a17eb
commit 1ef3c53629
2 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,8 @@
#include "internetservice.h" #include "internetservice.h"
#include <memory>
#include <QMenu> #include <QMenu>
#include "core/tagreaderclient.h" #include "core/tagreaderclient.h"
@ -61,8 +63,8 @@ class CloudFileService : public InternetService {
LibraryModel* library_model_; LibraryModel* library_model_;
QSortFilterProxyModel* library_sort_model_; QSortFilterProxyModel* library_sort_model_;
boost::scoped_ptr<QMenu> context_menu_; std::unique_ptr<QMenu> context_menu_;
boost::scoped_ptr<AlbumCoverManager> cover_manager_; std::unique_ptr<AlbumCoverManager> cover_manager_;
PlaylistManager* playlist_manager_; PlaylistManager* playlist_manager_;
TaskManager* task_manager_; TaskManager* task_manager_;

View File

@ -99,12 +99,12 @@ void SpotifyServer::SetPlaybackSettings(pb::spotify::Bitrate bitrate, bool volum
void SpotifyServer::MessageArrived(const pb::spotify::Message& message) { void SpotifyServer::MessageArrived(const pb::spotify::Message& message) {
if (message.has_login_response()) { if (message.has_login_response()) {
const pb::spotify::LoginResponse& response = message.login_response(); const auto& response = message.login_response();
logged_in_ = response.success(); logged_in_ = response.success();
if (response.success()) { if (response.success()) {
// Send any messages that were queued before the client logged in // Send any messages that were queued before the client logged in
foreach (const pb::spotify::Message& message, queued_messages_) { for (const pb::spotify::Message& message : queued_messages_) {
SendOrQueueMessage(message); SendOrQueueMessage(message);
} }
queued_messages_.clear(); queued_messages_.clear();