From 6aad422cd8ba5c206353512aeeeef9b0bbf833d2 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Wed, 19 Jun 2019 09:29:18 -0400 Subject: [PATCH] Fixed #189: recall grid for subsequent log entries --- mainwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 7c732a3..284cf54 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -11815,15 +11815,21 @@ void MainWindow::displayCallActivity() { QString logDetailDate; QString logDetailName; QString logDetailComment; + bool gridItemEmpty = gridItem->text().isEmpty(); - if(showColumn("call", "grid") || showColumn("call", "log") || showColumn("call", "logName") || showColumn("call", "logComment")){ + if((gridItemEmpty && showColumn("call", "grid")) || showColumn("call", "log") || showColumn("call", "logName") || showColumn("call", "logComment")){ m_logBook.findCallDetails(d.call, logDetailGrid, logDetailDate, logDetailName, logDetailComment); } - if(gridItem->text().isEmpty() || !logDetailGrid.isEmpty()){ + if(gridItemEmpty && !logDetailGrid.isEmpty()){ gridItem->setText(logDetailGrid.trimmed().left(4)); gridItem->setToolTip(logDetailGrid.trimmed()); distanceItem->setText(calculateDistance(logDetailGrid.trimmed())); + + // update the call activity cache with the loaded grid + if(m_callActivity.contains(d.call)){ + m_callActivity[call].grid = logDetailGrid.trimmed(); + } } if(!logDetailDate.isEmpty()){