Commit 0ce59d1a authored by Christoffer Ackelman's avatar Christoffer Ackelman

Replaced .toLocal8Bit().data() with qPrintable()

parent 0b796438
...@@ -182,8 +182,7 @@ void GsdAttrQtWidget::activate_cmd_input() ...@@ -182,8 +182,7 @@ void GsdAttrQtWidget::activate_cmd_input()
attr->attrnav->set_inputfocus(); attr->attrnav->set_inputfocus();
if (attr->input_open) { if (attr->input_open) {
QByteArray text = attr->cmd_input->text().toLocal8Bit(); attr->attrnav->set_attr_value(qPrintable(attr->cmd_input->text()));
attr->attrnav->set_attr_value(text.data());
attr->cmd_input->setVisible(false); attr->cmd_input->setVisible(false);
attr->set_prompt(""); attr->set_prompt("");
attr->input_open = 0; attr->input_open = 0;
......
...@@ -221,8 +221,7 @@ void GsdmlAttrQtWidget::activate_cmd_entry() ...@@ -221,8 +221,7 @@ void GsdmlAttrQtWidget::activate_cmd_entry()
attr->attrnav->set_inputfocus(); attr->attrnav->set_inputfocus();
if (attr->input_open) { if (attr->input_open) {
QByteArray text = attr->cmd_entry->text().toLocal8Bit(); attr->attrnav->set_attr_value(qPrintable(attr->cmd_entry->text()));
attr->attrnav->set_attr_value(text.data());
attr->cmd_entry->setVisible(false); attr->cmd_entry->setVisible(false);
attr->set_prompt(""); attr->set_prompt("");
attr->input_open = 0; attr->input_open = 0;
......
...@@ -113,7 +113,7 @@ static char null_str[] = ""; ...@@ -113,7 +113,7 @@ static char null_str[] = "";
// //
// Convert attribute string to value // Convert attribute string to value
// //
int GsdAttrNav::attr_string_to_value(int type_id, char* value_str, int GsdAttrNav::attr_string_to_value(int type_id, const char* value_str,
void* buffer_ptr, int buff_size, int attr_size) void* buffer_ptr, int buff_size, int attr_size)
{ {
switch (type_id) { switch (type_id) {
...@@ -485,7 +485,7 @@ int GsdAttrNav::get_select(ItemPb** item) ...@@ -485,7 +485,7 @@ int GsdAttrNav::get_select(ItemPb** item)
// //
// Set attribute value // Set attribute value
// //
int GsdAttrNav::set_attr_value(char* value_str) int GsdAttrNav::set_attr_value(const char* value_str)
{ {
brow_tNode* node_list; brow_tNode* node_list;
int node_count; int node_count;
......
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
} }
void start_trace(pwr_tObjid Objid, char* object_str); void start_trace(pwr_tObjid Objid, char* object_str);
int set_attr_value(char* value_str); int set_attr_value(const char* value_str);
int check_attr_value(char** value); int check_attr_value(char** value);
int get_select(pwr_sAttrRef* attrref, int* is_attr); int get_select(pwr_sAttrRef* attrref, int* is_attr);
void message(char sev, const char* text); void message(char sev, const char* text);
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
flow_eTraceType type, void** p); flow_eTraceType type, void** p);
static int trace_disconnect_bc(brow_tObject object); static int trace_disconnect_bc(brow_tObject object);
static int init_brow_cb(FlowCtx* fctx, void* client_data); static int init_brow_cb(FlowCtx* fctx, void* client_data);
static int attr_string_to_value(int type_id, char* value_str, static int attr_string_to_value(int type_id, const char* value_str,
void* buffer_ptr, int buff_size, int attr_size); void* buffer_ptr, int buff_size, int attr_size);
static void attrvalue_to_string(int type_id, void* value_ptr, char* str, static void attrvalue_to_string(int type_id, void* value_ptr, char* str,
int size, int* len, char* format); int size, int* len, char* format);
......
...@@ -2254,7 +2254,7 @@ int pn_gsdml::datavalue_to_string(gsdml_eValueDataType datatype, void* value, ...@@ -2254,7 +2254,7 @@ int pn_gsdml::datavalue_to_string(gsdml_eValueDataType datatype, void* value,
} }
int pn_gsdml::string_to_datavalue( int pn_gsdml::string_to_datavalue(
gsdml_eValueDataType datatype, void* value, unsigned int size, char* str) gsdml_eValueDataType datatype, void* value, unsigned int size, const char* str)
{ {
switch (datatype) { switch (datatype) {
case gsdml_eValueDataType_Integer8: case gsdml_eValueDataType_Integer8:
......
...@@ -1569,7 +1569,7 @@ public: ...@@ -1569,7 +1569,7 @@ public:
int datavalue_to_string(gsdml_eValueDataType datatype, void* value, int datavalue_to_string(gsdml_eValueDataType datatype, void* value,
unsigned int size, char* str, unsigned int strsize); unsigned int size, char* str, unsigned int strsize);
int string_to_datavalue( int string_to_datavalue(
gsdml_eValueDataType datatype, void* value, unsigned int size, char* str); gsdml_eValueDataType datatype, void* value, unsigned int size, const char* str);
int get_datavalue_length( int get_datavalue_length(
gsdml_eValueDataType datatype, int strlength, unsigned int* len); gsdml_eValueDataType datatype, int strlength, unsigned int* len);
void set_classes(gsdml_sModuleClass* mclist) void set_classes(gsdml_sModuleClass* mclist)
......
...@@ -112,7 +112,7 @@ static char null_str[] = ""; ...@@ -112,7 +112,7 @@ static char null_str[] = "";
// //
// Convert attribute string to value // Convert attribute string to value
// //
int GsdmlAttrNav::attr_string_to_value(int type_id, char* value_str, int GsdmlAttrNav::attr_string_to_value(int type_id, const char* value_str,
void* buffer_ptr, int buff_size, int attr_size) void* buffer_ptr, int buff_size, int attr_size)
{ {
switch (type_id) { switch (type_id) {
...@@ -577,7 +577,7 @@ int GsdmlAttrNav::get_select(ItemPn** item) ...@@ -577,7 +577,7 @@ int GsdmlAttrNav::get_select(ItemPn** item)
// //
// Set attribute value // Set attribute value
// //
int GsdmlAttrNav::set_attr_value(char* value_str) int GsdmlAttrNav::set_attr_value(const char* value_str)
{ {
brow_tNode* node_list; brow_tNode* node_list;
int node_count; int node_count;
...@@ -1961,7 +1961,7 @@ int ItemPnBase::scan(GsdmlAttrNav* attrnav, void* p) ...@@ -1961,7 +1961,7 @@ int ItemPnBase::scan(GsdmlAttrNav* attrnav, void* p)
return 1; return 1;
} }
void ItemPnBase::value_changed(GsdmlAttrNav* attrnav, char* value_str) void ItemPnBase::value_changed(GsdmlAttrNav* attrnav, const char* value_str)
{ {
char buffer[1024]; char buffer[1024];
int sts; int sts;
...@@ -4001,7 +4001,7 @@ int ItemPnParValue::scan(GsdmlAttrNav* attrnav, void* p) ...@@ -4001,7 +4001,7 @@ int ItemPnParValue::scan(GsdmlAttrNav* attrnav, void* p)
return 1; return 1;
} }
void ItemPnParValue::value_changed(GsdmlAttrNav* attrnav, char* value_str) void ItemPnParValue::value_changed(GsdmlAttrNav* attrnav, const char* value_str)
{ {
int sts; int sts;
......
...@@ -157,7 +157,7 @@ public: ...@@ -157,7 +157,7 @@ public:
} }
void start_trace(pwr_tObjid Objid, char* object_str); void start_trace(pwr_tObjid Objid, char* object_str);
int set_attr_value(char* value_str); int set_attr_value(const char* value_str);
int check_attr_value(char** value); int check_attr_value(char** value);
int get_select(pwr_sAttrRef* attrref, int* is_attr); int get_select(pwr_sAttrRef* attrref, int* is_attr);
void message(char sev, const char* text); void message(char sev, const char* text);
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
flow_eTraceType type, void** p); flow_eTraceType type, void** p);
static int trace_disconnect_bc(brow_tObject object); static int trace_disconnect_bc(brow_tObject object);
static int init_brow_cb(FlowCtx* fctx, void* client_data); static int init_brow_cb(FlowCtx* fctx, void* client_data);
static int attr_string_to_value(int type_id, char* value_str, static int attr_string_to_value(int type_id, const char* value_str,
void* buffer_ptr, int buff_size, int attr_size); void* buffer_ptr, int buff_size, int attr_size);
static void attrvalue_to_string(int type_id, void* value_ptr, char* str, static void attrvalue_to_string(int type_id, void* value_ptr, char* str,
int size, int* len, char* format); int size, int* len, char* format);
...@@ -239,7 +239,7 @@ public: ...@@ -239,7 +239,7 @@ public:
virtual void update(GsdmlAttrNav* attrnav) virtual void update(GsdmlAttrNav* attrnav)
{ {
} }
virtual void value_changed(GsdmlAttrNav* attrnav, char* value_str) virtual void value_changed(GsdmlAttrNav* attrnav, const char* value_str)
{ {
} }
}; };
...@@ -262,7 +262,7 @@ public: ...@@ -262,7 +262,7 @@ public:
int subgraph; int subgraph;
virtual int scan(GsdmlAttrNav* attrnav, void* p); virtual int scan(GsdmlAttrNav* attrnav, void* p);
virtual void value_changed(GsdmlAttrNav* attrnav, char* value_str); virtual void value_changed(GsdmlAttrNav* attrnav, const char* value_str);
}; };
//! Item for an enum attribute. //! Item for an enum attribute.
...@@ -524,7 +524,7 @@ public: ...@@ -524,7 +524,7 @@ public:
int noedit; int noedit;
int scan(GsdmlAttrNav* attrnav, void* p); int scan(GsdmlAttrNav* attrnav, void* p);
void value_changed(GsdmlAttrNav* attrnav, char* value_str); void value_changed(GsdmlAttrNav* attrnav, const char* value_str);
}; };
class ParEnumValue { class ParEnumValue {
......
...@@ -591,7 +591,7 @@ void WUtedGtk::set_command_window(char* cmd) ...@@ -591,7 +591,7 @@ void WUtedGtk::set_command_window(char* cmd)
{ {
} }
void WUtedGtk::configure_quals(char* label) void WUtedGtk::configure_quals(const char* label)
{ {
int i; int i;
int index; int index;
......
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
void raise_window(); void raise_window();
void clock_cursor(); void clock_cursor();
void reset_cursor(); void reset_cursor();
void configure_quals(char* label); void configure_quals(const char* label);
void enable_entries(int enable); void enable_entries(int enable);
void get_value(int idx, char* str, int len); void get_value(int idx, char* str, int len);
void questionbox(char* question_title, char* question_text, void questionbox(char* question_title, char* question_text,
......
...@@ -907,7 +907,7 @@ void WUtedMotif::set_command_window(char* cmd) ...@@ -907,7 +907,7 @@ void WUtedMotif::set_command_window(char* cmd)
XmStringFree(cstr); XmStringFree(cstr);
} }
void WUtedMotif::configure_quals(char* label) void WUtedMotif::configure_quals(const char* label)
{ {
Arg arg[1]; Arg arg[1];
Arg args[1]; Arg args[1];
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
void raise_window(); void raise_window();
void clock_cursor(); void clock_cursor();
void reset_cursor(); void reset_cursor();
void configure_quals(char* label); void configure_quals(const char* label);
void enable_entries(int enable); void enable_entries(int enable);
void get_value(int idx, char* str, int len); void get_value(int idx, char* str, int len);
void questionbox(char* question_title, char* question_text, void questionbox(char* question_title, char* question_text,
......
...@@ -523,8 +523,7 @@ int WFoeQt::modify_popup(unsigned long popupmenu_mask, int x, int y) ...@@ -523,8 +523,7 @@ int WFoeQt::modify_popup(unsigned long popupmenu_mask, int x, int y)
QMenu* menu = new QMenu(toplevel); QMenu* menu = new QMenu(toplevel);
for (int i = 0; i < bsize; i++) { for (int i = 0; i < bsize; i++) {
if (popupmenu_mask & (1 << i)) { if (popupmenu_mask & (1 << i)) {
QByteArray ba = menu_callbacks[i].toLocal8Bit(); addMenuItem(toplevel, menu, buttontext[i], qPrintable(menu_callbacks[i]));
addMenuItem(toplevel, menu, buttontext[i], ba.data());
} }
} }
...@@ -922,9 +921,8 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb, ...@@ -922,9 +921,8 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb,
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
double num = pow(2, i) / (16 * 5); double num = pow(2, i) / (16 * 5);
QString txt = QString::number(i + 1).prepend('_'); QString txt = QString::number(i + 1).prepend('_');
QByteArray ba = txt.toLocal8Bit(); QAction* view_gs_t = addMenuRadioItem(toplevel, view_gs, qPrintable(txt),
QAction* view_gs_t = addMenuRadioItem( SLOT(activate_gridsize()), view_gs_group);
toplevel, view_gs, ba.data(), SLOT(activate_gridsize()), view_gs_group);
view_gs_t->setData(num); view_gs_t->setData(num);
} }
......
...@@ -82,8 +82,7 @@ void WUtedQtWidget::activate_command() ...@@ -82,8 +82,7 @@ void WUtedQtWidget::activate_command()
for (int j = 0; uted->optmenubuttons[j]; j++) { for (int j = 0; uted->optmenubuttons[j]; j++) {
if (sender() == uted->optmenubuttons[j]) { if (sender() == uted->optmenubuttons[j]) {
QByteArray label = uted->optmenubuttons[j]->text().toLocal8Bit(); uted->configure_quals(qPrintable(uted->optmenubuttons[j]->text()));
uted->configure_quals(label.data());
} }
} }
} }
...@@ -347,7 +346,7 @@ void WUtedQt::set_command_window(char* cmd) ...@@ -347,7 +346,7 @@ void WUtedQt::set_command_window(char* cmd)
{ {
} }
void WUtedQt::configure_quals(char* label) void WUtedQt::configure_quals(const char* label)
{ {
int i; int i;
int index; int index;
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
void raise_window(); void raise_window();
void clock_cursor(); void clock_cursor();
void reset_cursor(); void reset_cursor();
void configure_quals(char* label); void configure_quals(const char* label);
void enable_entries(int enable); void enable_entries(int enable);
void get_value(int idx, char* str, int len); void get_value(int idx, char* str, int len);
void questionbox(char* question_title, char* question_text, void questionbox(char* question_title, char* question_text,
......
...@@ -77,8 +77,7 @@ void WVselQtWidget::activate_ok() ...@@ -77,8 +77,7 @@ void WVselQtWidget::activate_ok()
char selected_text[80]; char selected_text[80];
QList<QTreeWidgetItem*> selection = sel->volumelist->selectedItems(); QList<QTreeWidgetItem*> selection = sel->volumelist->selectedItems();
if (selection.size() > 0) { if (selection.size() > 0) {
QByteArray text = selection[0]->text(0).toLocal8Bit(); strcpy(selected_text, qPrintable(selection[0]->text(0)));
strcpy(selected_text, text.data());
} }
pwr_tVid vid; pwr_tVid vid;
......
...@@ -437,7 +437,7 @@ int WUted::execute(int show) ...@@ -437,7 +437,7 @@ int WUted::execute(int show)
return FOE__SUCCESS; return FOE__SUCCESS;
} }
pwr_tStatus WUted::get_command_index(char* label, int* index) pwr_tStatus WUted::get_command_index(const char* label, int* index)
{ {
uted_sCommand* command_ptr; uted_sCommand* command_ptr;
int i; int i;
......
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
virtual void reset_cursor() virtual void reset_cursor()
{ {
} }
virtual void configure_quals(char* label) virtual void configure_quals(const char* label)
{ {
} }
virtual void enable_entries(int enable) virtual void enable_entries(int enable)
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
} }
static void get_message_error(pwr_tStatus sts, char* str); static void get_message_error(pwr_tStatus sts, char* str);
static pwr_tStatus get_command_index(char* label, int* index); static pwr_tStatus get_command_index(const char* label, int* index);
static void get_filename(char* filename); static void get_filename(char* filename);
}; };
......
...@@ -173,8 +173,7 @@ void XttQt::open_change_value() ...@@ -173,8 +173,7 @@ void XttQt::open_change_value()
cmd_entry->setFocus(); cmd_entry->setFocus();
cmd_entry->setText(""); cmd_entry->setText("");
QByteArray ba = translate_utf8("value >").toLocal8Bit(); set_prompt(qPrintable(translate_utf8("value >")));
set_prompt(ba.data());
input_open = 1; input_open = 1;
} }
......
...@@ -183,12 +183,10 @@ pwr_tStatus CoLoginQt::get_values() ...@@ -183,12 +183,10 @@ pwr_tStatus CoLoginQt::get_values()
char user[40]; char user[40];
/* Get UserName */ /* Get UserName */
QByteArray ba = username->text().toLocal8Bit(); strcpy(user, qPrintable(username->text()));
strcpy(user, ba.data());
/* Get Password */ /* Get Password */
ba = password->text().toLocal8Bit(); strcpy(passwd, qPrintable(password->text()));
strcpy(passwd, ba.data());
pwr_tStatus sts = user_check(groupname, user, passwd); pwr_tStatus sts = user_check(groupname, user, passwd);
if (EVEN(sts)) { if (EVEN(sts)) {
......
...@@ -134,8 +134,7 @@ void MsgWindowQt::print() ...@@ -134,8 +134,7 @@ void MsgWindowQt::print()
pwr_tStatus sts; pwr_tStatus sts;
char title[80]; char title[80];
QByteArray ba = translate_utf8(name).toLocal8Bit(); strncpy(title, qPrintable(translate_utf8(name)), sizeof(title));
strncpy(title, ba.data(), sizeof(title));
CoWowQt::CreateBrowPrintDialogQt(title, msgnav->brow->ctx, CoWowQt::CreateBrowPrintDialogQt(title, msgnav->brow->ctx,
flow_eOrientation_Landscape, 1.4, toplevel, &sts); flow_eOrientation_Landscape, 1.4, toplevel, &sts);
......
...@@ -87,9 +87,7 @@ void dbg_print(const char* file, int line, QString str) ...@@ -87,9 +87,7 @@ void dbg_print(const char* file, int line, QString str)
file2 = file2 ? (file2 + 1) : file; file2 = file2 ? (file2 + 1) : file;
fprintf(stderr, " %s:%d: ", file2, line); fprintf(stderr, " %s:%d: ", file2, line);
// 3. print the actual debug message // 3. print the actual debug message
QByteArray ba = str.toLocal8Bit(); fprintf(stderr, "%s\n", qPrintable(str));
const char* c_str = ba.data();
fprintf(stderr, "%s\n", c_str);
} }
} }
......
...@@ -528,8 +528,7 @@ void CoWowQt::CreateFileSelDia(const char* title, void* parent_ctx, ...@@ -528,8 +528,7 @@ void CoWowQt::CreateFileSelDia(const char* title, void* parent_ctx,
object->parent_wid, fl(title), fl(folder), filter); object->parent_wid, fl(title), fl(folder), filter);
if (!filename.isNull()) { if (!filename.isNull()) {
QByteArray ba = filename.toLocal8Bit(); strcpy(fname, qPrintable(filename));
strcpy(fname, ba.data());
} }
if (file_selected_cb) { if (file_selected_cb) {
...@@ -671,8 +670,7 @@ void CoWowEntryQt::keyPressEvent(QKeyEvent* event) ...@@ -671,8 +670,7 @@ void CoWowEntryQt::keyPressEvent(QKeyEvent* event)
for (int i = m_re->m_recall_size - 2; i >= 0; i--) { for (int i = m_re->m_recall_size - 2; i >= 0; i--) {
strcpy(m_re->m_recall[i + 1], m_re->m_recall[i]); strcpy(m_re->m_recall[i + 1], m_re->m_recall[i]);
} }
QByteArray ba = txt.toLocal8Bit(); strncpy(m_re->m_recall[0], qPrintable(txt), m_re->m_line_size);
strncpy(m_re->m_recall[0], ba.data(), m_re->m_line_size);
m_re->m_recall[0][m_re->m_line_size - 1] = 0; m_re->m_recall[0][m_re->m_line_size - 1] = 0;
} }
m_re->m_current_recall_line = 0; m_re->m_current_recall_line = 0;
......
...@@ -153,8 +153,7 @@ void CoXHelpQt::print() ...@@ -153,8 +153,7 @@ void CoXHelpQt::print()
pwr_tStatus sts; pwr_tStatus sts;
char title[80]; char title[80];
QByteArray ba = translate_utf8("Help").toLocal8Bit(); strcpy(title, qPrintable(translate_utf8("Help")));
strcpy(title, ba.data());
CoWowQt::CreateBrowPrintDialogQt(title, xhelpnav->brow->ctx, CoWowQt::CreateBrowPrintDialogQt(title, xhelpnav->brow->ctx,
flow_eOrientation_Portrait, 0.7, toplevel, &sts); flow_eOrientation_Portrait, 0.7, toplevel, &sts);
......
...@@ -372,16 +372,15 @@ void GeCurveQtWidget::activate_export_ok() ...@@ -372,16 +372,15 @@ void GeCurveQtWidget::activate_export_ok()
} }
if (curve->layout_mask & curve_mEnable_ExportTime) { if (curve->layout_mask & curve_mEnable_ExportTime) {
QByteArray ba = curve->export_fromtime_widget->text().toLocal8Bit(); sts = time_AsciiToA(
sts = time_AsciiToA(ba.data(), &from); qPrintable(curve->export_fromtime_widget->text()), &from);
if (EVEN(sts)) { if (EVEN(sts)) {
curve->wow->DisplayError("Syntax Error", "From time syntax error"); curve->wow->DisplayError("Syntax Error", "From time syntax error");
return; return;
} }
ba = curve->export_totime_widget->text().toLocal8Bit(); sts = time_AsciiToA(qPrintable(curve->export_totime_widget->text()), &to);
sts = time_AsciiToA(ba.data(), &to);
if (EVEN(sts)) { if (EVEN(sts)) {
curve->wow->DisplayError("Syntax Error", "To time syntax error"); curve->wow->DisplayError("Syntax Error", "To time syntax error");
return; return;
...@@ -395,8 +394,7 @@ void GeCurveQtWidget::activate_export_ok() ...@@ -395,8 +394,7 @@ void GeCurveQtWidget::activate_export_ok()
} }
} }
QByteArray ba = curve->export_filename_widget->text().toLocal8Bit(); strcpy(filename, qPrintable(curve->export_filename_widget->text()));
strcpy(filename, ba.data());
curve->export_widget->setVisible(false); curve->export_widget->setVisible(false);
...@@ -417,9 +415,9 @@ void GeCurveQtWidget::activate_export_cancel() ...@@ -417,9 +415,9 @@ void GeCurveQtWidget::activate_export_cancel()
void GeCurveQtWidget::activate_export_browse() void GeCurveQtWidget::activate_export_browse()
{ {
QByteArray ba = translate_utf8("File Selection").toLocal8Bit(); curve->wow->CreateFileSelDia(qPrintable(translate_utf8("File Selection")),
curve->wow->CreateFileSelDia(ba.data(), (void*)this, (void*)this, GeCurveQt::export_file_selected_cb,
GeCurveQt::export_file_selected_cb, wow_eFileSelType_History); wow_eFileSelType_History);
} }
void GeCurveQt::export_file_selected_cb( void GeCurveQt::export_file_selected_cb(
...@@ -584,14 +582,12 @@ void GeCurveQt::set_times_sensitivity(int sensitive) ...@@ -584,14 +582,12 @@ void GeCurveQt::set_times_sensitivity(int sensitive)
pwr_tStatus GeCurveQt::get_times(pwr_tTime* from, pwr_tTime* to) pwr_tStatus GeCurveQt::get_times(pwr_tTime* from, pwr_tTime* to)
{ {
QByteArray from_p = timebox_start_time->text().toLocal8Bit(); pwr_tStatus sts = time_FormAsciiToA(qPrintable(timebox_start_time->text()), SWE, SECOND, from);
pwr_tStatus sts = time_FormAsciiToA(from_p.data(), SWE, SECOND, from);
if (EVEN(sts)) { if (EVEN(sts)) {
return sts; return sts;
} }
QByteArray to_p = timebox_stop_time->text().toLocal8Bit(); sts = time_FormAsciiToA(qPrintable(timebox_stop_time->text()), SWE, SECOND, to);
sts = time_FormAsciiToA(to_p.data(), SWE, SECOND, to);
if (EVEN(sts)) { if (EVEN(sts)) {
return sts; return sts;
} }
......
...@@ -115,9 +115,9 @@ void GeItemViewQt::update() ...@@ -115,9 +115,9 @@ void GeItemViewQt::update()
} }
} }
void GeItemViewQt::update(char* full_name, int event) void GeItemViewQt::update(const char* full_name, int event)
{ {
char* name_p = strrchr(full_name, '/'); char* name_p = (char *) strrchr(full_name, '/');
full_name = strstr(name_p, ".pwg"); full_name = strstr(name_p, ".pwg");
if (!full_name) { if (!full_name) {
return; return;
...@@ -181,21 +181,20 @@ void GeItemViewQt::activate_menu_open() ...@@ -181,21 +181,20 @@ void GeItemViewQt::activate_menu_open()
void GeItemViewQt::activate_menu_delete() void GeItemViewQt::activate_menu_delete()
{ {
QByteArray sel_text = selected_text().toLocal8Bit(); if (qPrintable(selected_text())) {
if (sel_text.data()) {
int rv; int rv;
char title[] = "Delete graph"; char title[] = "Delete graph";
char message[64]; char message[64];
pwr_tCmd cmd; pwr_tCmd cmd;
sprintf(message, "Do you want to delete %s?", sel_text.data()); sprintf(message, "Do you want to delete %s?", qPrintable(selected_text()));
rv = ge_ctx->create_modal_dialog( rv = ge_ctx->create_modal_dialog(
title, message, "Yes", "Cancel", NULL, NULL); title, message, "Yes", "Cancel", NULL, NULL);
if (rv != wow_eModalDialogReturn_Button1) { if (rv != wow_eModalDialogReturn_Button1) {
return; return;
} }
sprintf(cmd, "rm -f $pwrp_pop/%s.pwg", sel_text.data()); sprintf(cmd, "rm -f $pwrp_pop/%s.pwg", qPrintable(selected_text()));
system(cmd); system(cmd);
} }
} }
...@@ -268,8 +267,7 @@ void GeItemViewQt::directory_changed(const QString& path) ...@@ -268,8 +267,7 @@ void GeItemViewQt::directory_changed(const QString& path)
if (!files2.contains(files[i])) { if (!files2.contains(files[i])) {
// File deleted // File deleted
if (!files[i].contains("__p")) { if (!files[i].contains("__p")) {
QByteArray ba = files[i].toLocal8Bit(); update(qPrintable(files[i]), 1);
update(ba.data(), 1);
} }
} }
} }
...@@ -278,8 +276,7 @@ void GeItemViewQt::directory_changed(const QString& path) ...@@ -278,8 +276,7 @@ void GeItemViewQt::directory_changed(const QString& path)
if (!files.contains(files2[i])) { if (!files.contains(files2[i])) {
// File created // File created
if (!files2[i].contains("__p")) { if (!files2[i].contains("__p")) {
QByteArray ba = files2[i].toLocal8Bit(); update(qPrintable(files2[i]), 0);
update(ba.data(), 0);
} }
} }
} }
...@@ -326,8 +323,7 @@ void GeItemViewQt::activate_tree_widget(QTreeWidgetItem* item, int idx) ...@@ -326,8 +323,7 @@ void GeItemViewQt::activate_tree_widget(QTreeWidgetItem* item, int idx)
QString sel_text = selected_text(tree_widget); QString sel_text = selected_text(tree_widget);
if (!sel_text.isNull()) { if (!sel_text.isNull()) {
QByteArray ba = sel_text.toLocal8Bit(); ge_ctx->open_graph(qPrintable(sel_text));
ge_ctx->open_graph(ba.data());
} }
} }
......
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
QWidget* widget(); QWidget* widget();
void update(); void update();
void update(char*, int); void update(const char*, int);
protected: protected:
void focusOutEvent(QFocusEvent* event); void focusOutEvent(QFocusEvent* event);
......
...@@ -1508,9 +1508,9 @@ GeQt::GeQt(void* x_parent_ctx, QWidget* x_parent_widget, ...@@ -1508,9 +1508,9 @@ GeQt::GeQt(void* x_parent_ctx, QWidget* x_parent_widget,
= cons->addMenu(translate_utf8("Corners &Round Amount")); = cons->addMenu(translate_utf8("Corners &Round Amount"));
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
double num = pow(2, i) / 4.0; double num = pow(2, i) / 4.0;
QByteArray ba = QString::number(num, 'f').toLocal8Bit();
QAction* cons_round_amount_t = addMenuRadioItem(toplevel, cons_round_amount, QAction* cons_round_amount_t = addMenuRadioItem(toplevel, cons_round_amount,
ba.data(), SLOT(activate_round_amount()), round_amount_group); qPrintable(QString::number(num, 'f')), SLOT(activate_round_amount()),
round_amount_group);
cons_round_amount_t->setData(num); cons_round_amount_t->setData(num);
if (i == 1) { if (i == 1) {
cons_round_amount_t->setChecked(true); cons_round_amount_t->setChecked(true);
......
...@@ -538,7 +538,7 @@ void Ge::export_gejava(Ge* gectx, char* name) ...@@ -538,7 +538,7 @@ void Ge::export_gejava(Ge* gectx, char* name)
} }
} }
void Ge::open_graph(char* name) void Ge::open_graph(const char* name)
{ {
pwr_tFileName filename; pwr_tFileName filename;
char graphname[80]; char graphname[80];
......
...@@ -190,7 +190,7 @@ public: ...@@ -190,7 +190,7 @@ public:
void save_and_close(); void save_and_close();
void clear_all(); void clear_all();
void open_graph(char* name); void open_graph(const char* name);
int set_focus(void* component); int set_focus(void* component);
void close(); void close();
int select_object(char* name); int select_object(char* name);
......
...@@ -269,11 +269,9 @@ void CLogQtWidget::filter_apply_cb() ...@@ -269,11 +269,9 @@ void CLogQtWidget::filter_apply_cb()
bool fatal = clog->show_fatal_w->isChecked(); bool fatal = clog->show_fatal_w->isChecked();
bool text = clog->show_text_w->isChecked(); bool text = clog->show_text_w->isChecked();
QByteArray str = clog->filter_string_w->text().toLocal8Bit();
clog->set_clock_cursor(); clog->set_clock_cursor();
clog->clognav->set_filter( clog->clognav->set_filter(success, info, warning, error, fatal, text,
success, info, warning, error, fatal, text, str.data()); qPrintable(clog->filter_string_w->text()));
clog->reset_cursor(); clog->reset_cursor();
} }
......
...@@ -163,8 +163,8 @@ void XttStreamQtWidget::error_cb(Phonon::ErrorType error) ...@@ -163,8 +163,8 @@ void XttStreamQtWidget::error_cb(Phonon::ErrorType error)
{ {
printf("Message %d\n", error); printf("Message %d\n", error);
/* Print error details on the screen */ /* Print error details on the screen */
QByteArray err = stream->playbin2->mediaObject()->errorString().toLocal8Bit(); printf("Error received from element: %s\n",
printf("Error received from element: %s\n", err.data()); qPrintable(stream->playbin2->mediaObject()->errorString()));
if (error == Phonon::FatalError) { if (error == Phonon::FatalError) {
stream->no_uri = 1; stream->no_uri = 1;
...@@ -505,19 +505,17 @@ XttStreamQt::XttStreamQt(QWidget* st_parent_wid, void* st_parent_ctx, ...@@ -505,19 +505,17 @@ XttStreamQt::XttStreamQt(QWidget* st_parent_wid, void* st_parent_ctx,
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
QString text1, text2, text3; QString text1, text2, text3;
text1 += "PresetPosition["; text1 = "PresetPosition[";
text1 += QString::number(i); text1 += QString::number(i);
text1 += "].Description"; text1 += "].Description";
QByteArray ba1 = text1.toLocal8Bit(); text2 = "Preset position ";
text2 += "Preset position ";
text2 += QString::number(i + 1); text2 += QString::number(i + 1);
QByteArray ba2 = text2.toLocal8Bit(); text3 = "$pwr_exe/xtt_pos";
text3 += "$pwr_exe/xtt_pos";
text3 += QString::number(i + 1); text3 += QString::number(i + 1);
text3 += ".png"; text3 += ".png";
QByteArray ba3 = text3.toLocal8Bit(); QAction* a
QAction* a = addToolItemSpecial(tools, ba1.data(), ba2.data(), = addToolItemSpecial(tools, qPrintable(text1), qPrintable(text2),
SLOT(activate_preset_position()), ba3.data()); SLOT(activate_preset_position()), qPrintable(text3));
a->setData(i); a->setData(i);
} }
...@@ -654,8 +652,7 @@ void XttStreamQt::create_popup_menu(int x, int y) ...@@ -654,8 +652,7 @@ void XttStreamQt::create_popup_menu(int x, int y)
QString text; QString text;
text += "Position "; text += "Position ";
text += QString::number(i + 1); text += QString::number(i + 1);
QByteArray ba = text.toLocal8Bit(); QAction* a = addMenuItem(toplevel, menu_preset_store, qPrintable(text),
QAction* a = addMenuItem(toplevel, menu_preset_store, ba.data(),
SLOT(activate_preset_store_pos())); SLOT(activate_preset_store_pos()));
a->setData(i); a->setData(i);
} }
......
...@@ -295,7 +295,7 @@ CLogNavBrow::~CLogNavBrow() ...@@ -295,7 +295,7 @@ CLogNavBrow::~CLogNavBrow()
} }
void CLogNav::set_filter(bool success, bool info, bool warning, bool error, void CLogNav::set_filter(bool success, bool info, bool warning, bool error,
bool fatal, bool text, char* str) bool fatal, bool text, const char* str)
{ {
filter.show_success = success; filter.show_success = success;
filter.show_info = info; filter.show_info = info;
......
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
void reset_nodraw(); void reset_nodraw();
void read(int* idx_list, int idx_cnt); void read(int* idx_list, int idx_cnt);
void set_filter(bool success, bool info, bool warning, bool error, bool fatal, void set_filter(bool success, bool info, bool warning, bool error, bool fatal,
bool text, char* str); bool text, const char* str);
void get_filter(bool* success, bool* info, bool* warning, bool* error, void get_filter(bool* success, bool* info, bool* warning, bool* error,
bool* fatal, bool* text); bool* fatal, bool* text);
void draw(); void draw();
......
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