From 568c5250728f714fd3558108c0a28f5cd11d7db0 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 12 Mar 2010 00:35:38 +0000 Subject: [PATCH] MGR: Fix to my previous checkin: RefreshRPCs() shouldn't change zero time stamp svn path=/trunk/boinc/; revision=20862 --- checkin_notes | 8 ++++++ clientgui/MainDocument.cpp | 53 +++++++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/checkin_notes b/checkin_notes index fc130bd947..844ce38685 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1837,3 +1837,11 @@ David 11 Mar 2010 credit_test.cpp lib/ average.cpp,h + +Charlie 11 Mar 2010 + - MGR: Fix to my previous checkin: RefreshRPCs() shouldn't change time stamp + if it was zero, as this is a special vslue to indicate the RPC has never + been called. + + clientgui/ + MainDocument.cpp diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index d0afdd82f1..42ec483bd0 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -778,35 +778,52 @@ int CMainDocument::SetNetworkRunMode(int iMode, int iTimeout) { } -// Set last update time to (time_t)1 rather than (time_t)0, since -// we use 0 to indicate that this is the first time. +// We use 0 to indicate that the RPC has never been called yet, so +// set last update time to (time_t)1 here rather than to (time_t)0, +// and only if it is currently not zero. void CMainDocument::RefreshRPCs() { - m_dtCachedCCStatusTimestamp = wxDateTime((time_t)1); -// m_iGet_status_rpc_result = -1; + if (!m_dtCachedCCStatusTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtCachedCCStatusTimestamp = wxDateTime((time_t)1); +// m_iGet_status_rpc_result = -1; + } - m_dtProjectsStatusTimestamp = wxDateTime((time_t)1); -// m_iGet_project_status1_rpc_result = -1; + if (!m_dtProjectsStatusTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtProjectsStatusTimestamp = wxDateTime((time_t)1); +// m_iGet_project_status1_rpc_result = -1; + } - m_dtResultsTimestamp = wxDateTime((time_t)1); -// m_iGet_results_rpc_result = -1; + if (!m_dtResultsTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtResultsTimestamp = wxDateTime((time_t)1); +// m_iGet_results_rpc_result = -1; + } - m_dtFileTransfersTimestamp = wxDateTime((time_t)1); -// m_iGet_file_transfers_rpc_result = 0; + if (!m_dtFileTransfersTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtFileTransfersTimestamp = wxDateTime((time_t)1); +// m_iGet_file_transfers_rpc_result = 0; + } // m_iGet_messages_rpc_result = -1; - m_dtDiskUsageTimestamp = wxDateTime((time_t)1); -// m_iGet_dsk_usage_rpc_result = -1; + if (!m_dtDiskUsageTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtDiskUsageTimestamp = wxDateTime((time_t)1); +// m_iGet_dsk_usage_rpc_result = -1; + } - m_dtStatisticsStatusTimestamp = wxDateTime((time_t)1); -// m_iGet_statistics_rpc_result = -1; + if (!m_dtStatisticsStatusTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtStatisticsStatusTimestamp = wxDateTime((time_t)1); +// m_iGet_statistics_rpc_result = -1; + } - m_dtCachedSimpleGUITimestamp = wxDateTime((time_t)1); -// m_iGet_simple_gui2_rpc_result = -1; + if (!m_dtCachedSimpleGUITimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtCachedSimpleGUITimestamp = wxDateTime((time_t)1); +// m_iGet_simple_gui2_rpc_result = -1; + } - m_dtCachedAcctMgrInfoTimestamp = wxDateTime((time_t)1); - m_iAcct_mgr_info_rpc_result = -1; + if (!m_dtCachedAcctMgrInfoTimestamp.IsEqualTo(wxDateTime((time_t)0))) { + m_dtCachedAcctMgrInfoTimestamp = wxDateTime((time_t)1); + m_iAcct_mgr_info_rpc_result = -1; + } // m_iGet_state_rpc_result = -1; }