aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp b/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp
index 23cb651..aa59bb0 100644
--- a/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/windows/editorwindow.cpp
@@ -211,7 +211,7 @@ QAction* EditorWindow::getAction(EditorWindow::Action action)
return ExtActionContainer::getAction(action);
}
-QString EditorWindow::getQueryToExecute(bool doSelectCurrentQuery, QueryExecMode querySelectionMode)
+QString EditorWindow::getQueryToExecute(QueryExecMode querySelectionMode)
{
QString sql;
if (ui->sqlEdit->textCursor().hasSelection())
@@ -228,9 +228,8 @@ QString EditorWindow::getQueryToExecute(bool doSelectCurrentQuery, QueryExecMode
ui->sqlEdit->saveSelection();
selectCurrentQuery(true);
sql = ui->sqlEdit->textCursor().selectedText();
+ ui->sqlEdit->restoreSelection();
fixTextCursorSelectedText(sql);
- if (!doSelectCurrentQuery)
- ui->sqlEdit->restoreSelection();
}
else
{
@@ -463,7 +462,7 @@ void EditorWindow::updateShortcutTips()
void EditorWindow::execQuery(bool explain, QueryExecMode querySelectionMode)
{
- QString sql = getQueryToExecute(true, querySelectionMode);
+ QString sql = getQueryToExecute(querySelectionMode);
QHash<QString, QVariant> bindParams;
bool proceed = processBindParams(sql, bindParams);
if (!proceed)
@@ -474,7 +473,7 @@ void EditorWindow::execQuery(bool explain, QueryExecMode querySelectionMode)
resultsModel->setQuery(sql);
resultsModel->setParams(bindParams);
resultsModel->setQueryCountLimitForSmartMode(queryLimitForSmartExecution);
- ui->dataView->refreshData();
+ ui->dataView->refreshData(false);
updateState();
if (resultsDisplayMode == ResultsDisplayMode::SEPARATE_TAB)
@@ -741,7 +740,7 @@ void EditorWindow::createViewFromQuery()
return;
}
- QString sql = getQueryToExecute(true);
+ QString sql = getQueryToExecute();
DbObjectDialogs dialogs(getCurrentDb());
dialogs.addView(sql);
}