]> khamidou — GitHub mirrors - electron.git/commitdiff
Find the MainMenu nib correctly
authorPaul Betts <paul@paulbetts.org>
Sat, 6 Dec 2014 07:19:05 +0000 (23:19 -0800)
committerPaul Betts <paul@paulbetts.org>
Sat, 6 Dec 2014 07:19:19 +0000 (23:19 -0800)
atom/browser/atom_browser_main_parts_mac.mm

index d31dde15dd68b3643ecc64001ab1aff83aa6db42..c1a9eae3147f435dd33ef24331e7553f0a9df49e 100644 (file)
 
 namespace atom {
 
+std::string GetApplicationName() {
+  std::string name = brightray::MainApplicationBundlePath().BaseName().AsUTF8Unsafe();
+  return name.substr(0, name.length() - 4/*.app*/);
+}
+
 void AtomBrowserMainParts::PreMainMessageLoopStart() {
   // Initialize locale setting.
   l10n_util::OverrideLocaleWithCocoaLocale();
@@ -26,7 +31,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
   base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
       .Append("Contents")
       .Append("Frameworks")
-      .Append("Atom Framework.framework");
+      .Append(GetApplicationName() + " Framework.framework");
   NSBundle* frameworkBundle = [NSBundle
        bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
   NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"