--- as_dataop.cpp 2003/02/03 14:12:09 1.40
+++ as_dataop.cpp 2003/02/03 21:14:58 1.41
@@ -37,6 +37,7 @@
// User interface
#include "as_gui.h" // Main classes
#include "as_tableitem.h" // For class RtTableItem
+#include "as_crc.h" // For quality strings
// Icon pixel maps
#include "as_gfx/statok.xpm" // static const char *s_kpcStatokay_xpm[]
@@ -221,10 +222,7 @@
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Crc; // Copy the CRC field
- if (!Crc.isEmpty())
- m_pMaintable->setText(nIter, TITRAQ_IDXCRC, Crc);
- else
- bValid = false;
+ // Postpone actual text delivery, to autoinsert CRCs!
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Rev; // Copy the rev field
@@ -291,6 +289,21 @@
m_pMaintable->setPixmap(nIter, TITRAQ_IDXSTATUS, Staterror);
}
+ // Set the CRC text here, in case we need to generate a fresh value
+ if (!Crc.isEmpty()) {
+ if (Crc != ".") // This means, generate a fresh CRC value
+ m_pMaintable->setText(nIter, TITRAQ_IDXCRC, "0x" + Crc);
+ else {
+ // Make our long tuple to run through the CRC32 generator
+ Qualistring Testuple = User + Guid + Rev + Date + Start;
+ Testuple += Finish + Amount + Account + Remark;
+ U32 Valcrc = Testuple.getCrc(); // Finally set the checksum to its new value
+ m_pMaintable->setText(nIter, TITRAQ_IDXCRC, "0x" + QString::number(Valcrc, 16));
+ }
+ }
+ else // if isEmpty()
+ bValid = false;
+
nIter++; // The big increment
Line = QString(""); // Clear line for next round
@@ -365,6 +378,7 @@
Tstream << trUtf8(" ") << Tempfield; // Save GUID field text
Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXCRC); // Load CRC field text
+ Tempfield.remove("0x");
if (Tempfield != NULL)
Tstream << trUtf8(" ") << Tempfield; // Save CRC field text
|