[db_manager] Allow opening .sql files

and not only .SQL files
also allow any file extension

Fix #33173
This commit is contained in:
Matthias Kuhn 2019-12-01 11:12:31 +01:00 committed by Nyall Dawson
parent 0eee45aa16
commit 574e0ebaa1

View File

@ -276,7 +276,7 @@ class DlgSqlWindow(QWidget, Ui_Dialog):
self,
self.tr('Save SQL Query'),
lastDir,
self.tr("SQL File (*.sql, *.SQL)"))
self.tr("SQL File (*.sql *.SQL)"))
if filename:
if not filename.lower().endswith('.sql'):
@ -295,7 +295,7 @@ class DlgSqlWindow(QWidget, Ui_Dialog):
self,
self.tr("Load SQL Query"),
lastDir,
self.tr("SQL File (*.sql, *.SQL)"))
self.tr("SQL File (*.sql *.SQL);;All Files (*)"))
if filename:
with open(filename, 'r') as f: