filename -> displayName
authorKevin Sawicki <kevinsawicki@gmail.com>
Wed, 26 Oct 2016 00:47:22 +0000 (09:47 +0900)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 26 Oct 2016 00:47:38 +0000 (09:47 +0900)
atom/browser/api/atom_api_window.cc
atom/browser/native_window.cc
atom/browser/native_window.h
atom/browser/native_window_mac.h
atom/browser/native_window_mac.mm
docs/api/browser-window.md

index a0391985d7b3f8593fd988f36e9cef92168d7c63..ae37f504cad05a6111df02d42b8fcff851d3422b 100644 (file)
@@ -730,11 +730,11 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) {
 }
 
 void Window::PreviewFile(const std::string& path, mate::Arguments* args) {
-  std::string fileName;
-  if (!args->GetNext(&fileName)) {
-    fileName = path;
+  std::string display_name;
+  if (!args->GetNext(&display_name)) {
+    display_name = path;
   }
-  window_->PreviewFile(path, fileName);
+  window_->PreviewFile(path, display_name);
 }
 
 void Window::SetParentWindow(v8::Local<v8::Value> value,
index 9d56615e6b2bc9d5bc36a277cef495fb9fa6578e..6c32e79e19d13d0ae06e028fafdc20413846eabf 100644 (file)
@@ -375,7 +375,7 @@ void NativeWindow::SetAspectRatio(double aspect_ratio,
 }
 
 void NativeWindow::PreviewFile(const std::string& path,
-                               const std::string& fileName) {
+                               const std::string& display_name) {
 }
 
 void NativeWindow::RequestToClosePage() {
index e3d1558cfa0d729aaec2046f8c5dacb0c3feba72..3d190ba7d9d37303c5e4a2aa9dc89a8cf1764f69 100644 (file)
@@ -177,7 +177,7 @@ class NativeWindow : public base::SupportsUserData,
   gfx::Size GetAspectRatioExtraSize();
   virtual void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size);
   virtual void PreviewFile(const std::string& path,
-                           const std::string& fileName);
+                           const std::string& display_name);
 
   base::WeakPtr<NativeWindow> GetWeakPtr() {
     return weak_factory_.GetWeakPtr();
index 1a6d2d382cd36f5a5052c639fc94593c264f6f79..979d69d1a21ef0ad958766f59d46b46397e47664 100644 (file)
@@ -55,7 +55,7 @@ class NativeWindowMac : public NativeWindow,
   void SetMovable(bool movable) override;
   void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size)
     override;
-  void PreviewFile(const std::string& path, const std::string& fileName)
+  void PreviewFile(const std::string& path, const std::string& display_name)
     override;
   bool IsMovable() override;
   void SetMinimizable(bool minimizable) override;
index 98fc2c8695f86eb73ed29c87ef31201b4ab4453c..d9de9bd3ca150726ff2e55afa72ae2fa84cbe7ed 100644 (file)
@@ -290,11 +290,11 @@ bool ScopedDisableResize::disable_resize_ = false;
 @implementation AtomPreviewItem
 
 - (id)initWithURL:(NSURL*)url title:(NSString*)title {
-  self = [super init]; 
+  self = [super init];
   if (self) {
     self.previewItemURL = url;
     self.previewItemTitle = title;
-  }  
+  }
   return self;
 }
 
@@ -953,11 +953,11 @@ void NativeWindowMac::SetAspectRatio(double aspect_ratio,
     [window_ setResizeIncrements:NSMakeSize(1.0, 1.0)];
 }
 
-void NativeWindowMac::PreviewFile(const std::string& path, const std::string& fileName) {
-  NSString* pathStr = [NSString stringWithUTF8String:path.c_str()];
-  NSString* nameStr = [NSString stringWithUTF8String:fileName.c_str()];
-
-  [window_ previewFileAtPath:pathStr withName:nameStr];
+void NativeWindowMac::PreviewFile(const std::string& path,
+                                  const std::string& display_name) {
+  NSString* path_ns = [NSString stringWithUTF8String:path.c_str()];
+  NSString* name_ns = [NSString stringWithUTF8String:display_name.c_str()];
+  [window_ previewFileAtPath:path_ns withName:name_ns];
 }
 
 void NativeWindowMac::SetMovable(bool movable) {
index fccedae5273b9bd208a4281b9ab6616538b08a39..b891396dba48c0b59379d81feac4729543396e2f 100644 (file)
@@ -664,12 +664,16 @@ the player itself we would call this function with arguments of 16/9 and
 are within the content view--only that they exist. Just sum any extra width and
 height areas you have within the overall content view.
 
-#### `win.previewFile(pathname[, filename])` _macOS_
+#### `win.previewFile(pathname[, displayName])` _macOS_
 
-* `pathname` String - The absolute path to the file to preview with QuickLook. This is important as Quicklook uses the file name and file extension on the path to determine the content_type of the file to open.
-* `filename` String (Optional) - The name of the file to display on the QuickLook modal view. This is purely visual and does not affect the content_type of the file. Defaults to filepath.
+* `path` String - The absolute path to the file to preview with QuickLook. This
+  is important as Quick Look uses the file name and file extension on the path to
+  determine the content type of the file to open.
+* `displayName` String (Optional) - The name of the file to display on the
+  Quick Look modal view. This is purely visual and does not affect the content
+  type of the file. Defaults to `path`.
 
-Uses QuickLook to preview a file at a given path.
+Uses [Quick Look][quick-look] to preview a file at a given path.
 
 #### `win.setBounds(bounds[, animate])`
 
@@ -1189,3 +1193,4 @@ Returns `BrowserWindow` - The parent window.
 Returns `BrowserWindow[]` - All child windows.
 
 [window-levels]: https://developer.apple.com/reference/appkit/nswindow/1664726-window_levels
+[quick-look]: https://en.wikipedia.org/wiki/Quick_Look