Fix changing proxy profile not rebuilding proxies

parent 48dfad53
......@@ -3002,6 +3002,9 @@ void Bin::rebuildProxies()
for (std::shared_ptr<ProjectClip> clp : clipList) {
if (clp->hasProxy()) {
toProxy << clp;
// Abort all pending jobs
pCore->jobManager()->discardJobs(clp->clipId(), AbstractClipJob::PROXYJOB);
clp->deleteProxy();
}
}
if (toProxy.isEmpty()) {
......
......@@ -950,24 +950,27 @@ ClipPropertiesController *ProjectClip::buildProperties(QWidget *parent)
QList<std::shared_ptr<ProjectClip>> clipList {std::static_pointer_cast<ProjectClip>(shared_from_this())};
pCore->currentDoc()->slotProxyCurrentItem(doProxy, clipList);
});
connect(panel, &ClipPropertiesController::deleteProxy, [this] () {
// Disable proxy file
QString proxy = getProducerProperty(QStringLiteral("kdenlive:proxy"));
QList<std::shared_ptr<ProjectClip>> clipList {std::static_pointer_cast<ProjectClip>(shared_from_this())};
pCore->currentDoc()->slotProxyCurrentItem(false, clipList);
// Delete it
bool ok;
QDir dir = pCore->currentDoc()->getCacheDir(CacheProxy, &ok);
if (ok && proxy.length() > 2) {
proxy = QFileInfo(proxy).fileName();
if (dir.exists(proxy)) {
dir.remove(proxy);
}
}
});
connect(panel, &ClipPropertiesController::deleteProxy, this, &ProjectClip::deleteProxy);
return panel;
}
void ProjectClip::deleteProxy()
{
// Disable proxy file
QString proxy = getProducerProperty(QStringLiteral("kdenlive:proxy"));
QList<std::shared_ptr<ProjectClip>> clipList {std::static_pointer_cast<ProjectClip>(shared_from_this())};
pCore->currentDoc()->slotProxyCurrentItem(false, clipList);
// Delete
bool ok;
QDir dir = pCore->currentDoc()->getCacheDir(CacheProxy, &ok);
if (ok && proxy.length() > 2) {
proxy = QFileInfo(proxy).fileName();
if (dir.exists(proxy)) {
dir.remove(proxy);
}
}
}
void ProjectClip::updateParent(std::shared_ptr<TreeItem> parent)
{
if (parent) {
......
......@@ -244,6 +244,8 @@ public slots:
void updateAudioThumbnail(QVariantList audioLevels);
/** @brief Extract image thumbnails for timeline. */
void slotExtractImage(const QList<int> &frames);
/** @brief Delete the proxy file */
void deleteProxy();
private:
/** @brief Generate and store file hash if not available. */
......
......@@ -1662,7 +1662,6 @@ void MainWindow::slotEditProjectSettings()
if (pCore->projectItemModel()->clipsCount() > 0 &&
KMessageBox::questionYesNo(this, i18n("You have changed the proxy parameters. Do you want to recreate all proxy clips for this project?")) ==
KMessageBox::Yes) {
// TODO: rebuild all proxies
pCore->bin()->rebuildProxies();
}
}
......
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