some pointers checking, still bugged
This commit is contained in:
parent
375b72feac
commit
e67505b9ee
|
@ -10,8 +10,10 @@ void CalendarManager::setCalendar(std::string html)
|
||||||
{
|
{
|
||||||
caliSchedPtr->setPage(html);
|
caliSchedPtr->setPage(html);
|
||||||
}
|
}
|
||||||
void CalendarManager::exportCalendarCSV()
|
void CalendarManager::exportCalendarCSV() //need to add fix to the null pointer bug
|
||||||
{
|
{
|
||||||
|
if (caliSchedPtr->getCourses()->empty())
|
||||||
|
return;
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
int buttonClicked = caliDialog->exec();
|
int buttonClicked = caliDialog->exec();
|
||||||
if (buttonClicked == 0) //cancel?
|
if (buttonClicked == 0) //cancel?
|
||||||
|
|
|
@ -7,6 +7,8 @@ CSV_Exporter::CSV_Exporter()
|
||||||
|
|
||||||
bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *cal)
|
bool CSV_Exporter::exportCalendar(calendarSchedule *calSched, CalendarDialog *cal)
|
||||||
{
|
{
|
||||||
|
if ((cal == NULL) || (calSched == NULL) || (calSched->getCourses() == NULL)) //pointers checking!
|
||||||
|
return false;
|
||||||
qDebug() << "Getting path for csv file from user...";
|
qDebug() << "Getting path for csv file from user...";
|
||||||
QString filePath = getFileFath();
|
QString filePath = getFileFath();
|
||||||
if(filePath == NULL) //User canceled
|
if(filePath == NULL) //User canceled
|
||||||
|
|
Loading…
Reference in a new issue