From 54ee12308dc940829c00b70eb44d6874737f98dc Mon Sep 17 00:00:00 2001 From: Corne Dorrestijn Date: Fri, 15 Aug 2014 16:52:16 +0200 Subject: [PATCH] reused converted and fixed indentation --- atom/browser/api/atom_api_app.cc | 12 +++--------- atom/browser/api/atom_api_app.h | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 71d3fadf574c..fa0ef84b813f 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -68,7 +68,7 @@ void App::OnFinishLaunching() { Emit("ready"); } -std::string App::GetDataPath() { +base::FilePath App::GetDataPath() { base::FilePath path; #if defined(OS_LINUX) scoped_ptr env(base::Environment::Create()); @@ -80,15 +80,9 @@ std::string App::GetDataPath() { #endif base::FilePath data_path = path.Append( - base::FilePath::FromUTF8Unsafe(Browser::Get()->GetName())); + base::FilePath::FromUTF8Unsafe(Browser::Get()->GetName())); - // FilePath.value() returns a std::wstring in windows and - // std::string on other platforms. - std::vector writable(data_path.value().begin(), - data_path.value().end()); - writable.push_back('\0'); - - return &writable[0]; + return data_path; } mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder( diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index ae11123eb6d7..d0cbddaadff5 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "atom/browser/api/event_emitter.h" #include "atom/browser/browser_observer.h" +#include "atom/common/native_mate_converters/file_path_converter.h" #include "native_mate/handle.h" namespace atom { @@ -34,7 +35,7 @@ class App : public mate::EventEmitter, virtual void OnActivateWithNoOpenWindows() OVERRIDE; virtual void OnWillFinishLaunching() OVERRIDE; virtual void OnFinishLaunching() OVERRIDE; - virtual std::string GetDataPath(); + virtual base::FilePath GetDataPath(); // mate::Wrappable implementations: virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(