Index: /trunk/ippTools/src/p2insertPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6108)
+++ /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6109)
@@ -7,60 +7,64 @@
 bool p2insertPendingFrames (p2Config *config, psArray *rawFrames) {
 
-    psMetadata *where = psMetadataAlloc ();
+    psMetadata *where = psMetadataAlloc();
 
     for (int i = 0; i < rawFrames->n; i++) {
-	ppRawFrame *rawFrame = rawFrames->data[i];
+        ppRawFrame *rawFrame = rawFrames->data[i];
 
-	// find the next available version numbers
-	psMetadataAddStr (where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==", rawFrame->exposure->exp_id);
-	psArray *exposures = p2PendingExpSelectRowObjects(config->database, where, MAX_ROWS);
-	int version = -1;
-	for (int j = 0; j < exposures->n; j++) {
-	    p2PendingExpRow *exposure = exposures->data[j];
-	    version = PS_MAX (version, exposure->p2_version);
-	}
-	version ++;
+        // find the next available version numbers
+        psMetadataAddStr(where, PS_LIST_TAIL, "EXP_ID", PS_META_REPLACE, "==",
+            rawFrame->exposure->exp_id);
+        psArray *exposures = p2PendingExpSelectRowObjects(config->database,
+            where, MAX_ROWS);
 
-	p2PendingExpRow *pendingExposure = p2PendingExpRowAlloc(
-        rawFrame->exposure->exp_id,
-        rawFrame->exposure->camera,
-        rawFrame->exposure->filter,
-        rawFrame->exposure->class,
-        rawFrame->exposure->nclass,
-        0xff,
-        version
-        // pendingExposure->Ndone = 0;
-        // pendingExposure->state = P2_STATE_PENDING;
-    );
+        int version = -1;
+        for (int j = 0; j < exposures->n; j++) {
+            p2PendingExpRow *exposure = exposures->data[j];
+            version = PS_MAX(version, exposure->p2_version);
+        }
+        version ++;
 
-	psArray *pendingImages = psArrayAlloc (rawFrame->images->n);
-	pendingImages->n = 0;
-	for (int j = 0; j < rawFrame->images->n; j++) {
-	    rawImfileRow *rawImage = rawFrame->images->data[j];
-	    p2PendingImfileRow *pendingImage = p2PendingImfileRowAlloc(
-	        rawImage->exp_id,
-	        rawImage->exptype,
-	        rawImage->class,
-	        rawImage->class_id,
-	        version, // p1
-	        version, // p2
-            "",
-            "",
-	        // XXX cleanup the url somehow
-	        rawImage->url
+        p2PendingExpRow *pendingExposure = p2PendingExpRowAlloc(
+            rawFrame->exposure->exp_id,
+            rawFrame->exposure->camera,
+            rawFrame->exposure->filter,
+            rawFrame->exposure->class,
+            rawFrame->exposure->nclass,
+            0xff,
+            version
+            // pendingExposure->Ndone = 0;
+            // pendingExposure->state = P2_STATE_PENDING;
         );
 
-	    psArrayAdd (pendingImages, 100, pendingImage);
-	}
-	
-	p2PendingExpInsertObject (config->database, pendingExposure);
+        psArray *pendingImages = psArrayAlloc(rawFrame->images->n);
+        pendingImages->n = 0;
+        for (int j = 0; j < rawFrame->images->n; j++) {
+            rawImfileRow *rawImage = rawFrame->images->data[j];
+            p2PendingImfileRow *pendingImage = p2PendingImfileRowAlloc(
+                rawImage->exp_id,
+                rawImage->exptype,
+                rawImage->class,
+                rawImage->class_id,
+                version, // p1
+                version, // p2
+                "",
+                "",
+                // XXX cleanup the url somehow
+                rawImage->url
+            );
 
-    for (int i = 0; i < pendingImages->n; i++) {
-	    p2PendingImfileInsertObject(config->database, pendingImages->data[i]);
+            psArrayAdd(pendingImages, 100, pendingImage);
+        }
+        
+        p2PendingExpInsertObject(config->database, pendingExposure);
+
+        for (int i = 0; i < pendingImages->n; i++) {
+                p2PendingImfileInsertObject(config->database,
+                    pendingImages->data[i]);
+        }
     }
 
-    }
     return true;
-} 
+}
 
 // XXX the filename layout is defined by this code
