fix shadow warnings

This commit is contained in:
Andrzej Rybczak
2012-10-06 19:33:20 +02:00
parent 843c2b76e6
commit ab1476caa8
2 changed files with 11 additions and 11 deletions

View File

@@ -661,11 +661,11 @@ void DeleteBrowserItems::run()
else
{
MPD::Item &item = myBrowser->main().current().value();
std::string name = item.type == MPD::itSong ? item.song->getName() : item.name;
std::string iname = item.type == MPD::itSong ? item.song->getName() : item.name;
question = "Delete ";
question += itemTypeToString(item.type);
question += " \"";
question += ToString(wideShorten(ToWString(name), COLS-question.size()-10));
question += ToString(wideShorten(ToWString(iname), COLS-question.size()-10));
question += "\"?";
}
bool yes = askYesNoQuestion(question, Status::trace);
@@ -676,16 +676,16 @@ void DeleteBrowserItems::run()
for (auto it = list.begin(); it != list.end(); ++it)
{
const MPD::Item &i = (*it)->value();
std::string name = i.type == MPD::itSong ? i.song->getName() : i.name;
std::string iname = i.type == MPD::itSong ? i.song->getName() : i.name;
if (myBrowser->deleteItem(i))
{
const char msg[] = "\"%ls\" deleted";
Statusbar::msg(msg, wideShorten(ToWString(name), COLS-const_strlen(msg)).c_str());
Statusbar::msg(msg, wideShorten(ToWString(iname), COLS-const_strlen(msg)).c_str());
}
else
{
const char msg[] = "Couldn't delete \"%ls\": %s";
Statusbar::msg(msg, wideShorten(ToWString(name), COLS-const_strlen(msg)-25).c_str(), strerror(errno));
Statusbar::msg(msg, wideShorten(ToWString(iname), COLS-const_strlen(msg)-25).c_str(), strerror(errno));
success = false;
break;
}
@@ -818,19 +818,19 @@ void ExecuteCommand::run()
Statusbar::lock();
Statusbar::put() << NC::Format::Bold << ":" << NC::Format::NoBold;
wFooter->setGetStringHelper(Statusbar::Helpers::TryExecuteImmediateCommand());
std::string name = wFooter->getString();
std::string cmd_name = wFooter->getString();
wFooter->setGetStringHelper(Statusbar::Helpers::getString);
Statusbar::unlock();
if (name.empty())
if (cmd_name.empty())
return;
auto cmd = Bindings.findCommand(name);
auto cmd = Bindings.findCommand(cmd_name);
if (cmd)
{
Statusbar::msg(1, "Executing %s...", name.c_str());
Statusbar::msg(1, "Executing %s...", cmd_name.c_str());
cmd->binding().execute();
}
else
Statusbar::msg("No command named \"%s\"", name.c_str());
Statusbar::msg("No command named \"%s\"", cmd_name.c_str());
}
bool MoveSortOrderUp::canBeRun() const

View File

@@ -81,7 +81,7 @@ extern size_t FooterStartY;
struct BaseAction
{
BaseAction(Type type, const char *name) : m_type(type), m_name(name) { }
BaseAction(Type type_, const char *name_) : m_type(type_), m_name(name_) { }
const char *name() const { return m_name; }
Type type() const { return m_type; }