]> git.sesse.net Git - kdenlive/commitdiff
const'ify
authorMontel Laurent <montel@kde.org>
Mon, 3 Jun 2013 17:31:17 +0000 (19:31 +0200)
committerMontel Laurent <montel@kde.org>
Mon, 3 Jun 2013 17:31:17 +0000 (19:31 +0200)
src/smallruler.cpp
src/smallruler.h
src/statusbarmessagelabel.cpp
src/titledocument.cpp
src/titlewidget.cpp

index 8505e2fff59ba633f24da645899a1395a07db554..ee77912f7855c03d34e02aece1298dd88e54980c 100644 (file)
@@ -114,7 +114,7 @@ void SmallRuler::setMarkers(const QList<CommentedTime> &list)
     updatePixmap();
 }
 
-QPoint SmallRuler::zone()
+QPoint SmallRuler::zone() const
 {
     return QPoint(m_zoneStart, m_zoneEnd);
 }
index 44451607d043ce39c8cb9fc062165c982a6bde18..5c18ba9d1a8c4dc2f1b4d5d043078b777c4172e4 100644 (file)
@@ -37,7 +37,7 @@ public:
     void setZone(int start, int end);
     void setZoneStart();
     void setZoneEnd();
-    QPoint zone();
+    QPoint zone() const;
     void setMarkers(const QList < CommentedTime >& list);
     void updatePalette();
     void refreshRuler();
index acc24487016014c0056a8babe29fb97aef2c5584..1cb0a0647041f70f67fd819e48a1d79a64727413 100644 (file)
@@ -112,7 +112,7 @@ bool StatusBarMessageLabel::slotMessageTimeout()
     bool newMessage = false;
 
     // Get the next message from the queue, unless the current one needs to be confirmed
-    if (m_messageQueue.size() > 0) {
+    if (!m_messageQueue.isEmpty()) {
 
         if (!m_currentMessage.needsConfirmation()) {
 
@@ -124,12 +124,12 @@ bool StatusBarMessageLabel::slotMessageTimeout()
     }
 
     // If the queue is empty, add a default (empty) message
-    if (m_messageQueue.size() == 0 && m_currentMessage.type != DefaultMessage) {
+    if (m_messageQueue.isEmpty() && m_currentMessage.type != DefaultMessage) {
         m_messageQueue.push_back(StatusBarMessageItem());
     }
 
     // Start a new timer, unless the current message still needs to be confirmed
-    if (m_messageQueue.size() > 0) {
+    if (!m_messageQueue.isEmpty()) {
 
         if (!m_currentMessage.needsConfirmation()) {
 
index 5d29e1bf7d5c2a53118695d685cdac9a11374a08..16fcda43e73d77cbd0965efb7d502ab929b6a2a0 100644 (file)
@@ -562,7 +562,7 @@ QColor TitleDocument::stringToColor(const QString & s)
 
 QTransform TitleDocument::stringToTransform(const QString& s)
 {
-    QStringList l = s.split(',');
+    QStringList l = s.split(QLatin1Char(','));
     if (l.size() < 9)
         return QTransform();
     return QTransform(
index a92d6baca7f3909afabf42a4944f532f8689a4d4..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()));
@@ -645,7 +646,8 @@ 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);
 
@@ -1081,10 +1083,7 @@ void TitleWidget::selectionChanged()
             zUp->setEnabled(false);
             zDown->setEnabled(false);
         }
-
-
     }
-
 }
 
 void TitleWidget::slotValueChanged(int type)
@@ -1621,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();