Commit 10945ff6 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fix QString -> char*

parent 37625570
...@@ -429,12 +429,19 @@ void WdaQt::open_class_dialog(char* hierstr, char* classstr, char* namestr) ...@@ -429,12 +429,19 @@ void WdaQt::open_class_dialog(char* hierstr, char* classstr, char* namestr)
int res = wdaclass_dia.exec(); int res = wdaclass_dia.exec();
if (res == QDialog::Accepted) { if (res == QDialog::Accepted) {
char* hiername = qPrintableLatin1(wdaclass_hiervalue->text()); char* hiername = (char*)malloc(wdaclass_hiervalue->text().length() + 1);
char* searchname = qPrintableLatin1(wdaclass_namevalue->text()); char* searchname = (char*)malloc(wdaclass_namevalue->text().length() + 1);
char* classname = qPrintableLatin1(wdaclass_classvalue->text()); char* classname = (char*)malloc(wdaclass_classvalue->text().length() + 1);
strcpy(hiername, qPrintableLatin1(wdaclass_hiervalue->text()));
strcpy(searchname, qPrintableLatin1(wdaclass_namevalue->text()));
strcpy(classname, qPrintableLatin1(wdaclass_classvalue->text()));
bool attrobjects = wdaclass_attrobjects->isChecked(); bool attrobjects = wdaclass_attrobjects->isChecked();
toplevel->class_activate_ok(hiername, searchname, classname, attrobjects); toplevel->class_activate_ok(hiername, searchname, classname, attrobjects);
free(hiername);
free(searchname);
free(classname);
} }
} }
......
...@@ -371,15 +371,24 @@ void HistQtWidget::ok_btn() ...@@ -371,15 +371,24 @@ void HistQtWidget::ok_btn()
hist->eventPrio_D = hist->prioD_toggle_w->isChecked(); hist->eventPrio_D = hist->prioD_toggle_w->isChecked();
hist->minTime_str = (char*)malloc(hist->start_time_entry_w->text().length() + 1); hist->minTime_str = (char*)malloc(hist->start_time_entry_w->text().length() + 1);
strcpy(hist->minTime_str, qPrintableLatin1(hist->start_time_entry_w->text()));
hist->maxTime_str = (char*)malloc(hist->stop_time_entry_w->text().length() + 1); hist->maxTime_str = (char*)malloc(hist->stop_time_entry_w->text().length() + 1);
strcpy(hist->maxTime_str, qPrintableLatin1(hist->stop_time_entry_w->text()));
hist->eventText_str = (char*)malloc(hist->event_text_entry_w->text().length() + 1); hist->eventText_str = (char*)malloc(hist->event_text_entry_w->text().length() + 1);
strcpy(hist->eventText_str, qPrintableLatin1(hist->event_text_entry_w->text()));
hist->eventName_str = (char*)malloc(hist->event_name_entry_w->text().length() + 1); hist->eventName_str = (char*)malloc(hist->event_name_entry_w->text().length() + 1);
strcpy(hist->minTime_str, qPrintableLatin1(hist->start_time_entry_w->text()));
strcpy(hist->maxTime_str, qPrintableLatin1(hist->stop_time_entry_w->text()));
strcpy(hist->eventText_str, qPrintableLatin1(hist->event_text_entry_w->text()));
strcpy(hist->eventName_str, qPrintableLatin1(hist->event_name_entry_w->text())); strcpy(hist->eventName_str, qPrintableLatin1(hist->event_name_entry_w->text()));
hist->get_hist_list(); hist->get_hist_list();
free(hist->minTime_str);
free(hist->maxTime_str);
free(hist->eventText_str);
free(hist->eventName_str);
hist->minTime_str = NULL;
hist->maxTime_str = NULL;
hist->eventText_str = NULL;
hist->eventName_str = NULL;
} }
void HistQtWidget::activate_print() void HistQtWidget::activate_print()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment