]> khamidou — GitHub mirrors - electron.git/commitdiff
Revert "Win: Remove adding default file filter(*.*) in a save dialog."
authorCheng Zhao <zcbenz@gmail.com>
Tue, 27 Oct 2015 06:58:44 +0000 (14:58 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 27 Oct 2015 06:58:44 +0000 (14:58 +0800)
This reverts commit 00493f64b766051279eedd686b63800cd2955f88.

atom/browser/ui/file_dialog_win.cc

index 9620c44e420d7e99f5aa878c0b52fb06e54284a9..da00dc54e2fc684034c1a028311c654347efa3ab 100644 (file)
@@ -34,6 +34,12 @@ bool IsDirectory(const base::FilePath& path) {
 void ConvertFilters(const Filters& filters,
                     std::vector<std::wstring>* buffer,
                     std::vector<COMDLG_FILTERSPEC>* filterspec) {
+  if (filters.empty()) {
+    COMDLG_FILTERSPEC spec = { L"All Files (*.*)", L"*.*" };
+    filterspec->push_back(spec);
+    return;
+  }
+
   buffer->reserve(filters.size() * 2);
   for (size_t i = 0; i < filters.size(); ++i) {
     const Filter& filter = filters[i];