actions: change naming convention to camelCase

This commit is contained in:
Andrzej Rybczak
2012-10-06 18:02:31 +02:00
parent ca24c5be5b
commit 6709219aac
10 changed files with 361 additions and 355 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -98,7 +98,7 @@ Action *parseActionLine(const std::string &line, F error)
size_t i = 0;
for (; i < line.size() && !isspace(line[i]); ++i) { }
if (i == line.size()) // only action name
result = Action::Get(line);
result = Action::get(line);
else // there is something else
{
std::string action_name = line.substr(0, i);
@@ -141,7 +141,7 @@ Action *parseActionLine(const std::string &line, F error)
{
// require that given action is runnable
std::string arg = getEnclosedString(line, '"', '"', 0);
Action *action = Action::Get(arg);
Action *action = Action::get(arg);
if (action)
result = new RequireRunnable(action);
else

View File

@@ -74,7 +74,7 @@ struct Binding
{
typedef std::vector<Action *> ActionChain;
Binding(ActionType at) : m_is_single(true), m_action(Action::Get(at)) { }
Binding(ActionType at) : m_is_single(true), m_action(Action::get(at)) { }
Binding(const ActionChain &actions) {
assert(actions.size() > 0);
if (actions.size() == 1) {
@@ -90,10 +90,10 @@ struct Binding
bool result = false;
if (m_is_single) {
assert(m_action);
result = m_action->Execute();
result = m_action->execute();
} else {
for (auto it = m_chain->begin(); it != m_chain->end(); ++it)
if (!(*it)->Execute())
if (!(*it)->execute())
break;
result = true;
}

View File

@@ -121,7 +121,7 @@ void ParseArgv(int argc, char **argv)
exit(0);
}
if (!Action::ConnectToMPD())
if (!Action::connectToMPD())
exit(1);
if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--screen"))

View File

@@ -131,7 +131,7 @@ std::string Help::DisplayKeys(const ActionType at)
{
for (auto j = it->second.begin(); j != it->second.end(); ++j)
{
if (j->isSingle() && j->action()->Type() == at)
if (j->isSingle() && j->action()->type() == at)
{
result += keyToString(it->first, &print_backspace);
result += " ";

View File

@@ -21,7 +21,7 @@
#include "global.h"
#include "macro_utilities.h"
void PushCharacters::Run()
void PushCharacters::run()
{
for (auto it = m_queue.begin(); it != m_queue.end(); ++it)
(*m_window)->pushChar(*it);
@@ -37,7 +37,7 @@ bool RequireScreen::canBeRun() const
return Global::myScreen->type() == m_screen_type;
}
void RunExternalCommand::Run()
void RunExternalCommand::run()
{
GNUC_UNUSED int res;
res = std::system(m_command.c_str());

View File

@@ -31,7 +31,7 @@ struct PushCharacters : public Action
: Action(aMacroUtility, ""), m_window(w), m_queue(queue) { }
protected:
virtual void Run();
virtual void run();
private:
NC::Window **m_window;
@@ -45,7 +45,7 @@ struct RequireRunnable : public Action
protected:
virtual bool canBeRun() const;
virtual void Run() { }
virtual void run() { }
private:
Action *m_action;
@@ -58,7 +58,7 @@ struct RequireScreen : public Action
protected:
virtual bool canBeRun() const;
virtual void Run() { }
virtual void run() { }
private:
ScreenType m_screen_type;
@@ -70,7 +70,7 @@ struct RunExternalCommand : public Action
: Action(aMacroUtility, ""), m_command(command) { }
protected:
virtual void Run();
virtual void run();
private:
std::string m_command;

View File

@@ -60,7 +60,7 @@ namespace
}
else if (signal == SIGWINCH)
{
Action::ResizeScreen(true);
Action::resizeScreen(true);
}
}
# endif // !WIN32
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
if (argc > 1)
ParseArgv(argc, argv);
if (!Action::ConnectToMPD())
if (!Action::connectToMPD())
exit(1);
if (Mpd.Version() < 16)
@@ -150,9 +150,9 @@ int main(int argc, char **argv)
if (Config.new_design)
Config.statusbar_visibility = 0;
Action::SetWindowsDimensions();
Action::ValidateScreenSize();
Action::InitializeScreens();
Action::setWindowsDimensions();
Action::validateScreenSize();
Action::initializeScreens();
wHeader = new NC::Window(0, 0, COLS, Action::HeaderHeight, "", Config.header_color, NC::brNone);
if (Config.header_visibility || Config.new_design)

View File

@@ -468,7 +468,7 @@ void TagEditor::enterPressed()
if (w == TagTypes && id == 5)
{
bool yes = Action::AskYesNoQuestion("Number tracks?", Status::trace);
bool yes = Action::askYesNoQuestion("Number tracks?", Status::trace);
if (yes)
{
auto it = EditedSongs.begin();
@@ -929,7 +929,7 @@ bool TagEditor::ifAnyModifiedAskForDiscarding()
{
bool result = true;
if (isAnyModified(*Tags))
result = Action::AskYesNoQuestion("There are pending changes, are you sure?", Status::trace);
result = Action::askYesNoQuestion("There are pending changes, are you sure?", Status::trace);
return result;
}