Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix double separator in project/capture folder

CCBUG: 387135
parent 86f77a90
......@@ -388,9 +388,9 @@ void RenderWidget::setDocumentPath(const QString &path)
{
if (m_view.out_file->url().adjusted(QUrl::RemoveFilename).toLocalFile() == QUrl::fromLocalFile(m_projectFolder).adjusted(QUrl::RemoveFilename).toLocalFile()) {
const QString fileName = m_view.out_file->url().fileName();
m_view.out_file->setUrl(QUrl::fromLocalFile(path + fileName));
m_view.out_file->setUrl(QUrl::fromLocalFile(QDir(path).absoluteFilePath(fileName)));
}
m_projectFolder = path;
m_projectFolder = QUrl::fromLocalFile(path).adjusted(QUrl::NormalizePathSegments | QUrl::StripTrailingSlash).toLocalFile() + QDir::separator();
parseScriptFiles();
}
......
......@@ -1695,10 +1695,10 @@ void MainWindow::slotEditProjectSettings()
pCore->projectManager()->currentTimeline()->updatePreviewSettings(w->selectedPreview());
bool modified = false;
if (m_recMonitor) {
m_recMonitor->slotUpdateCaptureFolder(project->projectDataFolder() + QDir::separator());
m_recMonitor->slotUpdateCaptureFolder(project->projectDataFolder());
}
if (m_renderWidget) {
m_renderWidget->setDocumentPath(project->projectDataFolder() + QDir::separator());
m_renderWidget->setDocumentPath(project->projectDataFolder());
}
if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) {
slotSwitchVideoThumbs();
......@@ -1816,7 +1816,7 @@ void MainWindow::slotRenderProject()
connect(m_renderWidget, &RenderWidget::openDvdWizard, this, &MainWindow::slotDvdWizard);
m_renderWidget->setProfile(project->mltProfile().path);
m_renderWidget->setGuides(pCore->projectManager()->currentTimeline()->projectView()->guidesData(), project->projectDuration());
m_renderWidget->setDocumentPath(project->projectDataFolder() + QDir::separator());
m_renderWidget->setDocumentPath(project->projectDataFolder());
m_renderWidget->setRenderProfile(project->getRenderProperties());
}
if (m_compositeAction->currentAction()) {
......@@ -2026,7 +2026,7 @@ void MainWindow::connectDocument()
slotCheckRenderStatus();
m_renderWidget->setProfile(project->mltProfile().path);
m_renderWidget->setGuides(pCore->projectManager()->currentTimeline()->projectView()->guidesData(), project->projectDuration());
m_renderWidget->setDocumentPath(project->projectDataFolder() + QDir::separator());
m_renderWidget->setDocumentPath(project->projectDataFolder());
m_renderWidget->setRenderProfile(project->getRenderProperties());
}
m_zoomSlider->setValue(project->zoom().x());
......@@ -2041,7 +2041,7 @@ void MainWindow::connectDocument()
pCore->monitorManager()->setDocument(project);
trackView->updateProfile(1.0);
if (m_recMonitor) {
m_recMonitor->slotUpdateCaptureFolder(project->projectDataFolder() + QDir::separator());
m_recMonitor->slotUpdateCaptureFolder(project->projectDataFolder());
}
// Init document zone
m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
......@@ -2158,7 +2158,7 @@ void MainWindow::slotUpdateCaptureFolder()
{
if (m_recMonitor) {
if (pCore->projectManager()->current()) {
m_recMonitor->slotUpdateCaptureFolder(pCore->projectManager()->current()->projectDataFolder() + QDir::separator());
m_recMonitor->slotUpdateCaptureFolder(pCore->projectManager()->current()->projectDataFolder());
} else {
m_recMonitor->slotUpdateCaptureFolder(KdenliveSettings::defaultprojectfolder());
}
......
......@@ -197,8 +197,14 @@ void RecMonitor::slotUpdateCaptureFolder(const QString &currentProjectFolder)
{
if (KdenliveSettings::capturetoprojectfolder()) {
m_capturePath = currentProjectFolder;
if (!m_capturePath.endsWith(QDir::separator())) {
m_capturePath.append(QDir::separator());
}
} else {
m_capturePath = KdenliveSettings::capturefolder();
if (!m_capturePath.endsWith(QDir::separator())) {
m_capturePath.append(QDir::separator());
}
}
if (m_captureProcess) {
m_captureProcess->setWorkingDirectory(m_capturePath);
......@@ -630,11 +636,11 @@ void RecMonitor::slotRecord()
} else if (device_selector->currentIndex() == BlackMagic) {
extension = KdenliveSettings::decklink_extension();
}
QString path = QUrl(m_capturePath).toLocalFile() + QDir::separator() + QStringLiteral("capture0000.") + extension;
QString path = QDir(m_capturePath).absoluteFilePath(QStringLiteral("capture0000.") + extension);
int i = 1;
while (QFile::exists(path)) {
QString num = QString::number(i).rightJustified(4, '0', false);
path = QUrl(m_capturePath).toLocalFile() + QDir::separator() + QStringLiteral("capture") + num + QLatin1Char('.') + extension;
path = QDir(m_capturePath).absoluteFilePath(QStringLiteral("capture") + num + QLatin1Char('.') + extension);
++i;
}
m_captureFile = QUrl(path);
......@@ -1033,12 +1039,12 @@ void RecMonitor::slotPlay()
void RecMonitor::slotReadProcessInfo()
{
QString data = m_captureProcess->readAllStandardError().simplified();
QString processData = m_captureProcess->readAllStandardError().simplified();
if (device_selector->currentIndex() == ScreenBag) {
m_error.append(data + QLatin1Char('\n'));
m_error.append(processData + QLatin1Char('\n'));
} else if (device_selector->currentIndex() == Firewire) {
data = data.section(QLatin1Char('"'), 2, 2).simplified();
m_dvinfo.setText(data.left(11));
processData = processData.section(QLatin1Char('"'), 2, 2).simplified();
m_dvinfo.setText(processData.left(11));
m_dvinfo.updateGeometry();
}
}
......
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