From 26dc58fb696ac1f96e018fbae7083d1ba2a1a55a Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 4 Sep 2008 12:25:09 +0000 Subject: Made macrowindow clean up proprely when closed (thus terminating dangling db connections through dbwidget). --- client/formatparser.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'client/formatparser.cc') diff --git a/client/formatparser.cc b/client/formatparser.cc index 233a694..0f04d0a 100644 --- a/client/formatparser.cc +++ b/client/formatparser.cc @@ -127,17 +127,12 @@ QString format_parser(QString format, QSqlQuery &query) p++; } { - int fieldNo = query.record().indexOf(var); - resume += query.value(fieldNo).toString(); - - /* - QVector< Widget* >::iterator i = widgets.begin(); - while (i != widgets.end()) { - Widget* w = *i; - if(w->getName() == var) resume += w->getValue(); - i++; + int idx = query.record().indexOf(var); + if(idx == -1) { + printf("Unknown field in format string %s\n", var.toStdString().c_str()); + } else { + resume += query.value(idx).toString(); } - */ } break; -- cgit v1.2.3