--- as_dataop.cpp 2003/01/24 16:32:18 1.33
+++ as_dataop.cpp 2003/01/27 12:39:19 1.34
@@ -31,6 +31,7 @@
// Qt general headers
#include <qregexp.h> // Portable regular expressions
+#include <qdatetime.h>
// User interface
#include "as_gui.h" // Main classes
@@ -151,6 +152,10 @@
Line = trUtf8("");
}
+// // Going into data churning, so prepare date and time parsing and conversion
+// Converdate.setSeparator(trUtf8("."));
+// Convertime.setSeparator(trUtf8(":"));
+
// Optimize viewing by repainting cells only once after processing
m_pMaintable->setUpdatesEnabled(false);
@@ -195,29 +200,38 @@
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Date; // Copy the date field
- if (!Date.isEmpty())
+ if (!Date.isEmpty()) {
+ Date.insert(TITRAQ_OFFSETYEAR, QChar('.')); // Format year
+ Date.insert(TITRAQ_OFFSETMONTH, QChar('.')); // Format month
m_pMaintable->setText(nIter, TITRAQ_IDXDATE, Date);
+ }
else
bValid = false;
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Start; // Copy the start field
- if (!Start.isEmpty())
+ if (!Start.isEmpty()) {
+ Start.insert(TITRAQ_OFFSETHOUR, QChar(':')); // Format hour
m_pMaintable->setText(nIter, TITRAQ_IDXSTART, Start);
+ }
else
bValid = false;
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Finish; // Copy the finish field
- if (!Start.isEmpty())
+ if (!Start.isEmpty()) {
+ Finish.insert(TITRAQ_OFFSETHOUR, QChar(':')); // Format hour
m_pMaintable->setText(nIter, TITRAQ_IDXFINISH, Finish);
+ }
else
bValid = false;
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Amount; // Copy the amount field
- if (!Amount.isEmpty())
+ if (!Amount.isEmpty()) {
+ Amount.insert(TITRAQ_OFFSETHOUR, QChar(':')); // Format hour
m_pMaintable->setText(nIter, TITRAQ_IDXAMOUNT, Amount);
+ }
else
bValid = false;
@@ -331,18 +345,22 @@
Tstream << trUtf8(" ") << Tempfield; // Save rev field text
Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXDATE); // Load date field text
+ Tempfield.remove(QChar('.'));
if (Tempfield != NULL)
Tstream << trUtf8(" ") << Tempfield; // Save date field text
Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXSTART); // Load start field text
+ Tempfield.remove(QChar(':'));
if (Tempfield != NULL)
Tstream << trUtf8(" ") << Tempfield; // Save start field text
Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXFINISH); // Load end field text
+ Tempfield.remove(QChar(':'));
if (Tempfield != NULL)
Tstream << trUtf8(" ") << Tempfield; // Save end field text
Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXAMOUNT); // Load amount field text
+ Tempfield.remove(QChar(':'));
if (Tempfield != NULL)
Tstream << trUtf8(" ") << Tempfield; // Save amount field text
|