X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fwidgets%2FXCCalendarList.cpp;h=6fc7f7abc637c4f68143d511789bacad5f1336ef;hb=172322316537049f6ced59877a3b5bd3d2f64f2c;hp=62efb9c7899c9b026ac9b2ffb2f990d440b5297d;hpb=339434b90a0a03c3102b82a5dc45334b338bc59c;p=xestiacalendar%2F.git diff --git a/source/widgets/XCCalendarList.cpp b/source/widgets/XCCalendarList.cpp index 62efb9c..6fc7f7a 100644 --- a/source/widgets/XCCalendarList.cpp +++ b/source/widgets/XCCalendarList.cpp @@ -44,7 +44,27 @@ XCCalendarList::~XCCalendarList(){ void XCCalendarList::UpdateCalendarList(CalendarDataStorage *dataStorage){ - // TODO: Verify if the generated code has changed. + // Verify if the generated code has changed. Return if not. + + CDSGetChecksumResult currentChecksum = dataStorage->GetChecksum("internal_updatedata"); + + if (checksumUpdate == currentChecksum.checksumValue){ + + // Checksum matches so return. + return; + + } + + // TODO: Delete the old controls. + + for (vector::iterator accountCtrlIter = accountControlList.begin(); + accountCtrlIter != accountControlList.end(); accountCtrlIter++){ + + delete *accountCtrlIter; + + } + + accountControlList.clear(); // Get the list of accounts and create them one by one. @@ -78,4 +98,8 @@ void XCCalendarList::UpdateCalendarList(CalendarDataStorage *dataStorage){ } + // Set the updated checksum. + + checksumUpdate = currentChecksum.checksumValue; + } \ No newline at end of file