]> git.sesse.net Git - kdenlive/blobdiff - src/titlewidget.cpp
- Make reindent.sh work when not called from its own directory.
[kdenlive] / src / titlewidget.cpp
index 05c5ad72e29cffa7d4e69193738aeb0a77bec81e..d79851abf7f404ad5779438cfc66c5b4856c1e38 100644 (file)
@@ -431,18 +431,17 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
     initAnimation();
     connect(anim_start, SIGNAL(toggled(bool)), this, SLOT(slotAnimStart(bool)));
     connect(anim_end, SIGNAL(toggled(bool)), this, SLOT(slotAnimEnd(bool)));
-       connect(templateBox,SIGNAL(currentIndexChanged(int)),this,SLOT(templateIndexChanged(int)));
+    connect(templateBox, SIGNAL(currentIndexChanged(int)), this, SLOT(templateIndexChanged(int)));
 
     buttonBox->button(QDialogButtonBox::Ok)->setEnabled(KdenliveSettings::hastitleproducer());
-       refreshTitleTemplates();
-       //templateBox->setIconSize(QSize(60,60));
-       templateBox->clear();
-       templateBox->addItem("");
-       foreach (TitleTemplate t, titletemplates)
-       {
-               templateBox->addItem(t.icon,t.name,t.file);
-       }
-       lastDocumentHash=QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex();
+    refreshTitleTemplates();
+    //templateBox->setIconSize(QSize(60,60));
+    templateBox->clear();
+    templateBox->addItem("");
+    foreach(TitleTemplate t, titletemplates) {
+        templateBox->addItem(t.icon, t.name, t.file);
+    }
+    lastDocumentHash = QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex();
 }
 
 TitleWidget::~TitleWidget()
@@ -527,38 +526,36 @@ QStringList TitleWidget::extractFontList(QString xml)
 //static
 void TitleWidget::refreshTitleTemplates()
 {
-       QStringList titlenamelist = QStringList() << i18n("None");
+    QStringList titlenamelist = QStringList() << i18n("None");
     QStringList titlefiles = QStringList() << QString();
     QStringList filters;
     filters << "*.kdenlivetitle" ;
-       titletemplates.clear();
+    titletemplates.clear();
     QStringList titleTemplates = KGlobal::dirs()->findDirs("appdata", "titles");
     foreach(const QString &folder, titleTemplates) {
         QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
         foreach(const QString &fname, filesnames) {
-                       //titlenamelist.append(fname);
+            //titlenamelist.append(fname);
             //titlefiles.append(KUrl(folder).path(KUrl::AddTrailingSlash) + fname);
-                       TitleTemplate t;
-                       t.name=fname;
-                       t.file=KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
-                       t.icon=QIcon(KThumb::getImage(t.file,0,60,60));
-                       titletemplates.append(t);               
+            TitleTemplate t;
+            t.name = fname;
+            t.file = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
+            t.icon = QIcon(KThumb::getImage(t.file, 0, 60, 60));
+            titletemplates.append(t);
         }
     }
-       kDebug()  << titlenamelist << titlefiles;
+    kDebug()  << titlenamelist << titlefiles;
 }
-void TitleWidget::templateIndexChanged(int index )
+void TitleWidget::templateIndexChanged(int index)
 {
-       QString item=templateBox->itemData(index).toString();
-       if (item!="")
-       {
-               if (lastDocumentHash!=QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex())
-               {
-                        if (KMessageBox::questionYesNo(this, i18n("Title was changed !\nDo you really want to load a new template?\nAll changes in this document are lost !!")) == KMessageBox::No) return;
-               }
-               loadTitle(item);
-               lastDocumentHash=QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex();
-       }
+    QString item = templateBox->itemData(index).toString();
+    if (item != "") {
+        if (lastDocumentHash != QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex()) {
+            if (KMessageBox::questionYesNo(this, i18n("Title was changed !\nDo you really want to load a new template?\nAll changes in this document are lost !!")) == KMessageBox::No) return;
+        }
+        loadTitle(item);
+        lastDocumentHash = QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex();
+    }
 }
 //virtual
 void TitleWidget::resizeEvent(QResizeEvent * /*event*/)