Repository: spyder-ide/spyder

Issue:
Filter settings are empty by default
## Problem Description

In previous versions there was a list of extensions in the filter settings for the files and now it is empty by default.
<img width="1440" alt="Screenshot 2021-04-28 at 8 25 04 PM" src="https://user-images.githubusercontent.com/18587879/116491662-03434880-a860-11eb-8af4-ea84cb02d600.png">

I'm not quite sure that this is the desired behaviour. I think by default we should have the extensions we had there.
If I click "reset" the extensions appear

<img width="1440" alt="Screenshot 2021-04-28 at 8 27 05 PM" src="https://user-images.githubusercontent.com/18587879/116491699-1a823600-a860-11eb-925a-5d214ee4396a.png">

### What is the expected output? What do you see instead?



## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: Spyder 5.1.0 dev0
* Python version: 3.8
* Qt version: 
* PyQt version: 
* Operating System name/version: MacOs

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:

Resolving patch:
diff --git a/spyder/config/main.py b/spyder/config/main.py
--- a/spyder/config/main.py
+++ b/spyder/config/main.py
@@ -18,7 +18,6 @@
 from spyder.config.base import CHECK_ALL, EXCLUDED_NAMES
 from spyder.config.fonts import MEDIUM, SANS_SERIF
 from spyder.config.utils import IMPORT_EXT
-from spyder.config.snippets import SNIPPETS
 from spyder.config.appearance import APPEARANCE
 from spyder.plugins.editor.utils.findtasks import TASKS_PATTERN
 from spyder.utils.introspection.module_completion import PREFERRED_MODULES
@@ -31,7 +30,8 @@
 EXCLUDE_PATTERNS = ['*.csv, *.dat, *.log, *.tmp, *.bak, *.orig']
 
 # Extensions that should be visible in Spyder's file/project explorers
-SHOW_EXT = ['.py', '.ipynb', '.dat', '.pdf', '.png', '.svg']
+SHOW_EXT = ['.py', '.ipynb', '.dat', '.pdf', '.png', '.svg', '.md', '.yml',
+            '.yaml']
 
 # Extensions supported by Spyder (Editor or Variable explorer)
 USEFUL_EXT = IMPORT_EXT + SHOW_EXT
@@ -293,6 +293,10 @@
               'visible_if_project_open': True,
               'date_column': False,
               'single_click_to_open': False,
+              'show_hidden': False,
+              'size_column': False,
+              'type_column': False,
+              'date_column': False
               }),
             ('explorer',
              {
@@ -300,7 +304,9 @@
               'name_filters': NAME_FILTERS,
               'show_hidden': False,
               'single_click_to_open': False,
-              'file_associations': {},
+              'size_column': False,
+              'type_column': False,
+              'date_column': True
               }),
             ('find_in_files',
              {
@@ -628,4 +634,4 @@
 #    or if you want to *rename* options, then you need to do a MAJOR update in
 #    version, e.g. from 3.0.0 to 4.0.0
 # 3. You don't need to touch this value if you're just adding a new option
-CONF_VERSION = '69.1.0'
+CONF_VERSION = '70.0.0'
diff --git a/spyder/plugins/explorer/confpage.py b/spyder/plugins/explorer/confpage.py
--- a/spyder/plugins/explorer/confpage.py
+++ b/spyder/plugins/explorer/confpage.py
@@ -75,7 +75,7 @@ def setup_page(self):
         file_associations = FileAssociationsWidget()
 
         # Widget setup
-        file_associations.load_values(self.get_option('file_associations'))
+        file_associations.load_values(self.get_option('file_associations', {}))
         # The actual config data is stored on this text edit set to invisible
         self.edit_file_associations.setVisible(False)
 
diff --git a/spyder/plugins/explorer/widgets/explorer.py b/spyder/plugins/explorer/widgets/explorer.py
--- a/spyder/plugins/explorer/widgets/explorer.py
+++ b/spyder/plugins/explorer/widgets/explorer.py
@@ -281,9 +281,6 @@ def __init__(self, parent=None):
     def setup(self):
         self.setup_view()
 
-        self.set_name_filters(self.get_conf('name_filters', []))
-        self.set_name_filters(self.get_conf('file_associations', {}))
-
         # New actions
         new_file_action = self.create_action(
             DirViewActions.NewFile,
@@ -414,7 +411,7 @@ def setup(self):
             DirViewActions.ToggleHiddenFiles,
             text=_("Show hidden files"),
             toggled=True,
-            initial=self.get_conf('show_hidden', False),
+            initial=self.get_conf('show_hidden'),
             option='show_hidden'
         )
 
@@ -429,7 +426,7 @@ def setup(self):
             DirViewActions.ToggleSingleClick,
             text=_("Single click to open"),
             toggled=True,
-            initial=self.get_conf('single_click_to_open', False),
+            initial=self.get_conf('single_click_to_open'),
             option='single_click_to_open'
         )
 
@@ -462,7 +459,7 @@ def setup(self):
             DirViewActions.ToggleSizeColumn,
             text=_('Size'),
             toggled=True,
-            initial=self.get_conf('size_column', False),
+            initial=self.get_conf('size_column'),
             register_shortcut=False,
             option='size_column'
         )
