]> git.sesse.net Git - kdenlive/blobdiff - src/geometrywidget.cpp
Freesound.org integration (in progress)
[kdenlive] / src / geometrywidget.cpp
index 04fe9085b601d6721bd9ae348a47bb1c13aebfde..321ab76fecb8500362922d3e6e92e2aba66512d2 100644 (file)
@@ -271,12 +271,13 @@ QString GeometryWidget::getExtraValue(const QString &name) const
 {
     int ix = m_extraGeometryNames.indexOf(name);
     QString val = m_extraGeometries.at(ix)->serialise();
-    if (!val.contains("=")) val = val.section(',', 0, 0);
+    if (!val.contains("=")) val = val.section('/', 0, 0);
     else {
-        QStringList list = val.split(';');
+        QStringList list = val.split(';', QString::SkipEmptyParts);
         val.clear();
+        val.append(list.takeFirst().section('/', 0, 0));
         foreach (const QString value, list) {
-            val.append(value.section(',', 0, 0) + ';');
+            val.append(';' + value.section('/', 0, 0));
         }
     }
     return val;
@@ -711,7 +712,9 @@ void GeometryWidget::setFrameSize(QPoint size)
 
 void GeometryWidget::slotAdjustToFrameSize()
 {
-    if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
+    if (m_frameSize == QPoint() || m_frameSize.x() == 0 || m_frameSize.y() == 0) {
+        m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
+    }
     m_spinWidth->blockSignals(true);
     m_spinHeight->blockSignals(true);
     m_spinWidth->setValue((int) (m_frameSize.x() / m_monitor->render->sar() + 0.5));
@@ -723,7 +726,9 @@ void GeometryWidget::slotAdjustToFrameSize()
 
 void GeometryWidget::slotFitToWidth()
 {
-    if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
+    if (m_frameSize == QPoint() || m_frameSize.x() == 0 || m_frameSize.y() == 0) {
+        m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
+    }
     double factor = (double) m_monitor->render->frameRenderWidth() / m_frameSize.x() * m_monitor->render->sar();
     m_spinWidth->blockSignals(true);
     m_spinHeight->blockSignals(true);
@@ -736,7 +741,9 @@ void GeometryWidget::slotFitToWidth()
 
 void GeometryWidget::slotFitToHeight()
 {
-    if (m_frameSize == QPoint()) m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
+    if (m_frameSize == QPoint() || m_frameSize.x() == 0 || m_frameSize.y() == 0) {
+        m_frameSize = QPoint(m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
+    }
     double factor = (double) m_monitor->render->renderHeight() / m_frameSize.y();
     m_spinWidth->blockSignals(true);
     m_spinHeight->blockSignals(true);