fix shadow warnings

This commit is contained in:
Andrzej Rybczak
2014-11-03 00:59:52 +01:00
parent 202a21c4b3
commit 24de827f8b
6 changed files with 37 additions and 37 deletions

View File

@@ -254,7 +254,7 @@ void setWindowsDimensions()
void confirmAction(const boost::format &description) void confirmAction(const boost::format &description)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << description.str() Statusbar::put() << description.str()
<< " [" << NC::Format::Bold << 'y' << NC::Format::NoBold << " [" << NC::Format::Bold << 'y' << NC::Format::NoBold
<< '/' << NC::Format::Bold << 'n' << NC::Format::NoBold << '/' << NC::Format::Bold << 'n' << NC::Format::NoBold
@@ -781,7 +781,7 @@ void SavePlaylist::run()
std::string playlist_name; std::string playlist_name;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Save playlist as: "; Statusbar::put() << "Save playlist as: ";
playlist_name = wFooter->prompt(); playlist_name = wFooter->prompt();
} }
@@ -828,7 +828,7 @@ void ExecuteCommand::run()
std::string cmd_name; std::string cmd_name;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
NC::Window::ScopedPromptHook helper(*wFooter, NC::Window::ScopedPromptHook helper(*wFooter,
Statusbar::Helpers::TryExecuteImmediateCommand() Statusbar::Helpers::TryExecuteImmediateCommand()
); );
@@ -953,7 +953,7 @@ void Add::run()
std::string path; std::string path;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << (myScreen == myPlaylistEditor ? "Add to playlist: " : "Add: "); Statusbar::put() << (myScreen == myPlaylistEditor ? "Add to playlist: " : "Add: ");
path = wFooter->prompt(); path = wFooter->prompt();
} }
@@ -1259,7 +1259,7 @@ void SetCrossfade::run()
{ {
using Global::wFooter; using Global::wFooter;
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Set crossfade to: "; Statusbar::put() << "Set crossfade to: ";
auto crossfade = fromString<unsigned>(wFooter->prompt()); auto crossfade = fromString<unsigned>(wFooter->prompt());
lowerBoundCheck(crossfade, 0u); lowerBoundCheck(crossfade, 0u);
@@ -1273,7 +1273,7 @@ void SetVolume::run()
unsigned volume; unsigned volume;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Set volume to: "; Statusbar::put() << "Set volume to: ";
volume = fromString<unsigned>(wFooter->prompt()); volume = fromString<unsigned>(wFooter->prompt());
boundsCheck(volume, 0u, 100u); boundsCheck(volume, 0u, 100u);
@@ -1319,7 +1319,7 @@ void EditLibraryTag::run()
std::string new_tag; std::string new_tag;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << tagTypeToString(Config.media_lib_primary_tag) << NC::Format::NoBold << ": "; Statusbar::put() << NC::Format::Bold << tagTypeToString(Config.media_lib_primary_tag) << NC::Format::NoBold << ": ";
new_tag = wFooter->prompt(myLibrary->Tags.current().value().tag()); new_tag = wFooter->prompt(myLibrary->Tags.current().value().tag());
} }
@@ -1378,7 +1378,7 @@ void EditLibraryAlbum::run()
// FIXME: merge this and EditLibraryTag. also, prompt on failure if user wants to continue // FIXME: merge this and EditLibraryTag. also, prompt on failure if user wants to continue
std::string new_album; std::string new_album;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << "Album: " << NC::Format::NoBold; Statusbar::put() << NC::Format::Bold << "Album: " << NC::Format::NoBold;
new_album = wFooter->prompt(myLibrary->Albums.current().value().entry().album()); new_album = wFooter->prompt(myLibrary->Albums.current().value().entry().album());
} }
@@ -1437,7 +1437,7 @@ void EditDirectoryName::run()
{ {
std::string old_dir = myBrowser->main().current().value().directory().path(), new_dir; std::string old_dir = myBrowser->main().current().value().directory().path(), new_dir;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << "Directory: " << NC::Format::NoBold; Statusbar::put() << NC::Format::Bold << "Directory: " << NC::Format::NoBold;
new_dir = wFooter->prompt(old_dir); new_dir = wFooter->prompt(old_dir);
} }
@@ -1472,7 +1472,7 @@ void EditDirectoryName::run()
{ {
std::string old_dir = myTagEditor->Dirs->current().value().first, new_dir; std::string old_dir = myTagEditor->Dirs->current().value().first, new_dir;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << "Directory: " << NC::Format::NoBold; Statusbar::put() << NC::Format::Bold << "Directory: " << NC::Format::NoBold;
new_dir = wFooter->prompt(old_dir); new_dir = wFooter->prompt(old_dir);
} }
@@ -1514,7 +1514,7 @@ void EditPlaylistName::run()
else else
old_name = myBrowser->main().current().value().playlist().path(); old_name = myBrowser->main().current().value().playlist().path();
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << "Playlist: " << NC::Format::NoBold; Statusbar::put() << NC::Format::Bold << "Playlist: " << NC::Format::NoBold;
new_name = wFooter->prompt(old_name); new_name = wFooter->prompt(old_name);
} }
@@ -1586,7 +1586,7 @@ void ToggleScreenLock::run()
unsigned part = Config.locked_screen_width_part*100; unsigned part = Config.locked_screen_width_part*100;
if (Config.ask_for_locked_screen_width_part) if (Config.ask_for_locked_screen_width_part)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "% of the locked screen's width to be reserved (20-80): "; Statusbar::put() << "% of the locked screen's width to be reserved (20-80): ";
part = fromString<unsigned>(wFooter->prompt(boost::lexical_cast<std::string>(part))); part = fromString<unsigned>(wFooter->prompt(boost::lexical_cast<std::string>(part)));
} }
@@ -1630,7 +1630,7 @@ void JumpToPositionInSong::run()
std::string spos; std::string spos;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Position to go (in %/m:ss/seconds(s)): "; Statusbar::put() << "Position to go (in %/m:ss/seconds(s)): ";
spos = wFooter->prompt(); spos = wFooter->prompt();
} }
@@ -1844,7 +1844,7 @@ void ApplyFilter::run()
try try
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
NC::Window::ScopedPromptHook helper(*wFooter, NC::Window::ScopedPromptHook helper(*wFooter,
Statusbar::Helpers::ApplyFilterImmediately(f, filter) Statusbar::Helpers::ApplyFilterImmediately(f, filter)
); );
@@ -1895,7 +1895,7 @@ void Find::run()
std::string token; std::string token;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Find: "; Statusbar::put() << "Find: ";
token = wFooter->prompt(); token = wFooter->prompt();
} }
@@ -1972,7 +1972,7 @@ void ToggleReplayGainMode::run()
char rgm = 0; char rgm = 0;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Replay gain mode? " Statusbar::put() << "Replay gain mode? "
<< "[" << NC::Format::Bold << 'o' << NC::Format::NoBold << "ff" << "[" << NC::Format::Bold << 'o' << NC::Format::NoBold << "ff"
<< "/" << NC::Format::Bold << 't' << NC::Format::NoBold << "rack" << "/" << NC::Format::Bold << 't' << NC::Format::NoBold << "rack"
@@ -2044,7 +2044,7 @@ void AddRandomItems::run()
using Global::wFooter; using Global::wFooter;
char rnd_type = 0; char rnd_type = 0;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Add random? " Statusbar::put() << "Add random? "
<< "[" << NC::Format::Bold << 's' << NC::Format::NoBold << "ongs" << "[" << NC::Format::Bold << 's' << NC::Format::NoBold << "ongs"
<< "/" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtists" << "/" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtists"
@@ -2065,7 +2065,7 @@ void AddRandomItems::run()
unsigned number; unsigned number;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Number of random " << tag_type_str << "s: "; Statusbar::put() << "Number of random " << tag_type_str << "s: ";
number = fromString<unsigned>(wFooter->prompt()); number = fromString<unsigned>(wFooter->prompt());
} }
@@ -2125,7 +2125,7 @@ void ToggleLibraryTagType::run()
char tag_type = 0; char tag_type = 0;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Tag type? " Statusbar::put() << "Tag type? "
<< "[" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtist" << "[" << NC::Format::Bold << 'a' << NC::Format::NoBold << "rtist"
<< "/" << "album" << NC::Format::Bold << 'A' << NC::Format::NoBold << "rtist" << "/" << "album" << NC::Format::Bold << 'A' << NC::Format::NoBold << "rtist"
@@ -2206,7 +2206,7 @@ void SetSelectedItemsPriority::run()
unsigned prio; unsigned prio;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Set priority [0-255]: "; Statusbar::put() << "Set priority [0-255]: ";
prio = fromString<unsigned>(wFooter->prompt()); prio = fromString<unsigned>(wFooter->prompt());
boundsCheck(prio, 0u, 255u); boundsCheck(prio, 0u, 255u);
@@ -2230,7 +2230,7 @@ void SetVisualizerSampleMultiplier::run()
double multiplier; double multiplier;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Set visualizer sample multiplier: "; Statusbar::put() << "Set visualizer sample multiplier: ";
multiplier = fromString<double>(wFooter->prompt()); multiplier = fromString<double>(wFooter->prompt());
lowerBoundCheck(multiplier, 0.0); lowerBoundCheck(multiplier, 0.0);
@@ -2251,7 +2251,7 @@ void FilterPlaylistOnPriorities::run()
unsigned prio; unsigned prio;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Show songs with priority higher than: "; Statusbar::put() << "Show songs with priority higher than: ";
prio = fromString<unsigned>(wFooter->prompt()); prio = fromString<unsigned>(wFooter->prompt());
boundsCheck(prio, 0u, 255u); boundsCheck(prio, 0u, 255u);
@@ -2803,7 +2803,7 @@ void findItem(const Find direction)
std::string token; std::string token;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Find " << (direction == Find::Forward ? "forward" : "backward") << ": "; Statusbar::put() << "Find " << (direction == Find::Forward ? "forward" : "backward") << ": ";
token = wFooter->prompt(); token = wFooter->prompt();
} }

