From f55c669e5e2dca4c9f1227fea457ddc02afd72d9 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 21 Mar 2020 09:54:43 +0100 Subject: [PATCH] code style changes --- src/historygraph.cpp | 8 +++++--- src/historygraph.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/historygraph.cpp b/src/historygraph.cpp index f09d3565..e9bd682a 100644 --- a/src/historygraph.cpp +++ b/src/historygraph.cpp @@ -136,7 +136,7 @@ void AHistoryGraph::Update ( ) curDate = QDate::currentDate(); // set oldest date to draw - QDate minDate = curDate.addDays ( MAX_DAYS_HISTORY * -1 ); + QDate minDate = curDate.addDays ( MAX_DAYS_HISTORY * -1 ); // get oldest date in history QDate oldestDate = curDate.addDays ( 1 ); // one day in the future @@ -153,10 +153,12 @@ void AHistoryGraph::Update ( ) } } } - if (oldestDate < minDate) + + if ( oldestDate < minDate ) { oldestDate = minDate; } + const int iNumDaysInHistory = -curDate.daysTo ( oldestDate ) + 1; // draw frame of the graph @@ -166,7 +168,7 @@ void AHistoryGraph::Update ( ) for ( i = 0; i < iNumItemsForHistory; i++ ) { // only use valid dates - if ( vHistoryDataFifo[i].DateTime.date().isValid() && oldestDate <= vHistoryDataFifo[i].DateTime.date() ) + if ( vHistoryDataFifo[i].DateTime.date().isValid() && ( oldestDate <= vHistoryDataFifo[i].DateTime.date() ) ) { AddMarker ( vHistoryDataFifo[i] ); } diff --git a/src/historygraph.h b/src/historygraph.h index ddd54f36..cc03df97 100644 --- a/src/historygraph.h +++ b/src/historygraph.h @@ -45,6 +45,7 @@ /* Definitions ****************************************************************/ // number of history items to store #define NUM_ITEMS_HISTORY 4800 + // oldest item to draw #define MAX_DAYS_HISTORY 60