X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fwidgets%2FXCCalendarList.cpp;h=6fc7f7abc637c4f68143d511789bacad5f1336ef;hp=62efb9c7899c9b026ac9b2ffb2f990d440b5297d;hb=172322316537049f6ced59877a3b5bd3d2f64f2c;hpb=12c1ca8d2877104bd61b02ae72ef32314afeaa51 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