// CalendarList.cpp - Account calendar list. // // (c) 2016-2017 Xestia Software Development. // // This file is part of Xestia Calendar. // // Xestia Calendar is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // // Xestia Calendar is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with Xestia Calendar. If not, see #include "CalendarList.h" using namespace std; XCAccountCalendarList::XCAccountCalendarList(string calendarListFilename){ // Load the account calendar list. wxString calendarListFilenameFull; calendarListFilenameFull.Append(wxString(calendarListFilename.c_str(), wxConvUTF8)); calendarListFilenameFull.Append(wxT("/calendarlist.db")); wxFileConfig *calendarListFile = new wxFileConfig("", "", calendarListFilenameFull); // Go through the list of calendars. bool continueProcessing = true; wxString accountName; long itemIndex =0; continueProcessing = calendarListFile->GetFirstGroup(accountName, itemIndex); while (continueProcessing){ wxString valueData; Colour colourData; calendarListFile->SetPath(accountName); calendarShortName.push_back(string(accountName.ToUTF8())); calendarListFile->Read(wxT("name"), &valueData); calendarName.push_back(string(valueData.ToUTF8())); calendarListFile->Read(wxT("description"), &valueData); calendarDescription.push_back(string(valueData.ToUTF8())); calendarListFile->Read(wxT("colour"), &valueData); colourData = string(valueData.mb_str()); calendarColour.push_back(colourData); calendarStorageID.push_back(0); accountName.clear(); calendarListFile->SetPath(wxT("/")); continueProcessing = calendarListFile->GetNextGroup(accountName, itemIndex); } } XCAccountCalendarList::~XCAccountCalendarList(){ }