mirror of https://github.com/odrling/Aegisub
Make some functions static
This commit is contained in:
parent
e60197962a
commit
e713f741a4
|
@ -69,13 +69,16 @@ namespace ec = boost::system::errc;
|
|||
#undef CreateDirectory
|
||||
|
||||
namespace agi { namespace fs {
|
||||
namespace {
|
||||
WRAP_BFS(file_size, SizeImpl)
|
||||
WRAP_BFS(space, Space)
|
||||
}
|
||||
|
||||
WRAP_BFS_IGNORE_ERROR(exists, Exists)
|
||||
WRAP_BFS_IGNORE_ERROR(is_regular_file, FileExists)
|
||||
WRAP_BFS_IGNORE_ERROR(is_directory, DirectoryExists)
|
||||
WRAP_BFS(file_size, SizeImpl)
|
||||
WRAP_BFS(last_write_time, ModifiedTime)
|
||||
WRAP_BFS(create_directories, CreateDirectory)
|
||||
WRAP_BFS(space, Space)
|
||||
WRAP_BFS(remove, Remove)
|
||||
WRAP_BFS(canonical, Canonicalize)
|
||||
|
||||
|
|
|
@ -144,17 +144,17 @@ void AssDialogue::Parse(std::string const& raw) {
|
|||
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);
|
||||
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 += ',';
|
||||
}
|
||||
|
||||
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) {
|
||||
if (c == ',')
|
||||
out += ';';
|
||||
|
|
|
@ -223,7 +223,7 @@ std::string keypress_to_str(int key_code, int modifier) {
|
|||
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);
|
||||
if (combo.empty()) return false;
|
||||
|
||||
|
@ -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) {
|
||||
try {
|
||||
if (!hotkey::check(context, c, evt.GetKeyCode(), evt.GetModifiers())) {
|
||||
if (!check(context, c, evt.GetKeyCode(), evt.GetModifiers())) {
|
||||
evt.Skip();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ void init();
|
|||
void clear();
|
||||
|
||||
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 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);
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include <wx/stattext.h>
|
||||
#include <wx/treebook.h>
|
||||
|
||||
namespace {
|
||||
/// General preferences page
|
||||
void General(wxTreebook *book, Preferences *parent) {
|
||||
auto p = new OptionPage(book, parent, _("General"));
|
||||
|
@ -635,6 +636,7 @@ void Interface_Hotkeys::OnUpdateFilter(wxCommandEvent&) {
|
|||
dvc->Expand(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Preferences::SetOption(std::unique_ptr<agi::OptionValue> new_value) {
|
||||
pending_changes[new_value->GetName()] = std::move(new_value);
|
||||
|
|
Loading…
Reference in New Issue