From 70a44971be93664d599ad08f22b5b01cbeadee9f Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 4 Nov 2016 18:17:26 +0100 Subject: [PATCH] plot: Fix fetch all data button for plots based on query data The fetch all data button in the plot area would load all data as if the Browse Data tab was active even though the plot is based on a SQL query in the EXecute SQL tab. That would lead to non-sensical results. With this commit the button always load the correct data. See issue #820. --- src/MainWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7fb1eed4..6c2bd3b5 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -2716,7 +2716,7 @@ void MainWindow::browseDataSetDefaultTableEncoding() void MainWindow::browseDataFetchAllData() { - if(m_browseTableModel) + if(m_currentPlotModel) { // Show progress dialog because fetching all data might take some time QProgressDialog progress(tr("Fetching all data..."), @@ -2726,19 +2726,19 @@ void MainWindow::browseDataFetchAllData() qApp->processEvents(); // Make sure all data is loaded - while(m_browseTableModel->canFetchMore()) + while(m_currentPlotModel->canFetchMore()) { // Fetch the next bunch of data - m_browseTableModel->fetchMore(); + m_currentPlotModel->fetchMore(); // Update the progress dialog and stop loading data when the cancel button was pressed - progress.setValue(m_browseTableModel->rowCount()); + progress.setValue(m_currentPlotModel->rowCount()); qApp->processEvents(); if(progress.wasCanceled()) break; } // Update plot - updatePlot(m_browseTableModel); + updatePlot(m_currentPlotModel); } }