Skip to content
Extraits de code Groupes Projets
Valider e713f741 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Make some functions static

parent e6019796
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -69,13 +69,16 @@ namespace ec = boost::system::errc; ...@@ -69,13 +69,16 @@ namespace ec = boost::system::errc;
#undef CreateDirectory #undef CreateDirectory
namespace agi { namespace fs { namespace agi { namespace fs {
namespace {
WRAP_BFS(file_size, SizeImpl)
WRAP_BFS(space, Space)
}
WRAP_BFS_IGNORE_ERROR(exists, Exists) WRAP_BFS_IGNORE_ERROR(exists, Exists)
WRAP_BFS_IGNORE_ERROR(is_regular_file, FileExists) WRAP_BFS_IGNORE_ERROR(is_regular_file, FileExists)
WRAP_BFS_IGNORE_ERROR(is_directory, DirectoryExists) WRAP_BFS_IGNORE_ERROR(is_directory, DirectoryExists)
WRAP_BFS(file_size, SizeImpl)
WRAP_BFS(last_write_time, ModifiedTime) WRAP_BFS(last_write_time, ModifiedTime)
WRAP_BFS(create_directories, CreateDirectory) WRAP_BFS(create_directories, CreateDirectory)
WRAP_BFS(space, Space)
WRAP_BFS(remove, Remove) WRAP_BFS(remove, Remove)
WRAP_BFS(canonical, Canonicalize) WRAP_BFS(canonical, Canonicalize)
......
...@@ -144,17 +144,17 @@ void AssDialogue::Parse(std::string const& raw) { ...@@ -144,17 +144,17 @@ void AssDialogue::Parse(std::string const& raw) {
Text = text; Text = text;
} }
void append_int(std::string &str, int v) { static void append_int(std::string &str, int v) {
boost::spirit::karma::generate(back_inserter(str), boost::spirit::karma::int_, v); boost::spirit::karma::generate(back_inserter(str), boost::spirit::karma::int_, v);
str += ','; str += ',';
} }
void append_str(std::string &out, std::string const& str) { static void append_str(std::string &out, std::string const& str) {
out += str; out += str;
out += ','; out += ',';
} }
void append_unsafe_str(std::string &out, std::string const& str) { static void append_unsafe_str(std::string &out, std::string const& str) {
for (auto c : str) { for (auto c : str) {
if (c == ',') if (c == ',')
out += ';'; out += ';';
......
...@@ -223,7 +223,7 @@ std::string keypress_to_str(int key_code, int modifier) { ...@@ -223,7 +223,7 @@ std::string keypress_to_str(int key_code, int modifier) {
return combo; return combo;
} }
bool check(std::string const& context, agi::Context *c, int key_code, int modifier) { static bool check(std::string const& context, agi::Context *c, int key_code, int modifier) {
std::string combo = keypress_to_str(key_code, modifier); std::string combo = keypress_to_str(key_code, modifier);
if (combo.empty()) return false; if (combo.empty()) return false;
...@@ -237,7 +237,7 @@ bool check(std::string const& context, agi::Context *c, int key_code, int modifi ...@@ -237,7 +237,7 @@ bool check(std::string const& context, agi::Context *c, int key_code, int modifi
bool check(std::string const& context, agi::Context *c, wxKeyEvent &evt) { bool check(std::string const& context, agi::Context *c, wxKeyEvent &evt) {
try { try {
if (!hotkey::check(context, c, evt.GetKeyCode(), evt.GetModifiers())) { if (!check(context, c, evt.GetKeyCode(), evt.GetModifiers())) {
evt.Skip(); evt.Skip();
return false; return false;
} }
......
...@@ -34,7 +34,6 @@ void init(); ...@@ -34,7 +34,6 @@ void init();
void clear(); void clear();
bool check(std::string const& context, agi::Context *c, wxKeyEvent &evt); bool check(std::string const& context, agi::Context *c, wxKeyEvent &evt);
bool check(std::string const& context, agi::Context *c, int key_code, wchar_t key_char, int modifier);
std::string keypress_to_str(int key_code, int modifier); std::string keypress_to_str(int key_code, int modifier);
std::string get_hotkey_str_first(std::string const& context, std::string const& command); std::string get_hotkey_str_first(std::string const& context, std::string const& command);
std::vector<std::string> get_hotkey_strs(std::string const& context, std::string const& command); std::vector<std::string> get_hotkey_strs(std::string const& context, std::string const& command);
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/treebook.h> #include <wx/treebook.h>
namespace {
/// General preferences page /// General preferences page
void General(wxTreebook *book, Preferences *parent) { void General(wxTreebook *book, Preferences *parent) {
auto p = new OptionPage(book, parent, _("General")); auto p = new OptionPage(book, parent, _("General"));
...@@ -635,6 +636,7 @@ void Interface_Hotkeys::OnUpdateFilter(wxCommandEvent&) { ...@@ -635,6 +636,7 @@ void Interface_Hotkeys::OnUpdateFilter(wxCommandEvent&) {
dvc->Expand(context); dvc->Expand(context);
} }
} }
}
void Preferences::SetOption(std::unique_ptr<agi::OptionValue> new_value) { void Preferences::SetOption(std::unique_ptr<agi::OptionValue> new_value) {
pending_changes[new_value->GetName()] = std::move(new_value); pending_changes[new_value->GetName()] = std::move(new_value);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter