fix shadow warnings
This commit is contained in:
@@ -661,11 +661,11 @@ void DeleteBrowserItems::run()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
MPD::Item &item = myBrowser->main().current().value();
|
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 = "Delete ";
|
||||||
question += itemTypeToString(item.type);
|
question += itemTypeToString(item.type);
|
||||||
question += " \"";
|
question += " \"";
|
||||||
question += ToString(wideShorten(ToWString(name), COLS-question.size()-10));
|
question += ToString(wideShorten(ToWString(iname), COLS-question.size()-10));
|
||||||
question += "\"?";
|
question += "\"?";
|
||||||
}
|
}
|
||||||
bool yes = askYesNoQuestion(question, Status::trace);
|
bool yes = askYesNoQuestion(question, Status::trace);
|
||||||
@@ -676,16 +676,16 @@ void DeleteBrowserItems::run()
|
|||||||
for (auto it = list.begin(); it != list.end(); ++it)
|
for (auto it = list.begin(); it != list.end(); ++it)
|
||||||
{
|
{
|
||||||
const MPD::Item &i = (*it)->value();
|
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))
|
if (myBrowser->deleteItem(i))
|
||||||
{
|
{
|
||||||
const char msg[] = "\"%ls\" deleted";
|
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
|
else
|
||||||
{
|
{
|
||||||
const char msg[] = "Couldn't delete \"%ls\": %s";
|
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;
|
success = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -818,19 +818,19 @@ void ExecuteCommand::run()
|
|||||||
Statusbar::lock();
|
Statusbar::lock();
|
||||||
Statusbar::put() << NC::Format::Bold << ":" << NC::Format::NoBold;
|
Statusbar::put() << NC::Format::Bold << ":" << NC::Format::NoBold;
|
||||||
wFooter->setGetStringHelper(Statusbar::Helpers::TryExecuteImmediateCommand());
|
wFooter->setGetStringHelper(Statusbar::Helpers::TryExecuteImmediateCommand());
|
||||||
std::string name = wFooter->getString();
|
std::string cmd_name = wFooter->getString();
|
||||||
wFooter->setGetStringHelper(Statusbar::Helpers::getString);
|
wFooter->setGetStringHelper(Statusbar::Helpers::getString);
|
||||||
Statusbar::unlock();
|
Statusbar::unlock();
|
||||||
if (name.empty())
|
if (cmd_name.empty())
|
||||||
return;
|
return;
|
||||||
auto cmd = Bindings.findCommand(name);
|
auto cmd = Bindings.findCommand(cmd_name);
|
||||||
if (cmd)
|
if (cmd)
|
||||||
{
|
{
|
||||||
Statusbar::msg(1, "Executing %s...", name.c_str());
|
Statusbar::msg(1, "Executing %s...", cmd_name.c_str());
|
||||||
cmd->binding().execute();
|
cmd->binding().execute();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Statusbar::msg("No command named \"%s\"", name.c_str());
|
Statusbar::msg("No command named \"%s\"", cmd_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MoveSortOrderUp::canBeRun() const
|
bool MoveSortOrderUp::canBeRun() const
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ extern size_t FooterStartY;
|
|||||||
|
|
||||||
struct BaseAction
|
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; }
|
const char *name() const { return m_name; }
|
||||||
Type type() const { return m_type; }
|
Type type() const { return m_type; }
|
||||||
|
|||||||
Reference in New Issue
Block a user