]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Fix issue 254: starting up with project supplied on CLI should not result in 'Untitle...
[kdenlive] / src / mainwindow.cpp
index 40b1a73a054ae911e6c6a293725e4b3b325bd63f..d214cd2f10d6b4dc6a78a148286519ad8c0526fc 100644 (file)
@@ -98,7 +98,7 @@ EffectsList MainWindow::audioEffects;
 EffectsList MainWindow::customEffects;
 EffectsList MainWindow::transitions;
 
-MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
+MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent)
         : KXmlGuiWindow(parent),
         m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL),
 #ifndef NO_JOGSHUTTLE
@@ -321,17 +321,17 @@ MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
     slotConnectMonitors();
 
-    if (KdenliveSettings::openlastproject()) {
-        openLastFile();
+    // 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()) {
+        openFile(Url);
     } else {
-        /*QList<KAutoSaveFile *> staleFiles = KAutoSaveFile::allStaleFiles();
-        if (!staleFiles.isEmpty()) {
-            if (KMessageBox::questionYesNo(this, i18n("Auto-saved files exist. Do you want to recover them now?"), i18n("File Recovery"), KGuiItem(i18n("Recover")), KGuiItem(i18n("Don't recover"))) == KMessageBox::Yes) {
-         recoverFiles(staleFiles);
-            }
-            else newFile();
+        if (KdenliveSettings::openlastproject()) {
+            openLastFile();
         }
-        else*/
+    }
+    if (m_timelineArea->count() == 0) {
         newFile(false);
     }