[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/office/kraft/src
From:       Klaas Freitag <klaas () freisturz ! de>
Date:       2011-10-22 20:47:35
Message-ID: 20111022204735.CF915AC888 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1260229 by freitag:

Fixed modify and enter date in catalog view

 M  +6 -6      katalogview.cpp  
 M  +5 -1      kraftdb.cpp  
 M  +2 -1      kraftdb.h  
 M  +4 -1      templatesaverdb.cpp  


--- trunk/playground/office/kraft/src/katalogview.cpp #1260228:1260229
@@ -443,12 +443,12 @@
   mTemplateText->setText( t );
 
   t = "<table border=\"0\">";
-  t += i18n("<tr><td>Created at:</td><td>%1</td><td>&nbsp;&nbsp;</td><td>Last \
                used:</td><td>%2</td></tr>" )
-       .arg( locale->formatDateTime( tmpl->enterDate() ) )
-       .arg( locale->formatDateTime( tmpl->lastUsedDate() ) );
-  t += i18n("<tr><td>Modified at:</td><td>%1</td><td>&nbsp;&nbsp;</td><td>Use \
                Count:</td><td>%2</td></tr>" )
-       .arg( locale->formatDateTime( tmpl->modifyDate() ) )
-       .arg( tmpl->useCounter() );
+  t += i18n("<tr><td>Created at:</td><td>%1</td></tr>" ) /* \
<td>&nbsp;&nbsp;</td><td>Last used:</td><td>%2</td></tr>" ) */ +       .arg( \
locale->formatDateTime( tmpl->enterDate() ) ); +       /* .arg( \
locale->formatDateTime( tmpl->lastUsedDate() ) ); */ +  t += i18n("<tr><td>Modified \
at:</td><td>%1</td></tr>") /* <td>&nbsp;&nbsp;</td><td>Use \
Count:</td><td>%2</td></tr>" ) */ +       .arg( locale->formatDateTime( \
tmpl->modifyDate() ) ); +       /* .arg( tmpl->useCounter() ); */
   t += "</table>";
   // kDebug() << "Hoover-String: " << t;
   mTemplateStats->setText( t );
--- trunk/playground/office/kraft/src/kraftdb.cpp #1260228:1260229
@@ -427,10 +427,14 @@
     return mDatabaseDriver;
 }
 
-QString KraftDB::currentTimeStamp()
+QString KraftDB::currentTimeStamp( const QDateTime& dt )
 {
   QString dateStr;
+  if( dt.isValid() ) {
+    dateStr = dt.toString(Qt::ISODate);
+  } else {
   dateStr = QDateTime::currentDateTime().toString(Qt::ISODate);
+  }
   return dateStr;
 }
 
--- trunk/playground/office/kraft/src/kraftdb.h #1260228:1260229
@@ -23,6 +23,7 @@
 
 #include <QMap>
 #include <QObject>
+#include <QDateTime>
 
 #include "kraftcat_export.h"
 
@@ -102,7 +103,7 @@
   void setSchemaVersion( const QString& );
 
   // database aware current time stamp
-  QString currentTimeStamp();
+  QString currentTimeStamp( const QDateTime& dt = QDateTime() );
   /**
    * Euro sign encoding to work around a problem with mysql
    */
--- trunk/playground/office/kraft/src/templatesaverdb.cpp #1260228:1260229
@@ -358,12 +358,15 @@
     buffer->setValue( "Gewinn", tmpl->getBenefit() );
     buffer->setValue( "zeitbeitrag", tmpl->hasTimeslice() );
 
-    QString dtString = KraftDB::self()->currentTimeStamp();
 
+    QDateTime dt = QDateTime::currentDateTime();
+    QString dtString = KraftDB::self()->currentTimeStamp(dt);
     if( isNew ) {
         buffer->setValue( "enterDatum", dtString);
+        tmpl->setEnterDate( dt );
     }
     buffer->setValue("modifyDatum", dtString );
+    tmpl->setModifyDate( dt );
 
     int ctype = 2;  // Calculation type Calculation
     if( tmpl->calcKind() == CatalogTemplate::ManualPrice )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic