Commits

iorodeo committed e6b11a9

Modifierd so that camera identifier is no longer manditory for one camera.
Changed filenaming so that has has manditory padding.

  • Participants
  • Parent commits 8fc2be3

Comments (0)

Files changed (3)

File src/gui/auto_naming_dialog.cpp

         connectWidgets();
 
         numberOfCameras_ = numberOfCameras;
-        if (numberOfCameras_ > 1)
-        {
-            cameraIdentifierGroupBoxPtr_ -> setCheckable(false);
-        }
-        else
-        {
-            cameraIdentifierGroupBoxPtr_ -> setCheckable(true);
-        }
+        //if (numberOfCameras_ > 1)
+        //{
+        //    cameraIdentifierGroupBoxPtr_ -> setCheckable(false);
+        //}
+        //else
+        //{
+        //    cameraIdentifierGroupBoxPtr_ -> setCheckable(true);
+        //}
+        cameraIdentifierGroupBoxPtr_ -> setCheckable(true);
 
         QStringListIterator allowedFormatsIt(AutoNamingOptions::ALLOWED_TIME_AND_DATE_FORMATS);
         while (allowedFormatsIt.hasNext())
     {
         AutoNamingOptions options;
 
-        if (numberOfCameras_ > 1)
-        {
-            options.includeCameraIdentifier = true;
-        }
-        else
-        {
-            options.includeCameraIdentifier = cameraIdentifierGroupBoxPtr_ -> isChecked();
-        }
+        //if (numberOfCameras_ > 1)
+        //{
+        //    options.includeCameraIdentifier = true;
+        //}
+        //else
+        //{
+        //    options.includeCameraIdentifier = cameraIdentifierGroupBoxPtr_ -> isChecked();
+        //}
+        options.includeCameraIdentifier = cameraIdentifierGroupBoxPtr_ -> isChecked();
 
         if (guidIdentifierRadioButtonPtr_ -> isChecked())
         {

File src/gui/camera_window.cpp

         QString fileName = currentVideoFileName_;
 
         // Add camera identifier - guid or camera number
-        if ((autoNamingOptions_.includeCameraIdentifier) || (numberOfCameras_  > 1))
+        //if ((autoNamingOptions_.includeCameraIdentifier) || (numberOfCameras_  > 1))
+        if (autoNamingOptions_.includeCameraIdentifier)
         {
             if (autoNamingOptions_.cameraIdentifier == AutoNamingOptions::GUID_IDENTIFIER)
             {

File src/gui/video_writer.cpp

         QFileInfo fileInfo(fileName_);
         QString incrFileName = fileName_;
 
-        if (fileInfo.exists())
+        QDir filePath = QDir(fileInfo.absolutePath());
+        QString baseName = fileInfo.baseName();
+        QString ext = fileInfo.suffix();
+
+        bool done = false;
+        unsigned int cnt = 1;
+
+        while(!done)
         {
-            QDir filePath = QDir(fileInfo.absolutePath());
-            QString baseName = fileInfo.baseName();
-            QString ext = fileInfo.suffix();
-
-            unsigned int cnt = 2;
-            while(fileInfo.exists())
+            QString ver = QString("_v%1").arg(cnt,3,10,QChar('0'));
+            fileInfo = QFileInfo(filePath, baseName + ver + "." + ext);
+            if (!fileInfo.exists())
             {
-                QString ver = "_v" + QString::number(cnt);
-                fileInfo = QFileInfo(filePath, baseName + ver + "." + ext);
-                incrFileName = fileInfo.absoluteFilePath();
-                cnt++;
+                done = true;
             }
+            cnt++;
         }
+        incrFileName = fileInfo.absoluteFilePath();
 
         return incrFileName;
     }