X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvendorclassdialog.cpp;h=ba670b96894163fad9500962d9ddac0d3c1a5241;hb=3d155f8bff56495df9ae70aa75f3a43ce5d83478;hp=d39a5a0f19b3fb1122485079937987aeac6cc7b5;hpb=6df1a447a1fa1b9e51fd177a806f910813657b09;p=schematic diff --git a/src/vendorclassdialog.cpp b/src/vendorclassdialog.cpp index d39a5a0..ba670b9 100644 --- a/src/vendorclassdialog.cpp +++ b/src/vendorclassdialog.cpp @@ -156,32 +156,33 @@ void VendorClassDialog::LoadList(void) std::vector groupList; // Pull in definitions from DB for Vendor Classes/Groups - QSqlQuery query1("SELECT vgid, seqNo, description FROM VendorGroup ORDER BY seqNo"); - query1.exec(); + QSqlQuery query; + query.prepare("SELECT vgid, seqNo, description FROM VendorGroup ORDER BY seqNo"); + query.exec(); - while (query1.next()) + while (query.next()) { VendorType v; - v.key = query1.value(0).toInt(); - v.seqNo = query1.value(1).toInt(); - v.description = query1.value(2).toString(); + v.key = query.value(0).toInt(); + v.seqNo = query.value(1).toInt(); + v.description = query.value(2).toString(); v.isHeader = true; groupList.push_back(v); } - QSqlQuery query2("SELECT vtid, vgid, seqNo, description FROM VendorType ORDER BY seqNo"); - query2.exec(); + query.prepare("SELECT vtid, vgid, seqNo, description FROM VendorType ORDER BY seqNo"); + query.exec(); int previousID = -1, groupListIndex = 0; - while (query2.next()) + while (query.next()) { VendorType v; - v.key = query2.value(0).toInt(); - int vgid = query2.value(1).toInt(); - v.seqNo = query2.value(2).toInt(); - v.description = query2.value(3).toString(); + v.key = query.value(0).toInt(); + int vgid = query.value(1).toInt(); + v.seqNo = query.value(2).toInt(); + v.description = query.value(3).toString(); v.isHeader = false; // Check to see if we need to insert new header yet.