From 535a17bcf20810c65f928ba44f94b4fcb0fac7a9 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 21 Oct 2013 18:10:21 -0700 Subject: [PATCH] Remove pointess OSX_ prefix from functions --- .../libaegisub/include/libaegisub/util_osx.h | 22 +++++++++---------- aegisub/libaegisub/osx/util.mm | 20 ++++++++--------- aegisub/libaegisub/unix/path.cpp | 4 ++-- aegisub/src/command/help.cpp | 2 +- aegisub/src/font_file_lister_fontconfig.cpp | 2 +- aegisub/src/subtitles_provider_libass.cpp | 2 +- aegisub/src/utils.cpp | 4 ++-- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/aegisub/libaegisub/include/libaegisub/util_osx.h b/aegisub/libaegisub/include/libaegisub/util_osx.h index 0efb46a7c..b10764279 100644 --- a/aegisub/libaegisub/include/libaegisub/util_osx.h +++ b/aegisub/libaegisub/include/libaegisub/util_osx.h @@ -45,59 +45,59 @@ namespace agi { /// Get the full name of the bundle itself. /// /// @warning May return "" if the current executable is not inside a bundle. -std::string OSX_GetBundlePath(); +std::string GetBundlePath(); /// @brief Get the esources directory. /// @return Resources directory. /// /// Mainly for user interface elements such as graphics and strings -std::string OSX_GetBundleResourcesDirectory(); +std::string GetBundleResourcesDirectory(); /// @brief Get the built-in plugins directory. /// @return Built-in plugins directory. /// /// This is generaly only used by native Carbon and Cocoa applications. It is /// not for general shared libraries. -std::string OSX_GetBundleBuiltInPlugInsDirectory(); +std::string GetBundleBuiltInPlugInsDirectory(); /// @brief Get the private Frameworks directory. /// @return Private Framework directory. /// /// These are suitable locations for shared libraries. -std::string OSX_GetBundlePrivateFrameworksDirectory(); +std::string GetBundlePrivateFrameworksDirectory(); /// @brief Get the shared Frameworks directory. /// @return Shared Framework directory. /// -/// @see OSX_GetBundlePrivateFrameworksDirectory() +/// @see GetBundlePrivateFrameworksDirectory() /// @note Does anyone know the difference between private and shared frameworks /// inside a bundle? -std::string OSX_GetBundleSharedFrameworksDirectory(); +std::string GetBundleSharedFrameworksDirectory(); /// @brief Get the shared support directory /// @return Shared support directory /// /// This is a suitable location for static configuration files. (Remember, /// bundle is considered read-only.) -std::string OSX_GetBundleSharedSupportDirectory(); +std::string GetBundleSharedSupportDirectory(); /// @brief Get the main executable path. /// @return Main executable path. /// /// The binary run when the user launches the bundle from Finder. -std::string OSX_GetBundleExecutablePath(); +std::string GetBundleExecutablePath(); /// @brief Get the auxillary executable path. /// @return Auxillary executable path. /// /// Pass the basename of the executable to get the path. -std::string OSX_GetBundleAuxillaryExecutablePath(std::string const& executableName); +std::string GetBundleAuxillaryExecutablePath(std::string const& executableName); -std::string OSX_GetApplicationSupportDirectory(); +std::string GetApplicationSupportDirectory(); /// @brief Open a URI using the Launcher. /// @param location URI of file /// @note If this is a FILE or DIRECTORY the path must be ABSOLUTE no 'file://' -void OSX_OpenLocation(std::string const& location); +void OpenLocation(std::string const& location); } // namespace util } // namespace agi diff --git a/aegisub/libaegisub/osx/util.mm b/aegisub/libaegisub/osx/util.mm index 4d718942e..d0cbbf704 100644 --- a/aegisub/libaegisub/osx/util.mm +++ b/aegisub/libaegisub/osx/util.mm @@ -46,62 +46,62 @@ AppNapDisabler::~AppNapDisabler() { } namespace util { -std::string OSX_GetBundlePath() { +std::string GetBundlePath() { @autoreleasepool { return EmptyIfNil([[NSBundle mainBundle] bundlePath]); } } -std::string OSX_GetBundleResourcesDirectory() { +std::string GetBundleResourcesDirectory() { @autoreleasepool { return EmptyIfNil([[[NSBundle mainBundle] resourceURL] path]); } } -std::string OSX_GetBundleExecutablePath() { +std::string GetBundleExecutablePath() { @autoreleasepool { return EmptyIfNil([[NSBundle mainBundle] executablePath]); } } -std::string OSX_GetBundleBuiltInPlugInsDirectory() { +std::string GetBundleBuiltInPlugInsDirectory() { @autoreleasepool { return EmptyIfNil([[NSBundle mainBundle] builtInPlugInsPath]); } } -std::string OSX_GetBundlePrivateFrameworksDirectory() { +std::string GetBundlePrivateFrameworksDirectory() { @autoreleasepool { return EmptyIfNil([[NSBundle mainBundle] privateFrameworksPath]); } } -std::string OSX_GetBundleSharedFrameworksDirectory() { +std::string GetBundleSharedFrameworksDirectory() { @autoreleasepool { return EmptyIfNil([[NSBundle mainBundle] sharedFrameworksPath]); } } -std::string OSX_GetBundleSharedSupportDirectory() { +std::string GetBundleSharedSupportDirectory() { @autoreleasepool { return EmptyIfNil([[NSBundle mainBundle] sharedSupportPath]); } } -std::string OSX_GetBundleAuxillaryExecutablePath(std::string const& executableName) { +std::string GetBundleAuxillaryExecutablePath(std::string const& executableName) { @autoreleasepool { NSString *name = [NSString stringWithUTF8String:executableName.c_str()]; return EmptyIfNil([[NSBundle mainBundle]pathForAuxiliaryExecutable:name]); } } -std::string OSX_GetApplicationSupportDirectory() { +std::string GetApplicationSupportDirectory() { @autoreleasepool { return EmptyIfNil([NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject]); } } -void OSX_OpenLocation(std::string const& location) { +void OpenLocation(std::string const& location) { @autoreleasepool { NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:location.c_str()]]; LSOpenCFURLRef((CFURLRef)url, NULL); diff --git a/aegisub/libaegisub/unix/path.cpp b/aegisub/libaegisub/unix/path.cpp index 72ad772d7..8fd082f53 100644 --- a/aegisub/libaegisub/unix/path.cpp +++ b/aegisub/libaegisub/unix/path.cpp @@ -46,10 +46,10 @@ void Path::FillPlatformSpecificPaths() { SetToken("?local", home/".aegisub"); SetToken("?data", P_DATA); #else - agi::fs::path app_support = agi::util::OSX_GetApplicationSupportDirectory(); + agi::fs::path app_support = agi::util::GetApplicationSupportDirectory(); SetToken("?user", app_support/"Aegisub"); SetToken("?local", app_support/"Aegisub"); - SetToken("?data", agi::util::OSX_GetBundleSharedSupportDirectory()); + SetToken("?data", agi::util::GetBundleSharedSupportDirectory()); #endif SetToken("?temp", boost::filesystem::temp_directory_path()); SetToken("?dictionary", "/usr/share/hunspell"); diff --git a/aegisub/src/command/help.cpp b/aegisub/src/command/help.cpp index 1619d17c0..b9e8d9029 100644 --- a/aegisub/src/command/help.cpp +++ b/aegisub/src/command/help.cpp @@ -95,7 +95,7 @@ struct help_files : public Command { STR_HELP("Resource files") void operator()(agi::Context *) { - agi::util::OSX_OpenLocation((agi::util::OSX_GetBundleSharedSupportDirectory() + "/doc").c_str()); + agi::util::OpenLocation((agi::util::GetBundleSharedSupportDirectory() + "/doc").c_str()); } }; #endif diff --git a/aegisub/src/font_file_lister_fontconfig.cpp b/aegisub/src/font_file_lister_fontconfig.cpp index 9bce1a740..8ac201a79 100644 --- a/aegisub/src/font_file_lister_fontconfig.cpp +++ b/aegisub/src/font_file_lister_fontconfig.cpp @@ -41,7 +41,7 @@ namespace { FcConfig *init_fontconfig() { #ifdef __APPLE__ FcConfig *config = FcConfigCreate(); - std::string conf_path = agi::util::OSX_GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf"; + std::string conf_path = agi::util::GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf"; if (FcConfigParseAndLoad(config, (unsigned char *)conf_path.c_str(), FcTrue)) return config; diff --git a/aegisub/src/subtitles_provider_libass.cpp b/aegisub/src/subtitles_provider_libass.cpp index 700b4004d..97dd60d2d 100644 --- a/aegisub/src/subtitles_provider_libass.cpp +++ b/aegisub/src/subtitles_provider_libass.cpp @@ -77,7 +77,7 @@ void msg_callback(int level, const char *fmt, va_list args, void *) { } #ifdef __APPLE__ -#define CONFIG_PATH (agi::util::OSX_GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf").c_str() +#define CONFIG_PATH (agi::util::GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf").c_str() #else #define CONFIG_PATH nullptr #endif diff --git a/aegisub/src/utils.cpp b/aegisub/src/utils.cpp index 228345927..c9b9a66ff 100644 --- a/aegisub/src/utils.cpp +++ b/aegisub/src/utils.cpp @@ -116,8 +116,8 @@ void RestartAegisub() { #if defined(__WXMSW__) wxExecute("\"" + wxStandardPaths::Get().GetExecutablePath() + "\""); #elif defined(__WXMAC__) - std::string bundle_path = agi::util::OSX_GetBundlePath(); - std::string helper_path = agi::util::OSX_GetBundleAuxillaryExecutablePath("restart-helper"); + std::string bundle_path = agi::util::GetBundlePath(); + std::string helper_path = agi::util::GetBundleAuxillaryExecutablePath("restart-helper"); if (bundle_path.empty() || helper_path.empty()) return; wxString exec = wxString::Format("\"%s\" /usr/bin/open -n \"%s\"'", to_wx(helper_path), to_wx(bundle_path));