View File

@@ -131,8 +131,8 @@ struct Directory
m_path = mpd_directory_get_path(directory); m_path = mpd_directory_get_path(directory);
m_last_modified = mpd_directory_get_last_modified(directory); m_last_modified = mpd_directory_get_last_modified(directory);
} }
Directory(std::string path, time_t last_modified = 0) Directory(std::string path_, time_t last_modified = 0)
: m_path(std::move(path)) : m_path(std::move(path_))
, m_last_modified(last_modified) , m_last_modified(last_modified)
{ } { }
@@ -171,8 +171,8 @@ struct Playlist
m_path = mpd_playlist_get_path(playlist); m_path = mpd_playlist_get_path(playlist);
m_last_modified = mpd_playlist_get_last_modified(playlist); m_last_modified = mpd_playlist_get_last_modified(playlist);
} }
Playlist(std::string path, time_t last_modified = 0) Playlist(std::string path_, time_t last_modified = 0)
: m_path(std::move(path)) : m_path(std::move(path_))
, m_last_modified(last_modified) , m_last_modified(last_modified)
{ {
if (m_path.empty()) if (m_path.empty())
@@ -339,8 +339,8 @@ struct Iterator: std::iterator<std::input_iterator_tag, ObjectT>
typedef std::function<bool(State &)> Fetcher; typedef std::function<bool(State &)> Fetcher;
State(mpd_connection *connection, Fetcher fetcher) State(mpd_connection *connection_, Fetcher fetcher)
: m_connection(connection) : m_connection(connection_)
, m_fetcher(fetcher) , m_fetcher(fetcher)
{ {
assert(m_connection != nullptr); assert(m_connection != nullptr);

View File

@@ -155,7 +155,7 @@ void SearchEngine::enterPressed()
if (option < ConstraintsNumber) if (option < ConstraintsNumber)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
std::string constraint = ConstraintsNames[option]; std::string constraint = ConstraintsNames[option];
Statusbar::put() << NC::Format::Bold << constraint << NC::Format::NoBold << ": "; Statusbar::put() << NC::Format::Bold << constraint << NC::Format::NoBold << ": ";
itsConstraints[option] = Global::wFooter->prompt(itsConstraints[option]); itsConstraints[option] = Global::wFooter->prompt(itsConstraints[option]);

View File

@@ -226,7 +226,7 @@ void SelectedItemsAdder::addToNewPlaylist() const
{ {
std::string playlist; std::string playlist;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Save playlist as: "; Statusbar::put() << "Save playlist as: ";
playlist = Global::wFooter->prompt(); playlist = Global::wFooter->prompt();
} }

View File

@@ -359,7 +359,7 @@ void TagEditor::enterPressed()
{ {
std::string new_pattern; std::string new_pattern;
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << "Pattern: "; Statusbar::put() << "Pattern: ";
new_pattern = wFooter->prompt(Config.pattern); new_pattern = wFooter->prompt(Config.pattern);
} }
@@ -488,7 +488,7 @@ void TagEditor::enterPressed()
MPD::MutableSong::SetFunction set = SongInfo::Tags[id].Set; MPD::MutableSong::SetFunction set = SongInfo::Tags[id].Set;
if (id > 0 && w == TagTypes) if (id > 0 && w == TagTypes)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << TagTypes->current().value() << NC::Format::NoBold << ": "; Statusbar::put() << NC::Format::Bold << TagTypes->current().value() << NC::Format::NoBold << ": ";
std::string new_tag = wFooter->prompt(Tags->current().value().getTags(get, Config.tags_separator)); std::string new_tag = wFooter->prompt(Tags->current().value().getTags(get, Config.tags_separator));
for (auto it = EditedSongs.begin(); it != EditedSongs.end(); ++it) for (auto it = EditedSongs.begin(); it != EditedSongs.end(); ++it)
@@ -496,7 +496,7 @@ void TagEditor::enterPressed()
} }
else if (w == Tags) else if (w == Tags)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << TagTypes->current().value() << NC::Format::NoBold << ": "; Statusbar::put() << NC::Format::Bold << TagTypes->current().value() << NC::Format::NoBold << ": ";
std::string new_tag = wFooter->prompt(Tags->current().value().getTags(get, Config.tags_separator)); std::string new_tag = wFooter->prompt(Tags->current().value().getTags(get, Config.tags_separator));
if (new_tag != Tags->current().value().getTags(get, Config.tags_separator)) if (new_tag != Tags->current().value().getTags(get, Config.tags_separator))
@@ -515,7 +515,7 @@ void TagEditor::enterPressed()
} }
else if (w == Tags) else if (w == Tags)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
MPD::MutableSong &s = Tags->current().value(); MPD::MutableSong &s = Tags->current().value();
std::string old_name = s.getNewName().empty() ? s.getName() : s.getNewName(); std::string old_name = s.getNewName().empty() ? s.getName() : s.getNewName();
size_t last_dot = old_name.rfind("."); size_t last_dot = old_name.rfind(".");

