]> git.sesse.net Git - kdenlive/blobdiff - src/kdenlivesettingsdialog.cpp
remove useless locks
[kdenlive] / src / kdenlivesettingsdialog.cpp
index 950db589f7bd0b72491c7764b7026f91df7425e5..140823c1b549ea0b2cac1a77a789fb2366c3cfbd 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "kdenlivesettingsdialog.h"
 #include "profilesdialog.h"
-#if !defined(Q_OS_FREEBSD)
+#if !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD)
 #include "v4l/v4lcapture.h"
 #endif
 #include "blackmagic/devices.h"
@@ -63,6 +63,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
 
     // Hide multi tab option until Kdenlive really supports it
     m_configMisc.kcfg_activatetabs->setVisible(false);
+    // Hide avformat-novalidate trick, causes crash (bug #2205 and #2206)
+    m_configMisc.kcfg_projectloading_avformatnovalidate->setVisible(false);
 
     QWidget *p8 = new QWidget;
     m_configProject.setupUi(p8);
@@ -81,7 +83,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
     m_configEnv.mltpathurl->setMode(KFile::Directory);
     m_configEnv.mltpathurl->lineEdit()->setObjectName("kcfg_mltpath");
     m_configEnv.rendererpathurl->lineEdit()->setObjectName("kcfg_rendererpath");
-    m_configEnv.kcfg_mltthreads->setMaximum(QThread::idealThreadCount());
+    m_configEnv.kcfg_mltthreads->setMaximum( QThread::idealThreadCount() < 4 ? QThread::idealThreadCount() : 3 );
     m_configEnv.tmppathurl->setMode(KFile::Directory);
     m_configEnv.tmppathurl->lineEdit()->setObjectName("kcfg_currenttmpfolder");
     m_configEnv.projecturl->setMode(KFile::Directory);
@@ -95,7 +97,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
     QWidget *p4 = new QWidget;
     m_configCapture.setupUi(p4);
 
-#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD)
+#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD)
 
     // Video 4 Linux device detection
     for (int i = 0; i < 10; i++) {
@@ -111,6 +113,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
     connect(m_configCapture.kcfg_detectedv4ldevices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lDevice()));
     connect(m_configCapture.kcfg_v4l_format, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lCaptureProfile()));
     connect(m_configCapture.kcfg_v4l_captureaudio, SIGNAL(toggled(bool)), m_configCapture.kcfg_v4l_alsadevice, SLOT(setEnabled(bool)));
+    connect(m_configCapture.config_v4l, SIGNAL(clicked()), this, SLOT(slotEditVideo4LinuxProfile()));
 
     slotUpdatev4lDevice();
 #endif
@@ -429,8 +432,8 @@ void KdenliveSettingsDialog::slotReadAudioDevices()
     kDebug() << result;
     QStringList lines = result.split('\n');
     foreach(const QString & data, lines) {
-        kDebug() << "// READING LINE: " << data;
-        if (data.simplified().startsWith("card")) {
+        //kDebug() << "// READING LINE: " << data;
+        if (!data.startsWith(" ") && data.count(':') > 1) {
             QString card = data.section(':', 0, 0).section(' ', -1);
             QString device = data.section(':', 1, 1).section(' ', -1);
             m_configSdl.kcfg_audio_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device);
@@ -828,7 +831,9 @@ void KdenliveSettingsDialog::slotUpdatev4lDevice()
     m_configCapture.kcfg_v4l_format->clear();
 
     QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
-    if (QFile::exists(vl4ProfilePath)) m_configCapture.kcfg_v4l_format->addItem(i18n("Current settings"));
+    if (QFile::exists(vl4ProfilePath)) {
+        m_configCapture.kcfg_v4l_format->addItem(i18n("Current settings"));
+    }
 
     QStringList pixelformats = info.split(">", QString::SkipEmptyParts);
     QString itemSize;
@@ -979,8 +984,10 @@ void KdenliveSettingsDialog::loadEncodingProfiles()
         k.next();
         if (!k.key().isEmpty()) m_configProject.kcfg_proxy_profile->addItem(k.key(), k.value());
     }
-    m_configProject.kcfg_proxy_profile->blockSignals(false);
     if (!currentItem.isEmpty()) m_configProject.kcfg_proxy_profile->setCurrentIndex(m_configProject.kcfg_proxy_profile->findText(currentItem));
+    m_configProject.kcfg_proxy_profile->blockSignals(false);
+    slotUpdateProxyProfile();
+    
 }
 
 void KdenliveSettingsDialog::slotUpdateDecklinkProfile(int ix)
@@ -1013,6 +1020,17 @@ void KdenliveSettingsDialog::slotUpdateProxyProfile(int ix)
     //
 }
 
+void KdenliveSettingsDialog::slotEditVideo4LinuxProfile()
+{
+    QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+    ProfilesDialog *w = new ProfilesDialog(vl4ProfilePath);
+    if (w->exec() == QDialog::Accepted) {
+        // save and update profile
+        loadCurrentV4lProfileInfo();
+    }
+    delete w;
+}
+
 #include "kdenlivesettingsdialog.moc"