diff --git a/spyder/widgets/editor.py b/spyder/widgets/editor.py index 69f4e15dbd0..1b764e44343 100644 --- a/spyder/widgets/editor.py +++ b/spyder/widgets/editor.py @@ -24,7 +24,7 @@ from qtpy.QtCore import (QByteArray, QFileInfo, QObject, QPoint, QSize, Qt, QThread, QTimer, Signal, Slot) from qtpy.QtGui import QFont -from qtpy.QtWidgets import (QAction, QApplication, QFileDialog,QHBoxLayout, +from qtpy.QtWidgets import (QAction, QApplication, QFileDialog, QHBoxLayout, QMainWindow, QMessageBox, QMenu, QSplitter, QVBoxLayout, QWidget, QListWidget, QListWidgetItem) @@ -32,7 +32,7 @@ from spyder.config.base import _, DEBUG, STDERR, STDOUT from spyder.config.gui import config_shortcut, get_shortcut from spyder.config.utils import (get_edit_filetypes, get_edit_filters, - get_filter) + get_filter, is_kde_desktop, is_anaconda) from spyder.py3compat import qbytearray_to_str, to_text_string from spyder.utils import icon_manager as ima from spyder.utils import (codeanalysis, encoding, sourcecode, @@ -1570,13 +1570,22 @@ def select_savename(self, original_filename): self.edit_filetypes = get_edit_filetypes() if self.edit_filters is None: self.edit_filters = get_edit_filters() - selectedfilter = get_filter(self.edit_filetypes, - osp.splitext(original_filename)[1]) + + # Don't use filters on KDE to not make the dialog incredible + # slow + # Fixes issue 4156 + if is_kde_desktop() and not is_anaconda(): + filters = '' + selectedfilter = '' + else: + filters = self.edit_filters + selectedfilter = get_filter(self.edit_filetypes, + osp.splitext(original_filename)[1]) self.redirect_stdio.emit(False) filename, _selfilter = getsavefilename(self, _("Save file"), original_filename, - filters=self.edit_filters, + filters=filters, selectedfilter=selectedfilter, options=QFileDialog.HideNameFilterDetails) self.redirect_stdio.emit(True)