Commit 77080a95 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Make sure the video directory is available as we start recording

BUG: 423216
parent a4f712a5
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "devicemanager.h" #include "devicemanager.h"
#include <KIO/Global> #include <KIO/Global>
#include <KIO/CopyJob> #include <KIO/CopyJob>
#include <KIO/MkpathJob>
#include <KIO/FileUndoManager> #include <KIO/FileUndoManager>
#include <KIO/JobUiDelegate> #include <KIO/JobUiDelegate>
#include <KFormat> #include <KFormat>
...@@ -99,6 +100,16 @@ void Kamoso::setRecording(bool recording) ...@@ -99,6 +100,16 @@ void Kamoso::setRecording(bool recording)
m_webcamControl->startRecording(); m_webcamControl->startRecording();
m_recordingTime.restart(); m_recordingTime.restart();
m_recordingTimer.start(); m_recordingTimer.start();
auto job = KIO::mkpath(Settings::saveVideos());
job->start();
connect(job, &KJob::finished, this, [this, job] {
if (job->error() == 0) {
return;
}
qWarning() << "Could not create" << Settings::saveVideos();
Q_EMIT error(job->errorString());
});
} else { } else {
const QUrl path = fileNameSuggestion(Settings::saveVideos(), "video", "mkv"); const QUrl path = fileNameSuggestion(Settings::saveVideos(), "video", "mkv");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment