]> git.sesse.net Git - kdenlive/commitdiff
- Avoid some code duplication.
authorAlberto Villa <avilla@FreeBSD.org>
Sun, 12 Sep 2010 03:15:26 +0000 (03:15 +0000)
committerAlberto Villa <avilla@FreeBSD.org>
Sun, 12 Sep 2010 03:15:26 +0000 (03:15 +0000)
svn path=/trunk/kdenlive/; revision=4870

src/mainwindow.cpp

index 7008e4e129db313b2c1caa597023e22f796e9977..4caa2f50ef8c42ea8194bcfc1474080a973a111c 100644 (file)
@@ -1571,21 +1571,27 @@ void MainWindow::slotRunWizard()
 
 void MainWindow::newFile(bool showProjectSettings, bool force)
 {
-    if (!m_timelineArea->isEnabled() && !force) return;
+    if (!m_timelineArea->isEnabled() && !force)
+        return;
     m_fileRevert->setEnabled(false);
-    QString profileName;
-    KUrl projectFolder;
+    QString profileName = KdenliveSettings::default_profile();
+    KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
     QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
     if (!showProjectSettings) {
-        if (!KdenliveSettings::activatetabs()) if (!closeCurrentDocument()) return;
-        profileName = KdenliveSettings::default_profile();
-        projectFolder = KdenliveSettings::defaultprojectfolder();
+        if (!KdenliveSettings::activatetabs())
+            if (!closeCurrentDocument())
+                return;
     } else {
         ProjectSettings *w = new ProjectSettings(NULL, QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
-        if (w->exec() != QDialog::Accepted) return;
-        if (!KdenliveSettings::activatetabs()) if (!closeCurrentDocument()) return;
-        if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) slotSwitchVideoThumbs();
-        if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
+        if (w->exec() != QDialog::Accepted)
+            return;
+        if (!KdenliveSettings::activatetabs())
+            if (!closeCurrentDocument())
+                return;
+        if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs())
+            slotSwitchVideoThumbs();
+        if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs())
+            slotSwitchAudioThumbs();
         profileName = w->selectedProfile();
         projectFolder = w->selectedFolder();
         projectTracks = w->tracks();
@@ -1608,7 +1614,8 @@ void MainWindow::newFile(bool showProjectSettings, bool force)
     if (m_timelineArea->count() == 1) {
         connectDocumentInfo(doc);
         connectDocument(trackView, doc);
-    } else m_timelineArea->setTabBarHidden(false);
+    } else
+        m_timelineArea->setTabBarHidden(false);
     m_monitorManager->activateMonitor("clip");
     m_closeAction->setEnabled(m_timelineArea->count() > 1);
 }