]> git.sesse.net Git - kdenlive/commitdiff
- Make reindent.sh work when not called from its own directory.
authorAlberto Villa <avilla@FreeBSD.org>
Tue, 30 Mar 2010 11:43:37 +0000 (11:43 +0000)
committerAlberto Villa <avilla@FreeBSD.org>
Tue, 30 Mar 2010 11:43:37 +0000 (11:43 +0000)
- Reindent some source files.

svn path=/trunk/kdenlive/; revision=4363

reindent.sh
src/monitor.cpp
src/slideshowclip.cpp
src/timecode.cpp
src/titlewidget.cpp
src/titlewidget.h

index 0233d0c38ad9cfcfeb87ef248880f5252068fcaa..5d6708de1ad270b86e05b89dd704912389b42756 100755 (executable)
@@ -1,6 +1,7 @@
 #! /bin/sh
 
-SRCDIRS="src plugins renderer thumbnailer"
+WRKDIR=$(dirname $0)
+SRCDIRS="$WRKDIR/src $WRKDIR/plugins $WRKDIR/renderer $WRKDIR/thumbnailer"
 
 if [ $# -gt 0 ]
 then
index 9504ec4fcc1147e78a36e226f1541ac581389693..f2db5f3691ab70962ceda7d0c8b39370c87b7873 100644 (file)
@@ -119,7 +119,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget
         m_timePos->setInputMask(QString());
         m_timePos->setValidator(new QIntValidator(this));
     } else m_timePos->setInputMask(m_monitorManager->timecode().inputMask());
-    
+
     toolbar->addWidget(m_timePos);
 
     connect(m_timePos, SIGNAL(editingFinished()), this, SLOT(slotSeek()));
index 04c2914d7db9a84833573dfa04a804759fea3888..37195a36f10933581f1c478445a8aa103196cea1 100644 (file)
@@ -52,7 +52,7 @@ SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
     m_view.image_type->addItem("TGA (*.tga)", "tga");
     m_view.image_type->addItem("TIFF (*.tiff)", "tiff");
     m_view.image_type->addItem("Open EXR (*.exr)", "exr");
-    
+
     m_view.clip_duration->setInputMask(m_timecode.inputMask());
     m_view.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::image_duration()));
     m_view.luma_duration->setInputMask(m_timecode.inputMask());
index 5be3c3f6fdeb4f9341809382dac544e27e73c835..8e8465ff938e7e0ad99d6be2ca0f31708218a3e8 100644 (file)
@@ -66,7 +66,7 @@ int Timecode::getFrameCount(const QString duration) const
     if (m_dropFrame) {
         //Get Hours, Minutes, Seconds, Frames from timecode
         int hours, minutes, seconds, frames;
-        
+
         hours = duration.section(':', 0, 0).toInt();
         if (duration.contains('.')) {
             minutes = duration.section('.', 0, 0).section(':', 1, 1).toInt();
@@ -78,9 +78,9 @@ int Timecode::getFrameCount(const QString duration) const
             seconds = duration.section(':', 2, 2).toInt();
             frames = duration.section(':', 3, 3).toInt();
         }
-        
+
         //Calculate the frame count
-        int dropRate = (int) ((ceil(m_displayedFramesPerSecond) / 30) * 2);
+        int dropRate = (int)((ceil(m_displayedFramesPerSecond) / 30) * 2);
         frames += ((hours * 60 + minutes) * 60 + seconds) * m_displayedFramesPerSecond;
         frames -= dropRate * ((hours * 60 + minutes) - (floor((hours * 60 + minutes) / 10)));
         return frames;
@@ -243,12 +243,12 @@ QString Timecode::getTimecodeHH_MM_SS_HH(const GenTime & time) const
     text.append(':');
     text.append(QString::number(minutes).rightJustified(2, '0', false));
     if (m_dropFrame) {
-           text.append('.');
+        text.append('.');
     } else {
         text.append(':');
     }
     text.append(QString::number(seconds).rightJustified(2, '0', false));
-       text.append(':');
+    text.append(':');
     text.append(QString::number(hundredths).rightJustified(2, '0', false));
 
     return text;
@@ -277,7 +277,7 @@ QString Timecode::getTimecodeDropFrame(int frames) const
     // calculate how many frames need to be dropped every minute.
     int dropRate = 0;
     if (m_dropFrame) {
-        dropRate = (int) ((ceil(m_displayedFramesPerSecond) / 30) * 2);
+        dropRate = (int)((ceil(m_displayedFramesPerSecond) / 30) * 2);
     }
 
     // calculate how many frames are in a normal minute, and how many are in a tenth minute.
@@ -321,12 +321,12 @@ QString Timecode::getTimecodeDropFrame(int frames) const
     text.append(QString::number(tenMinuteIntervals));
     text.append(QString::number(numMinutes));
     if (m_dropFrame) {
-           text.append('.');
+        text.append('.');
     } else {
         text.append(':');
     }
     text.append(QString::number(seconds).rightJustified(2, '0', false));
-       text.append(':');
+    text.append(':');
     text.append(QString::number(frames).rightJustified(2, '0', false));
 
     return text;
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*/)
index a76c085577a246fe91e38a16b86497e0c11c3dbd..d31b8958fb61078910db96b6fd7984adeb22cdad 100644 (file)
@@ -32,9 +32,9 @@
 class TitleTemplate
 {
 public:
-       QString file;
-       QString name;
-       QIcon icon;
+    QString file;
+    QString name;
+    QIcon icon;
 };
 
 class Transform
@@ -93,8 +93,8 @@ public:
 
     /** \brief Get clip duration. */
     int duration() const;
-       /** load Title Templates*/
-       static void refreshTitleTemplates();
+    /** load Title Templates*/
+    static void refreshTitleTemplates();
 
 protected:
     virtual void resizeEvent(QResizeEvent * event);
@@ -134,7 +134,7 @@ private:
     /** project path for storing title clips */
     QString m_projectTitlePath;
     Timecode m_tc;
-       QString lastDocumentHash;
+    QString lastDocumentHash;
 
     /** See http://doc.trolltech.com/4.5/signalsandslots.html#advanced-signals-and-slots-usage */
     QSignalMapper *m_signalMapper;
@@ -301,7 +301,7 @@ private slots:
     void slotZIndexDown();
     void slotZIndexTop();
     void slotZIndexBottom();
-       void templateIndexChanged(int);
+    void templateIndexChanged(int);
 };