View File

@@ -103,7 +103,7 @@ void TinyTagEditor::enterPressed()
size_t option = w.choice(); size_t option = w.choice();
if (option < 19) // separator after comment if (option < 19) // separator after comment
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
size_t pos = option-8; size_t pos = option-8;
Statusbar::put() << NC::Format::Bold << SongInfo::Tags[pos].Name << ": " << NC::Format::NoBold; Statusbar::put() << NC::Format::Bold << SongInfo::Tags[pos].Name << ": " << NC::Format::NoBold;
itsEdited.setTags(SongInfo::Tags[pos].Set, Global::wFooter->prompt( itsEdited.setTags(SongInfo::Tags[pos].Set, Global::wFooter->prompt(
@@ -114,7 +114,7 @@ void TinyTagEditor::enterPressed()
} }
else if (option == 20) else if (option == 20)
{ {
Statusbar::ScopedLock lock; Statusbar::ScopedLock slock;
Statusbar::put() << NC::Format::Bold << "Filename: " << NC::Format::NoBold; Statusbar::put() << NC::Format::Bold << "Filename: " << NC::Format::NoBold;
std::string filename = itsEdited.getNewName().empty() ? itsEdited.getName() : itsEdited.getNewName(); std::string filename = itsEdited.getNewName().empty() ? itsEdited.getName() : itsEdited.getNewName();
size_t dot = filename.rfind("."); size_t dot = filename.rfind(".");