From: Montel Laurent Date: Fri, 31 May 2013 14:13:38 +0000 (+0200) Subject: const'ref X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c45c2060cb43e4eec064624d967080cec0d15c6f;p=kdenlive const'ref --- diff --git a/src/effectslist.cpp b/src/effectslist.cpp index 95ddca8a..2d81f00d 100644 --- a/src/effectslist.cpp +++ b/src/effectslist.cpp @@ -389,7 +389,7 @@ void EffectsList::updateIndexes(QDomNodeList effects, int startIndex) { for (int i = startIndex; i < effects.count(); ++i) { QDomElement listeffect = effects.at(i).toElement(); - listeffect.setAttribute("kdenlive_ix", i + 1); + listeffect.setAttribute(QLatin1String("kdenlive_ix"), i + 1); } } @@ -403,13 +403,13 @@ void EffectsList::enableEffects(const QList & indexes, bool disable) } } -QDomElement EffectsList::effectFromIndex(QDomNodeList effects, int ix) +QDomElement EffectsList::effectFromIndex(const QDomNodeList &effects, int ix) { if (ix <= 0 || ix > effects.count()) return QDomElement(); return effects.at(ix - 1).toElement(); } -void EffectsList::updateEffect(QDomElement effect) +void EffectsList::updateEffect(const QDomElement &effect) { QDomNodeList effects = m_baseElement.childNodes(); int ix = effect.attribute("kdenlive_ix").toInt(); diff --git a/src/effectslist.h b/src/effectslist.h index 9654b5bb..2ef55f0f 100644 --- a/src/effectslist.h +++ b/src/effectslist.h @@ -71,7 +71,7 @@ public: void removeAt(int ix); QDomElement itemFromIndex(int ix) const; QDomElement insert(QDomElement effect); - void updateEffect(QDomElement effect); + void updateEffect(const QDomElement &effect); static bool hasKeyFrames(const QDomElement &effect); static bool hasSimpleKeyFrames(const QDomElement &effect); static bool hasGeometryKeyFrames(const QDomElement &effect); @@ -89,7 +89,7 @@ public: static void removeMetaProperties(QDomElement producer); void clearList(); /** @brief Get am effect with effect index equal to ix. */ - QDomElement effectFromIndex(QDomNodeList effects, int ix); + QDomElement effectFromIndex(const QDomNodeList &effects, int ix); /** @brief Update all effects indexes to make sure they are 1, 2, 3, ... */ void updateIndexes(QDomNodeList effects, int startIndex); /** @brief Enable / disable a list of effects */ diff --git a/src/effectslistwidget.cpp b/src/effectslistwidget.cpp index 328d9581..fbf8d1e5 100644 --- a/src/effectslistwidget.cpp +++ b/src/effectslistwidget.cpp @@ -228,14 +228,14 @@ void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, Q int ct = effectlist->count(); - for (int ix = 0; ix < ct; ix ++) { + for (int ix = 0; ix < ct; ++ix) { effectInfo = effectlist->effectIdInfo(ix); effectInfo.append(QString::number(type)); parentItem = NULL; if (folders) { for (int i = 0; i < folders->count(); ++i) { - l = folders->at(i)->data(0, IdRole).toString().split(',', QString::SkipEmptyParts); + l = folders->at(i)->data(0, IdRole).toString().split(QLatin1Char(','), QString::SkipEmptyParts); if (l.contains(effectInfo.at(2))) { parentItem = folders->at(i); break; @@ -265,7 +265,7 @@ QTreeWidgetItem *EffectsListWidget::findFolder(const QString &name) QTreeWidgetItem *item = NULL; QList result = findItems(name, Qt::MatchExactly); if (!result.isEmpty()) { - for (int j = 0; j < result.count(); j++) { + for (int j = 0; j < result.count(); ++j) { if (result.at(j)->data(0, TypeRole) == EFFECT_FOLDER) { item = result.at(j); break; @@ -363,7 +363,8 @@ void EffectsListWidget::dragMoveEvent(QDragMoveEvent *event) void EffectsListWidget::contextMenuEvent(QContextMenuEvent * event) { QTreeWidgetItem *item = itemAt(event->pos()); - if (item && item->data(0, TypeRole).toInt() == EFFECT_CUSTOM) m_menu->popup(event->globalPos()); + if (item && item->data(0, TypeRole).toInt() == EFFECT_CUSTOM) + m_menu->popup(event->globalPos()); } #include "effectslistwidget.moc" diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index 431c2c52..2a21a0fc 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -52,7 +52,7 @@ EffectStackEdit::EffectStackEdit(Monitor *monitor, QWidget *parent) : setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding)); setStyleSheet(EffectStackView2::getStyleSheet()); - setWidget(m_baseWidget); + setWidget(m_baseWidget); /*m_vbox = new QVBoxLayout(m_baseWidget); m_vbox->setContentsMargins(0, 0, 0, 0); m_vbox->setSpacing(2); */ @@ -100,48 +100,48 @@ void EffectStackEdit::updateParameter(const QString &name, const QString &value) bool EffectStackEdit::eventFilter( QObject * o, QEvent * e ) { if (e->type() == QEvent::Wheel) { - QWheelEvent *we = static_cast(e); - bool filterWheel = verticalScrollBar() && verticalScrollBar()->isVisible(); - if (!filterWheel || we->modifiers() != Qt::NoModifier) { - e->accept(); - return false; - } - if (qobject_cast(o)) { - if(qobject_cast(o)->focusPolicy() == Qt::WheelFocus) - { - e->accept(); - return false; - } - else - { - e->ignore(); - return true; - } - } - if (qobject_cast(o)) { - if(qobject_cast(o)->focusPolicy() == Qt::WheelFocus) - { - e->accept(); - return false; - } - else - { - e->ignore(); - return true; - } - } - if (qobject_cast(o)) { - if(qobject_cast(o)->focusPolicy() == Qt::WheelFocus) - { - e->accept(); - return false; - } - else - { - e->ignore(); - return true; - } - } + QWheelEvent *we = static_cast(e); + bool filterWheel = verticalScrollBar() && verticalScrollBar()->isVisible(); + if (!filterWheel || we->modifiers() != Qt::NoModifier) { + e->accept(); + return false; + } + if (qobject_cast(o)) { + if(qobject_cast(o)->focusPolicy() == Qt::WheelFocus) + { + e->accept(); + return false; + } + else + { + e->ignore(); + return true; + } + } + if (qobject_cast(o)) { + if(qobject_cast(o)->focusPolicy() == Qt::WheelFocus) + { + e->accept(); + return false; + } + else + { + e->ignore(); + return true; + } + } + if (qobject_cast(o)) { + if(qobject_cast(o)->focusPolicy() == Qt::WheelFocus) + { + e->accept(); + return false; + } + else + { + e->ignore(); + return true; + } + } } return QWidget::eventFilter(o, e); } @@ -164,11 +164,11 @@ void EffectStackEdit::transferParamDesc(const QDomElement &d, ItemInfo info, boo sp->setFocusPolicy( Qt::StrongFocus ); } Q_FOREACH( KComboBox * cb, m_baseWidget->findChildren() ) { - cb->installEventFilter( this ); + cb->installEventFilter( this ); cb->setFocusPolicy( Qt::StrongFocus ); } Q_FOREACH( QProgressBar * cb, m_baseWidget->findChildren() ) { - cb->installEventFilter( this ); + cb->installEventFilter( this ); cb->setFocusPolicy( Qt::StrongFocus ); } } diff --git a/src/encodingprofilesdialog.h b/src/encodingprofilesdialog.h index 60468f0d..af9938de 100644 --- a/src/encodingprofilesdialog.h +++ b/src/encodingprofilesdialog.h @@ -33,8 +33,6 @@ public: explicit EncodingProfilesDialog(int profileType, QWidget * parent = 0); ~EncodingProfilesDialog(); -protected: - private slots: void slotLoadProfiles(); void slotShowParams(); diff --git a/src/geometryval.h b/src/geometryval.h index a0215a80..a1557fc0 100644 --- a/src/geometryval.h +++ b/src/geometryval.h @@ -22,7 +22,6 @@ #include #include #include -#include #include @@ -31,9 +30,9 @@ #include "keyframehelper.h" #include "timecodedisplay.h" -//class QGraphicsScene; class GraphicsSceneRectMove; class QGraphicsRectItem; +class QGraphicsView; class Geometryval : public QWidget, public Ui::Geometryval diff --git a/src/kdenlivesettingsdialog.h b/src/kdenlivesettingsdialog.h index f43a0b3f..f00a32fa 100644 --- a/src/kdenlivesettingsdialog.h +++ b/src/kdenlivesettingsdialog.h @@ -21,8 +21,6 @@ #ifndef KDENLIVESETTINGSDIALOG_H #define KDENLIVESETTINGSDIALOG_H -#include - #include #include #include