diff --git a/src/Camera/QGCCameraControl.cc b/src/Camera/QGCCameraControl.cc index f661b1f19e7fb0b1ac8d91a45466a9496b434949..bef5c7c49a7f2884c4e135faa571dba3c2163204 100644 --- a/src/Camera/QGCCameraControl.cc +++ b/src/Camera/QGCCameraControl.cc @@ -387,10 +387,7 @@ QGCCameraControl::takePhoto() _captureInfoRetries = 0; //-- Capture local image as well if(qgcApp()->toolbox()->videoManager()) { - QString photoPath = qgcApp()->toolbox()->settingsManager()->appSettings()->savePath()->rawValue().toString() + QStringLiteral("/Photo"); - QDir().mkpath(photoPath); - photoPath += + "/" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss.zzz") + ".jpg"; - qgcApp()->toolbox()->videoManager()->grabImage(photoPath); + qgcApp()->toolbox()->videoManager()->grabImage(); } return true; } diff --git a/src/VideoManager/VideoManager.cc b/src/VideoManager/VideoManager.cc index 296d5d57ede4216d1d296b1aaf6fead8371308e8..f1687772c4d34d03506bd4a09638df5772572982 100644 --- a/src/VideoManager/VideoManager.cc +++ b/src/VideoManager/VideoManager.cc @@ -350,7 +350,12 @@ VideoManager::grabImage(const QString& imageFile) return; } - _imageFile = imageFile; + if (imageFile.isEmpty()) { + _imageFile = qgcApp()->toolbox()->settingsManager()->appSettings()->photoSavePath(); + _imageFile += + "/" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss.zzz") + ".jpg"; + } else { + _imageFile = imageFile; + } emit imageFileChanged(); diff --git a/src/VideoManager/VideoManager.h b/src/VideoManager/VideoManager.h index 285aad96d4e655eaf86d4bedb4dc4a99be088d55..9423b551e90b3ff7be5e3304199cfb17a0baf96c 100644 --- a/src/VideoManager/VideoManager.h +++ b/src/VideoManager/VideoManager.h @@ -109,7 +109,7 @@ public: Q_INVOKABLE void startRecording (const QString& videoFile = QString()); Q_INVOKABLE void stopRecording (); - Q_INVOKABLE void grabImage(const QString& imageFile); + Q_INVOKABLE void grabImage(const QString& imageFile = QString()); signals: void hasVideoChanged ();