@@ -470,7 +467,7 @@ def setup(self):
             DirViewActions.ToggleTypeColumn,
             text=_('Type') if sys.platform == 'darwin' else _('Type'),
             toggled=True,
-            initial=self.get_conf('type_column', False),
+            initial=self.get_conf('type_column'),
             register_shortcut=False,
             option='type_column'
         )
@@ -478,7 +475,7 @@ def setup(self):
             DirViewActions.ToggleDateColumn,
             text=_("Date modified"),
             toggled=True,
-            initial=self.get_conf('date_column', True),
+            initial=self.get_conf('date_column'),
             register_shortcut=False,
             option='date_column'
         )
@@ -757,7 +754,7 @@ def mouseDoubleClickEvent(self, event):
     def mouseReleaseEvent(self, event):
         """Reimplement Qt method."""
         super().mouseReleaseEvent(event)
-        if self.get_conf('single_click_to_open', False):
+        if self.get_conf('single_click_to_open'):
             self.clicked()
 
     def dragEnterEvent(self, event):
@@ -882,21 +879,21 @@ def edit_filter(self):
               'want to show, separated by commas.'))
         description_label.setOpenExternalLinks(True)
         description_label.setWordWrap(True)
-        filters = QTextEdit(", ".join(self.get_conf('name_filters', [])))
+        filters = QTextEdit(", ".join(self.get_conf('name_filters')),
+                            parent=self)
         layout = QVBoxLayout()
         layout.addWidget(description_label)
         layout.addWidget(filters)
 
         def handle_ok():
             filter_text = filters.toPlainText()
-            filter_text = [
-                f.strip() for f in str(filter_text).split(',')]
+            filter_text = [f.strip() for f in str(filter_text).split(',')]
             self.set_name_filters(filter_text)
             dialog.accept()
 
         def handle_reset():
             self.set_name_filters(NAME_FILTERS)
-            filters.setPlainText(", ".join(self.get_conf('name_filters', [])))
+            filters.setPlainText(", ".join(self.get_conf('name_filters')))
 
         # Dialog buttons
         button_box = QDialogButtonBox(QDialogButtonBox.Reset |
@@ -1375,7 +1372,7 @@ def open_interpreter(self, fnames=None):
     def filter_files(self, name_filters=None):
         """Filter files given the defined list of filters."""
         if name_filters is None:
-            name_filters = self.get_conf('name_filters', [])
+            name_filters = self.get_conf('name_filters')
 
         if self.filter_on:
             self.fsmodel.setNameFilters(name_filters)
@@ -1558,7 +1555,7 @@ def set_file_associations(self, value):
 
     def set_name_filters(self, name_filters):
         """Set name filters"""
-        if self.get_conf('name_filters', []) == ['']:
+        if self.get_conf('name_filters') == ['']:
             self.set_conf('name_filters', [])
         else:
             if running_under_pytest():


Test patch: