mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 913953 - Part b: Remove unused override app bundle code; r=ehsan
This commit is contained in:
parent
38bd752a97
commit
8c9fb0cabf
@ -6,13 +6,6 @@
|
||||
#define BASE_MAC_UTIL_H_
|
||||
|
||||
struct FSRef;
|
||||
class FilePath;
|
||||
|
||||
#ifdef __OBJC__
|
||||
@class NSBundle;
|
||||
#else
|
||||
class NSBundle;
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -24,16 +17,6 @@ bool FSRefFromPath(const std::string& path, FSRef* ref);
|
||||
// Returns true if the application is running from a bundle
|
||||
bool AmIBundled();
|
||||
|
||||
// Returns the main bundle or the override, used for code that needs
|
||||
// to fetch resources from bundles, but work within a unittest where we
|
||||
// aren't a bundle.
|
||||
NSBundle* MainAppBundle();
|
||||
|
||||
// Set the bundle that MainAppBundle will return, overriding the default value
|
||||
// (Restore the default by calling SetOverrideAppBundle(nil)).
|
||||
void SetOverrideAppBundle(NSBundle* bundle);
|
||||
void SetOverrideAppBundlePath(const FilePath& file_path);
|
||||
|
||||
} // namespace mac_util
|
||||
|
||||
#endif // BASE_MAC_UTIL_H_
|
||||
|
@ -44,26 +44,4 @@ bool AmIBundled() {
|
||||
return info.nodeFlags & kFSNodeIsDirectoryMask;
|
||||
}
|
||||
|
||||
// No threading worries since NSBundle isn't thread safe.
|
||||
static NSBundle* g_override_app_bundle = nil;
|
||||
|
||||
NSBundle* MainAppBundle() {
|
||||
if (g_override_app_bundle)
|
||||
return g_override_app_bundle;
|
||||
return [NSBundle mainBundle];
|
||||
}
|
||||
|
||||
void SetOverrideAppBundle(NSBundle* bundle) {
|
||||
[g_override_app_bundle release];
|
||||
g_override_app_bundle = [bundle retain];
|
||||
}
|
||||
|
||||
void SetOverrideAppBundlePath(const FilePath& file_path) {
|
||||
NSString* path = base::SysUTF8ToNSString(file_path.value());
|
||||
NSBundle* bundle = [NSBundle bundleWithPath:path];
|
||||
DCHECK(bundle) << "failed to load the bundle: " << file_path.value();
|
||||
|
||||
SetOverrideAppBundle(bundle);
|
||||
}
|
||||
|
||||
} // namespace mac_util
|
||||
|
Loading…
Reference in New Issue
Block a user