for (int accountSeek = 0; accountSeek < accountCount; accountSeek++){
- CDSAccountResult addResult = calendarData.AddAccount(string(preferences->accounts.GetAccountName(accountSeek).mb_str()), accountSeek);
+ CDSAccountResult addResult = calendarData.AddAccount(string(preferences->accounts.GetAccountName(accountSeek).ToUTF8()), accountSeek);
}
for (int accountSeek = 0; accountSeek < accountCount; accountSeek++){
- CDSGetAccountInfo accountInfo = calendarData.GetAccount(string(preferences->accounts.GetAccountName(accountSeek).mb_str()));
+ CDSGetAccountInfo accountInfo = calendarData.GetAccount(string(preferences->accounts.GetAccountName(accountSeek).ToUTF8()));
// Build the path.
// Find the entries and load each entry.
- string calendarListDirectory = calendarListFilename;
+ wxString calendarListDirectory = wxString(calendarListFilename.c_str(), wxConvUTF8);
calendarListDirectory += "/";
- calendarListDirectory += calendarList.calendarShortName[calendarSeek];
+ calendarListDirectory += wxString(calendarList.calendarShortName[calendarSeek].c_str(), wxConvUTF8);
calendarListDirectory += "/";
wxDir entryListDirectory(calendarListDirectory);
while (continueProcessing){
string entryListFullFilename;
- entryListFullFilename += calendarListDirectory;
- entryListFullFilename += string(entryListFilename.mb_str());
+ entryListFullFilename += string(calendarListDirectory.ToUTF8());
+ entryListFullFilename += string(entryListFilename.ToUTF8());
continueProcessing = entryListDirectory.GetNext(&entryListFilename);
CDSAddEntryResult addEventResult = calendarData.AddEvent(calendarInfo.calendarID, entryListFullFilename);
accountDirectoryPath += "accounts/";
accountDirectoryPath += string(preferences->accounts.GetAccountDirectory(calendarEventInfo->accountPreferencesID).ToUTF8());
accountDirectoryPath += ".";
- accountDirectoryPath += string(preferences->accounts.GetAccountType(calendarEventInfo->accountPreferencesID).mb_str());
+ accountDirectoryPath += string(preferences->accounts.GetAccountType(calendarEventInfo->accountPreferencesID).ToUTF8());
accountDirectoryPath += "/";
string calendarListFilenameFull = accountDirectoryPath;
string calendarDirectoryPath = accountDirectoryPath;
calendarDirectoryPath += calendarInfo.calendarTextID;
- wxFileConfig *calendarListFile = new wxFileConfig("", "", wxString(calendarListFilenameFull));
+ wxFileConfig *calendarListFile = new wxFileConfig("", "", wxString(calendarListFilenameFull.c_str(), wxConvUTF8));
// Delete the calendar directory.
// Delete the calendar directory.
- //wxRmdir(wxString(calendarDirectoryPath.c_str(), wxConvUTF8));
+ wxRmDir(wxString(calendarDirectoryPath.c_str(), wxConvUTF8));
delete calendarListFile;
calendarListFile = nullptr;
CDSGetCalendarEntryInfo eventDeleteData = calendarData.GetEvent(eventInfo->eventID);
CDSGetCalendarInfo calendarDeleteData = calendarData.GetCalendar(eventInfo->calendarID);
- if (wxMessageBox(wxString::Format("Are you sure you want to delete the event %s from the %s calendar?", eventDeleteData.entryName, calendarDeleteData.calendarName), "Delete event", wxYES_NO|wxICON_QUESTION) == wxNO){
+ if (wxMessageBox(wxString::Format("Are you sure you want to delete the event %s from the %s calendar?", wxString(eventDeleteData.entryName.c_str(), wxConvUTF8), wxString(calendarDeleteData.calendarName.c_str(), wxConvUTF8)), "Delete event", wxYES_NO|wxICON_QUESTION) == wxNO){
return;
}
// Get the filename and delete the entry.
- wxRemoveFile(wxString(eventDeleteData.entryFilename.c_str()));
+ wxRemoveFile(wxString(eventDeleteData.entryFilename.c_str(), wxConvUTF8));
// Delete the entry from the calendar data storage.