From c8ebcc09c284b5aa5b918e8103db2d812d1e8029 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 27 Dec 2012 23:03:56 +0100 Subject: [PATCH] Reorganize a bit opening sequence hoping that it can help with crash: http://kdenlive.org/mantis/view.php?id=2885 --- src/initeffects.cpp | 3 +-- src/mainwindow.cpp | 47 +++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/initeffects.cpp b/src/initeffects.cpp index 56e6c977..d7a190d3 100644 --- a/src/initeffects.cpp +++ b/src/initeffects.cpp @@ -229,8 +229,7 @@ void initEffects::parseEffectFiles(const QString &locale) MainWindow::transitions.clearList(); foreach(const QDomElement & effect, effectsMap) MainWindow::transitions.append(effect); - effectsMap.clear(); - + effectsMap.clear(); // Create effects from MLT foreach(const QString & filtername, mltFiltersList) { QDomDocument doc = createDescriptionFromMlt(repository, "filters", filtername); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 36cbb8b0..e3ece7e5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -574,29 +574,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & slotConnectMonitors(); - // Open or create a file. Command line argument passed in Url has - // precedence, then "openlastproject", then just a plain empty file. - // If opening Url fails, openlastproject will _not_ be used. - if (!Url.isEmpty()) { - // delay loading so that the window shows up - m_startUrl = Url; - QTimer::singleShot(500, this, SLOT(openFile())); - } else if (KdenliveSettings::openlastproject()) { - QTimer::singleShot(500, this, SLOT(openLastFile())); - } else { //if (m_timelineArea->count() == 0) { - newFile(false); - } - - if (!clipsToLoad.isEmpty() && m_activeDocument) { - QStringList list = clipsToLoad.split(','); - QList urls; - foreach(const QString &path, list) { - kDebug() << QDir::current().absoluteFilePath(path); - urls << QUrl::fromLocalFile(QDir::current().absoluteFilePath(path)); - } - m_projectList->slotAddClip(urls); - } - #ifdef USE_JOGSHUTTLE activateShuttleDevice(); #endif @@ -669,6 +646,30 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & } connect (KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(slotChangePalette())); + + // Open or create a file. Command line argument passed in Url has + // precedence, then "openlastproject", then just a plain empty file. + // If opening Url fails, openlastproject will _not_ be used. + if (!Url.isEmpty()) { + // delay loading so that the window shows up + m_startUrl = Url; + QTimer::singleShot(500, this, SLOT(openFile())); + } else if (KdenliveSettings::openlastproject()) { + QTimer::singleShot(500, this, SLOT(openLastFile())); + } else { //if (m_timelineArea->count() == 0) { + newFile(false); + } + + if (!clipsToLoad.isEmpty() && m_activeDocument) { + QStringList list = clipsToLoad.split(','); + QList urls; + foreach(const QString &path, list) { + kDebug() << QDir::current().absoluteFilePath(path); + urls << QUrl::fromLocalFile(QDir::current().absoluteFilePath(path)); + } + m_projectList->slotAddClip(urls); + } + } MainWindow::~MainWindow() -- 2.39.2