OSSP CVS Repository

ossp - Check-in [3948]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3948
Date: 2003-Jan-27 13:39:18 (local)
2003-Jan-27 12:39:18 (UTC)
User:ms
Branch:
Comment: Change all date and time data entries from ISO format to AS specific.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_const.h      1.34 -> 1.35     5 inserted, 0 deleted
ossp-pkg/as/as-gui/as_dataop.cpp      1.33 -> 1.34     22 inserted, 4 deleted

ossp-pkg/as/as-gui/as_const.h 1.34 -> 1.35

--- as_const.h   2003/01/24 18:22:03     1.34
+++ as_const.h   2003/01/27 12:39:18     1.35
@@ -177,6 +177,11 @@
 #define TITRAQ_IDXSTATERROR     0
 #define TITRAQ_IDXSTATCOLOR     1
 
+// Offsets
+#define TITRAQ_OFFSETYEAR       4
+#define TITRAQ_OFFSETMONTH      7
+#define TITRAQ_OFFSETHOUR       2
+
 // Values
 #define TITRAQ_MARGIN           10          // Default layout margin
 #define TITRAQ_SPACING          6           // Default layout spacing


ossp-pkg/as/as-gui/as_dataop.cpp 1.33 -> 1.34

--- 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
 

CVSTrac 2.0.1