OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_dataop.cpp versions 1.39 and 1.40
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_dataop.cpp 1.39 -> 1.40

--- as_dataop.cpp        2003/01/30 20:26:03     1.39
+++ as_dataop.cpp        2003/02/03 14:12:09     1.40
@@ -139,7 +139,6 @@
     bool bValid = true; // Used to warn on globally invalid accounting data
     int nIter = 0;      // Iterator used in loop and also as a count
     QString Line;       // Used for linewise editing and whitespace eating
-    QString Parstring;  // Used to parse all extra '-' and '=' token delimiters
     QString Bitbucket;  // Used for null device until we find a better way
 
     QPixmap Statokay(s_kpcStatokay_xpm);
@@ -201,7 +200,6 @@
         bool bValid = true; // Warns on linewise invalid accounting data
         QString User, Guid, Crc, Rev;                           // Valid admin fields
         QString Date, Start, Finish, Account, Amount, Remark;   // Valid user fields
-        QString Timepack;                       // Packed start finish amount field
         QTextStream Asline(&Line, IO_ReadOnly); // Convert a single line now
 
         if (nIter % g_knBlocks == 0) // Add blocks of rows to optimize loading
@@ -237,41 +235,29 @@
 
         Asline.skipWhiteSpace();    // Remove whitespaces
         Asline >> Date;             // Copy the date field
-        if (!Date.isEmpty()) {
-            Date.insert(TITRAQ_OFFSETYEAR, QChar('.'));     // Format year
-            Date.insert(TITRAQ_OFFSETMONTH, QChar('.'));    // Format month
+        if (!Date.isEmpty())
             m_pMaintable->setText(nIter, TITRAQ_IDXDATE, Date);
-        }
         else
             bValid = false;
 
         Asline.skipWhiteSpace();    // Remove whitespaces
-        Asline >> Timepack;
-
-        // Hack to hard code regex parsing logic into the document format
-        Start = Timepack.section('-', 0, 0, QString::SectionDefault);
-        Finish = Timepack.section('-', 1, 1, QString::SectionDefault);
-        Finish = Finish.section('=', 0, 0, QString::SectionDefault);
-        Amount = Timepack.section('=', 1, 1, QString::SectionDefault);
-
-        if (!Start.isEmpty()) {                             // Write start
-            Start.insert(TITRAQ_OFFSETHOUR, QChar(':'));    // Format hour
+        Asline >> Start;            // Copy the start field
+        if (!Start.isEmpty())
             m_pMaintable->setText(nIter, TITRAQ_IDXSTART, Start);
-        }
         else
             bValid = false;
 
-        if (!Finish.isEmpty()) {                            // Write finish
-            Finish.insert(TITRAQ_OFFSETHOUR, QChar(':'));   // Format hour
+        Asline.skipWhiteSpace();    // Remove whitespaces
+        Asline >> Finish;           // Copy the finish field
+        if (!Finish.isEmpty())
             m_pMaintable->setText(nIter, TITRAQ_IDXFINISH, Finish);
-        }
         else
             bValid = false;
 
-        if (!Amount.isEmpty()) {                            // Write amount
-            Amount.insert(TITRAQ_OFFSETHOUR, QChar(':'));   // Format hour
+        Asline.skipWhiteSpace();    // Remove whitespaces
+        Asline >> Amount;           // Copy the amount field
+        if (!Amount.isEmpty())
             m_pMaintable->setText(nIter, TITRAQ_IDXAMOUNT, Amount);
-        }
         else
             bValid = false;
 
@@ -387,26 +373,20 @@
             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
-        Tstream << trUtf8("-");                                     // Save start field text
 
         Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXFINISH);    // Load end field text
-        Tempfield.remove(QChar(':'));
         if (Tempfield != NULL)
-            Tstream << Tempfield;                                   // Save end field text
-        Tstream << trUtf8("=");                                     // Save start field text
+            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 << Tempfield;                                   // Save amount field text
+            Tstream << trUtf8(" ") << Tempfield;                    // Save amount
 
         Tempfield = m_pMaintable->text(nIter, TITRAQ_IDXTASK);      // Load acct field text
         if (Tempfield != NULL)

CVSTrac 2.0.1