]> git.sesse.net Git - kdenlive/blobdiff - src/titledocument.cpp
Fix mem leak
[kdenlive] / src / titledocument.cpp
index d48cc6fedc1dfff2cd3201ab9dfe1e00c8ff57ae..66c8e196db0976bc4a9cd10053cdb9332636a50c 100644 (file)
@@ -182,7 +182,7 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
             if (!t->data(100).isNull()) {
                 QStringList effectParams = t->data(100).toStringList();
                 QString effectName = effectParams.takeFirst();
-               content.setAttribute("textwidth", QString::number(t->sceneBoundingRect().width()));
+               content.setAttribute("textwidth", t->sceneBoundingRect().width());
                 content.setAttribute(effectName, effectParams.join(";"));
             }
 
@@ -231,7 +231,8 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
             if (blur) {
                 effect.setAttribute("type", "blur");
                 effect.setAttribute("blurradius", blur->blurRadius());
-            } else {
+            } /*else {
+               //WARNING:those effects are anyways broken because they use QPixmaps which are not safe for MLT's threaded workflow
                 QGraphicsDropShadowEffect *shadow = static_cast <QGraphicsDropShadowEffect *>(eff);
                 if (shadow) {
                     effect.setAttribute("type", "shadow");
@@ -239,7 +240,7 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
                     effect.setAttribute("xoffset", shadow->xOffset());
                     effect.setAttribute("yoffset", shadow->yOffset());
                 }
-            }
+            }*/
             e.appendChild(effect);
         }
 #endif
@@ -269,7 +270,7 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
 
 /** \brief Get the background color (incl. alpha) from the document, if possibly
   * \returns The background color of the document, inclusive alpha. If none found, returns (0,0,0,0) */
-QColor TitleDocument::getBackgroundColor()
+QColor TitleDocument::getBackgroundColor() const
 {
     QColor color(0, 0, 0, 0);
     if (m_scene) {
@@ -311,7 +312,7 @@ bool TitleDocument::saveDocument(const KUrl& url, QGraphicsRectItem* startv, QGr
     return KIO::NetAccess::upload(tmpfile.fileName(), url, 0);
 }
 
-int TitleDocument::loadFromXml(QDomDocument doc, QGraphicsRectItem* startv, QGraphicsRectItem* endv, int *duration, const QString& projectpath)
+int TitleDocument::loadFromXml(const QDomDocument& doc, QGraphicsRectItem* startv, QGraphicsRectItem* endv, int *duration, const QString& projectpath)
 {
     m_projectPath = projectpath;
     QDomNodeList titles = doc.elementsByTagName("kdenlivetitle");