]> git.sesse.net Git - kdenlive/blobdiff - src/titlewidget.cpp
Const'ref
[kdenlive] / src / titlewidget.cpp
index b0d2b2cdddc460f27457d3108ac5962dee5fd409..e8184fabeb26483e94abadafd73bd80825bd9ae8 100644 (file)
@@ -503,8 +503,9 @@ TitleWidget::TitleWidget(const KUrl &url, const Timecode &tc, const QString &pro
 
     // scale the view so that the title widget is not too big at startup
     graphicsView->scale(.5, .5);
-    if (!url.isEmpty()) loadTitle(url);
-    else {
+    if (!url.isEmpty()) {
+        loadTitle(url);
+    } else {
         prepareTools(NULL);
         slotTextTool();
         QTimer::singleShot(200, this, SLOT(slotAdjustZoom()));
@@ -639,12 +640,14 @@ void TitleWidget::refreshTitleTemplates()
     }
     kDebug()  << titlenamelist << titlefiles;
 }
+
 void TitleWidget::templateIndexChanged(int index)
 {
     QString item = templateBox->itemData(index).toString();
     if (!item.isEmpty()) {
         if (lastDocumentHash != QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex()) {
-            if (KMessageBox::questionYesNo(this, i18n("Do you really want to load a new template? Changes in this title will be lost!")) == KMessageBox::No) return;
+            if (KMessageBox::questionYesNo(this, i18n("Do you really want to load a new template? Changes in this title will be lost!")) == KMessageBox::No)
+                return;
         }
         loadTitle(item);
 
@@ -669,9 +672,11 @@ void TitleWidget::resizeEvent(QResizeEvent * /*event*/)
     //slotAdjustZoom();
 }
 //virtual
-void TitleWidget::keyPressEvent(QKeyEvent *e){
+void TitleWidget::keyPressEvent(QKeyEvent *e)
+{
     if(e->key()!=Qt::Key_Escape && e->key()!=Qt::Key_Return && e->key()!=Qt::Key_Enter) QDialog::keyPressEvent(e);
 }
+
 void TitleWidget::slotTextTool()
 {
     m_scene->setTool(TITLE_TEXT);
@@ -1078,10 +1083,7 @@ void TitleWidget::selectionChanged()
             zUp->setEnabled(false);
             zDown->setEnabled(false);
         }
-
-
     }
-
 }
 
 void TitleWidget::slotValueChanged(int type)
@@ -1110,7 +1112,7 @@ void TitleWidget::slotValueChanged(int type)
         break;
     }
 
-    for (int k = 0; k < l.size(); k++) {
+    for (int k = 0; k < l.size(); ++k) {
         std::cout << "Type of item " << k << ": " << l.at(k)->type() << "\n";
 
         if (l.at(k)->type() == TEXTITEM) {
@@ -1618,8 +1620,7 @@ void TitleWidget::slotUpdateText()
 void TitleWidget::rectChanged()
 {
     QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
-    int i;
-    for (i = 0; i < l.length(); ++i) {
+    for (int i = 0; i < l.length(); ++i) {
         if (l.at(i)->type() == RECTITEM && !settingUp) {
             QGraphicsRectItem *rec = static_cast<QGraphicsRectItem *>(l.at(i));
             QColor f = rectFColor->color();
@@ -1878,8 +1879,9 @@ void TitleWidget::saveTitle(KUrl url)
         fs->setMode(KFile::File);
         fs->setConfirmOverwrite(true);
         fs->setKeepLocation(true);
-        fs->exec();
-        if (fs) url = fs->selectedUrl();
+        if (fs->exec()) {
+            url = fs->selectedUrl();
+        }
         delete fs;
     }
     if (!url.isEmpty()) {