Skip to content

Commit

Permalink
Editor: Don't use filters in the Save dialog on KDE because that make…
Browse files Browse the repository at this point in the history
…s it very slow
  • Loading branch information
ccordoba12 committed Sep 15, 2017
1 parent 7a8d33b commit e90ef33
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions spyder/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
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)

# Local imports
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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e90ef33

Please sign in to comment.