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<XCCalendarListAccountCtrl*>::iterator accountCtrlIter = accountControlList.begin();
+ accountCtrlIter != accountControlList.end(); accountCtrlIter++){
+
+ delete *accountCtrlIter;
+
+ }
+
+ accountControlList.clear();
// Get the list of accounts and create them one by one.
}
+ // Set the updated checksum.
+
+ checksumUpdate = currentChecksum.checksumValue;
+
}
\ No newline at end of file
wxScrolledWindow *scwMain = nullptr;
wxBoxSizer *szrScrolled = nullptr;
std::vector<XCCalendarListAccountCtrl*> accountControlList;
+ std::string checksumUpdate = "";
protected:
-
public:
XCCalendarList(wxWindow *parent);
void UpdateCalendarList(CalendarDataStorage *dataStorage);