Don't leak Mlt repository on first run (attempt to fix Windows fail on first run)

Make "Video" folder as default for clip import on first run
parent cc64619a
Pipeline #4886 failed with stage
in 1 second
......@@ -360,9 +360,6 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QString &par
l->addStretch(5);
f->setLayout(l);
QString clipFolder = KRecentDirs::dir(QStringLiteral(":KdenliveClipFolder"));
if (clipFolder.isEmpty()) {
clipFolder = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
}
QScopedPointer<QDialog> dlg(new QDialog((QWidget *)doc->parent()));
QScopedPointer<KFileWidget> fileWidget(new KFileWidget(QUrl::fromLocalFile(clipFolder), dlg.data()));
auto *layout = new QVBoxLayout;
......
......@@ -384,7 +384,8 @@ void Wizard::slotUpdateCaptureParameters()
void Wizard::checkMltComponents()
{
m_brokenModule = false;
Mlt::Repository *repository = Mlt::Factory::init();
std::unique_ptr<Mlt::Repository> repository(Mlt::Factory::init());
if (!repository) {
m_errors.append(i18n("<li>Cannot start MLT backend, check your installation</li>"));
m_systemCheckIsOk = false;
......
......@@ -1576,6 +1576,9 @@ bool MainWindow::readOptions()
if (!initialGroup.exists() || KdenliveSettings::sdlAudioBackend().isEmpty()) {
// First run, check if user is on a KDE Desktop
firstRun = true;
//Define default video location for first run
KRecentDirs::add(QStringLiteral(":KdenliveClipFolder"), QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
// this is our first run, show Wizard
QPointer<Wizard> w = new Wizard(true, false);
if (w->exec() == QDialog::Accepted && w->isOk()) {
......
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