From c680c55379fbc986d04d3de9bd8731c33a9afabd Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 4 Feb 2011 11:17:31 +0000 Subject: [PATCH] Fix a couple of warnings found by Clang. --- src/playlist/playlistmanager.cpp | 5 +++++ src/playlist/playlistmanager.h | 2 +- src/ui/settingsdialog.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/playlist/playlistmanager.cpp b/src/playlist/playlistmanager.cpp index c3aa16761..f3d63fce8 100644 --- a/src/playlist/playlistmanager.cpp +++ b/src/playlist/playlistmanager.cpp @@ -80,6 +80,11 @@ const QList PlaylistManager::GetAllPlaylists() const { return result; } +const QItemSelection& PlaylistManager::selection(int id) const { + QMap::const_iterator it = playlists_.find(id); + return it->selection; +} + Playlist* PlaylistManager::AddPlaylist(int id, const QString& name) { Playlist* ret = new Playlist(playlist_backend_, task_manager_, library_backend_, id); ret->set_sequence(sequence_); diff --git a/src/playlist/playlistmanager.h b/src/playlist/playlistmanager.h index 6a3961675..42583afa8 100644 --- a/src/playlist/playlistmanager.h +++ b/src/playlist/playlistmanager.h @@ -52,7 +52,7 @@ public: // Returns the collection of playlists managed by this PlaylistManager. const QList GetAllPlaylists() const; - const QItemSelection& selection(int id) const { return playlists_[id].selection; } + const QItemSelection& selection(int id) const; const QItemSelection& current_selection() const { return selection(current_id()); } const QItemSelection& active_selection() const { return selection(active_id()); } diff --git a/src/ui/settingsdialog.cpp b/src/ui/settingsdialog.cpp index f58f68f74..78a5eb490 100644 --- a/src/ui/settingsdialog.cpp +++ b/src/ui/settingsdialog.cpp @@ -282,7 +282,7 @@ void SettingsDialog::accept() { QSettings s; // Behaviour - MainWindow::StartupBehaviour behaviour; + MainWindow::StartupBehaviour behaviour = MainWindow::Startup_Remember; if (ui_->b_always_hide_->isChecked()) behaviour = MainWindow::Startup_AlwaysHide; if (ui_->b_always_show_->isChecked()) behaviour = MainWindow::Startup_AlwaysShow; if (ui_->b_remember_->isChecked()) behaviour = MainWindow::Startup_Remember;