|
|
|
@ -276,21 +276,21 @@ void InterfaceStatistics::clearYearStatistics()
|
|
|
|
|
|
|
|
|
|
void InterfaceStatistics::checkCurrentEntry()
|
|
|
|
|
{
|
|
|
|
|
if ( mCurrentDay->day != TQDate::tqcurrentDate().day() ||
|
|
|
|
|
mCurrentDay->month != TQDate::tqcurrentDate().month() ||
|
|
|
|
|
mCurrentDay->year != TQDate::tqcurrentDate().year() )
|
|
|
|
|
if ( mCurrentDay->day != TQDate::currentDate().day() ||
|
|
|
|
|
mCurrentDay->month != TQDate::currentDate().month() ||
|
|
|
|
|
mCurrentDay->year != TQDate::currentDate().year() )
|
|
|
|
|
{
|
|
|
|
|
// current day has changed
|
|
|
|
|
updateCurrentDay();
|
|
|
|
|
|
|
|
|
|
if ( mCurrentMonth->month != TQDate::tqcurrentDate().month() ||
|
|
|
|
|
mCurrentMonth->year != TQDate::tqcurrentDate().year() )
|
|
|
|
|
if ( mCurrentMonth->month != TQDate::currentDate().month() ||
|
|
|
|
|
mCurrentMonth->year != TQDate::currentDate().year() )
|
|
|
|
|
{
|
|
|
|
|
// current month has also changed
|
|
|
|
|
updateCurrentMonth();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( mCurrentYear->year != TQDate::tqcurrentDate().year() )
|
|
|
|
|
if ( mCurrentYear->year != TQDate::currentDate().year() )
|
|
|
|
|
{
|
|
|
|
|
// current year has also changed
|
|
|
|
|
updateCurrentYear();
|
|
|
|
@ -312,9 +312,9 @@ void InterfaceStatistics::updateCurrentDay()
|
|
|
|
|
mCurrentDay = mDayStatistics.first();
|
|
|
|
|
while ( mCurrentDay )
|
|
|
|
|
{
|
|
|
|
|
if ( mCurrentDay->day == TQDate::tqcurrentDate().day() &&
|
|
|
|
|
mCurrentDay->month == TQDate::tqcurrentDate().month() &&
|
|
|
|
|
mCurrentDay->year == TQDate::tqcurrentDate().year() )
|
|
|
|
|
if ( mCurrentDay->day == TQDate::currentDate().day() &&
|
|
|
|
|
mCurrentDay->month == TQDate::currentDate().month() &&
|
|
|
|
|
mCurrentDay->year == TQDate::currentDate().year() )
|
|
|
|
|
{
|
|
|
|
|
// found current day in list
|
|
|
|
|
return;
|
|
|
|
@ -324,9 +324,9 @@ void InterfaceStatistics::updateCurrentDay()
|
|
|
|
|
|
|
|
|
|
// the current day is not in the list
|
|
|
|
|
mCurrentDay = new StatisticEntry();
|
|
|
|
|
mCurrentDay->day = TQDate::tqcurrentDate().day();
|
|
|
|
|
mCurrentDay->month = TQDate::tqcurrentDate().month();
|
|
|
|
|
mCurrentDay->year = TQDate::tqcurrentDate().year();
|
|
|
|
|
mCurrentDay->day = TQDate::currentDate().day();
|
|
|
|
|
mCurrentDay->month = TQDate::currentDate().month();
|
|
|
|
|
mCurrentDay->year = TQDate::currentDate().year();
|
|
|
|
|
mCurrentDay->rxBytes = 0;
|
|
|
|
|
mCurrentDay->txBytes = 0;
|
|
|
|
|
mDayStatistics.append( mCurrentDay ); // TODO: insert at correct position
|
|
|
|
@ -338,8 +338,8 @@ void InterfaceStatistics::updateCurrentMonth()
|
|
|
|
|
mCurrentMonth = mMonthStatistics.first();
|
|
|
|
|
while ( mCurrentMonth )
|
|
|
|
|
{
|
|
|
|
|
if ( mCurrentMonth->month == TQDate::tqcurrentDate().month() &&
|
|
|
|
|
mCurrentMonth->year == TQDate::tqcurrentDate().year() )
|
|
|
|
|
if ( mCurrentMonth->month == TQDate::currentDate().month() &&
|
|
|
|
|
mCurrentMonth->year == TQDate::currentDate().year() )
|
|
|
|
|
{
|
|
|
|
|
// found current month in list
|
|
|
|
|
return;
|
|
|
|
@ -350,8 +350,8 @@ void InterfaceStatistics::updateCurrentMonth()
|
|
|
|
|
// the current month is not in the list
|
|
|
|
|
mCurrentMonth = new StatisticEntry();
|
|
|
|
|
mCurrentMonth->day = 0;
|
|
|
|
|
mCurrentMonth->month = TQDate::tqcurrentDate().month();
|
|
|
|
|
mCurrentMonth->year = TQDate::tqcurrentDate().year();
|
|
|
|
|
mCurrentMonth->month = TQDate::currentDate().month();
|
|
|
|
|
mCurrentMonth->year = TQDate::currentDate().year();
|
|
|
|
|
mCurrentMonth->rxBytes = 0;
|
|
|
|
|
mCurrentMonth->txBytes = 0;
|
|
|
|
|
mMonthStatistics.append( mCurrentMonth ); // TODO: insert at correct position
|
|
|
|
@ -363,7 +363,7 @@ void InterfaceStatistics::updateCurrentYear()
|
|
|
|
|
mCurrentYear = mYearStatistics.first();
|
|
|
|
|
while ( mCurrentYear )
|
|
|
|
|
{
|
|
|
|
|
if ( mCurrentYear->year == TQDate::tqcurrentDate().year() )
|
|
|
|
|
if ( mCurrentYear->year == TQDate::currentDate().year() )
|
|
|
|
|
{
|
|
|
|
|
// found current year in list
|
|
|
|
|
return;
|
|
|
|
@ -375,7 +375,7 @@ void InterfaceStatistics::updateCurrentYear()
|
|
|
|
|
mCurrentYear = new StatisticEntry();
|
|
|
|
|
mCurrentYear->day = 0;
|
|
|
|
|
mCurrentYear->month = 0;
|
|
|
|
|
mCurrentYear->year = TQDate::tqcurrentDate().year();
|
|
|
|
|
mCurrentYear->year = TQDate::currentDate().year();
|
|
|
|
|
mCurrentYear->rxBytes = 0;
|
|
|
|
|
mCurrentYear->txBytes = 0;
|
|
|
|
|
mYearStatistics.append( mCurrentYear ); // TODO: insert at correct position
|
|
|
|
|