Commits

vmlemon committed df81302 Draft

API for creating objects with creation date+time metadata

  • Participants
  • Parent commits fea41b4

Comments (0)

Files changed (2)

File DataStore.pro.user

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.4.1, 2012-11-17T19:47:46. -->
+<!-- Written by Qt Creator 2.4.1, 2012-11-18T00:06:26. -->
 <qtcreator>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
     aDataType->insert(aObjectName, aType);
 }
 
+//Insert an object, and set its creation date + time stamp
+void InsertObject(QMap<QString,QVariant> *aStore,
+                  QMap<QString,int> *aDataType,
+                  QString aObjectName,
+                  QByteArray aData,
+                  int aType,
+                  QMap<QString,QDateTime> *aDateTime,
+                  QDateTime aDateTimeStamp) {
+
+
+    //Insert the object in the usual way, using the original API
+    InsertObject(aStore,
+                    aDataType,
+                      aObjectName,
+                        aData,
+                            aType);
+
+    //Now set the newly-injected object's creation date/time
+    aDateTime->insert(aObjectName, aDateTimeStamp);
+}
+
 void PrintDirectoryEntry(QMap<QString,QVariant> *aStore,
                          QMap<QString,int> *aDataType,
                          QMap<QString,QDateTime> *aDateTimeStamp,
 
 
 
-        InsertObject(store, mDataType, working.at(1), objectData, UNSTRUCTURED);
-        mDateTime->insert(working.at(1), objectMetaData->created());
+        InsertObject(store, mDataType, working.at(1), objectData, UNSTRUCTURED,
+                     objectMetaData->created());
     }
 
     //File viewer