Commit 4fba8981 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization. Use const'ref

parent ddd3e50e
......@@ -119,14 +119,16 @@ void BezierSplineWidget::slotGridChange()
void BezierSplineWidget::slotShowPixmap(bool show)
{
m_showPixmap = show;
KdenliveSettings::setBezier_showpixmap(show);
if (show && (int)m_mode < 6)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)m_mode), 1, palette().background().color().rgb())));
else if (show && m_mode == ModeHue)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
else
m_edit.setPixmap(QPixmap());
if (m_showPixmap != show) {
m_showPixmap = show;
KdenliveSettings::setBezier_showpixmap(show);
if (show && (int)m_mode < 6)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)m_mode), 1, palette().background().color().rgb())));
else if (show && m_mode == ModeHue)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
else
m_edit.setPixmap(QPixmap());
}
}
void BezierSplineWidget::slotUpdatePointEntries(const BPoint &p)
......
......@@ -23,7 +23,6 @@
#include "beziersplineeditor.h"
#include "ui_bezierspline_ui.h"
#include <QtCore>
#include <QWidget>
class DragValue;
......
......@@ -405,18 +405,16 @@ int CollapsibleEffect::effectIndex() const
return m_effect.attribute("kdenlive_ix").toInt();
}
void CollapsibleEffect::updateWidget(ItemInfo info, QDomElement effect, EffectMetaInfo *metaInfo)
void CollapsibleEffect::updateWidget(const ItemInfo &info, const QDomElement &effect, EffectMetaInfo *metaInfo)
{
if (m_paramWidget) {
// cleanup
delete m_paramWidget;
m_paramWidget = NULL;
}
// cleanup
delete m_paramWidget;
m_paramWidget = NULL;
m_effect = effect;
setupWidget(info, metaInfo);
}
void CollapsibleEffect::setupWidget(ItemInfo info, EffectMetaInfo *metaInfo)
void CollapsibleEffect::setupWidget(const ItemInfo &info, EffectMetaInfo *metaInfo)
{
if (m_effect.isNull()) {
// kDebug() << "// EMPTY EFFECT STACK";
......@@ -602,7 +600,7 @@ void CollapsibleEffect::setRange(int inPoint , int outPoint)
m_paramWidget->setRange(inPoint, outPoint);
}
void CollapsibleEffect::setKeyframes(const QString data, int maximum)
void CollapsibleEffect::setKeyframes(const QString &data, int maximum)
{
m_paramWidget->setKeyframes(data, maximum);
}
......
......@@ -47,13 +47,13 @@ public:
~CollapsibleEffect();
QLabel *title;
void setupWidget(ItemInfo info, EffectMetaInfo *metaInfo);
void setupWidget(const ItemInfo &info, EffectMetaInfo *metaInfo);
void updateTimecodeFormat();
void setActive(bool activate);
/** @brief Install event filter so that scrolling with mouse wheel does not change parameter value. */
virtual bool eventFilter( QObject * o, QEvent * e );
/** @brief Update effect GUI to reflect parameted changes. */
void updateWidget(ItemInfo info, QDomElement effect, EffectMetaInfo *metaInfo);
void updateWidget(const ItemInfo &info, const QDomElement &effect, EffectMetaInfo *metaInfo);
QDomElement effect() const;
int groupIndex() const;
bool isGroup() const;
......@@ -75,7 +75,7 @@ public:
/** @brief Set clip in / out points. */
void setRange(int inPoint , int outPoint);
/** @brief Import keyframes from a clip's data. */
void setKeyframes(const QString data, int maximum);
void setKeyframes(const QString &data, int maximum);
public slots:
void slotSyncEffectsPos(int pos);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment