Commit 2aa562ca authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Provide the right sample for the effects gallery

parent 2930d1f8
......@@ -44,13 +44,6 @@ Kamoso::Kamoso(WebcamControl *webcamControl)
connect(m_webcamControl, &WebcamControl::photoTaken, this, &Kamoso::photoTaken);
connect(&m_recordingTimer, &QTimer::timeout, this, &Kamoso::recordingTimeChanged);
if (Settings::saveUrl().isLocalFile()) {
const QDir dir(Settings::saveUrl().toLocalFile());
const auto dirlist = dir.entryInfoList({"*.jpg"}, QDir::Files, QDir::SortFlag::Time);
if (!dirlist.isEmpty())
m_sampleImagePath = dirlist.first().absoluteFilePath();
}
}
Kamoso::~Kamoso() = default;
......
......@@ -50,6 +50,12 @@ GridView {
ListElement { filters: "coloreffects preset=xray" }
}
property string sampleImage: ""
onVisibleChanged: if (view.visible) {
sampleImage = webcam.sampleImage
}
delegate: Rectangle {
readonly property int borderWidth: 2
id: delegateItem
......@@ -77,8 +83,7 @@ GridView {
view.model.remove(index)
}
readonly property string sampleImage: view.visible ? webcam.sampleImage : ""
description: "filesrc location=\"" + sampleImage + "\" ! decodebin ! imagefreeze ! videoconvert ! " + model.filters + " name=last"
description: "filesrc location=\"" + view.sampleImage + "\" ! decodebin ! imagefreeze ! videoconvert ! " + model.filters + " name=last"
}
surface: pipe.surface
}
......
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