Commit b11bf778 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2004'

parents cddc7de0 8403633b
Pipeline #19661 passed with stage
in 9 minutes and 44 seconds
......@@ -97,6 +97,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
m_toolbar = new QToolBar(this);
Monitor *monitor = pCore->getMonitor(m_model->monitorId);
connect(monitor, &Monitor::seekPosition, this, &KeyframeWidget::monitorSeek, Qt::UniqueConnection);
m_time = new TimecodeDisplay(pCore->timecode(), this);
m_time->setRange(0, duration - 1);
......@@ -411,11 +412,6 @@ void KeyframeWidget::slotInitMonitor(bool active)
connect(monitor, &Monitor::updateScene, m_keyframeview, &KeyframeView::slotModelChanged, Qt::UniqueConnection);
}
connectMonitor(active);
if (active) {
connect(monitor, &Monitor::seekPosition, this, &KeyframeWidget::monitorSeek, Qt::UniqueConnection);
} else {
disconnect(monitor, &Monitor::seekPosition, this, &KeyframeWidget::monitorSeek);
}
}
void KeyframeWidget::connectMonitor(bool active)
......
......@@ -612,22 +612,20 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
backupFile));
}
}
QFile file(path);
QSaveFile file(path);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qCWarning(KDENLIVE_LOG) << "////// ERROR writing to file: " << path;
KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file %1", path));
return false;
}
file.write(sceneList.toString().toUtf8());
if (file.error() != QFile::NoError) {
const QByteArray sceneData = sceneList.toString().toUtf8();
file.write(sceneData);
if (!file.commit()) {
KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file %1", path));
file.close();
return false;
}
file.close();
cleanupBackupFiles();
QFileInfo info(file);
QFileInfo info(path);
QString fileName = QUrl::fromLocalFile(path).fileName().section(QLatin1Char('.'), 0, -2);
fileName.append(QLatin1Char('-') + m_documentProperties.value(QStringLiteral("documentid")));
fileName.append(info.lastModified().toString(QStringLiteral("-yyyy-MM-dd-hh-mm")));
......
......@@ -1338,13 +1338,13 @@ bool TimelineController::requestSpacerEndOperation(int clipId, int startPosition
void TimelineController::seekCurrentClip(bool seekToEnd)
{
const auto selection = m_model->getCurrentSelection();
for (int cid : selection) {
if (!selection.empty()) {
int cid = *selection.begin();
int start = m_model->getItemPosition(cid);
if (seekToEnd) {
start += m_model->getItemPlaytime(cid);
}
setPosition(start);
break;
}
}
......
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