Commit 9958f4a6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify

parent ff57a79c
......@@ -24,14 +24,12 @@
#include <KUrl>
BackupWidget::BackupWidget(KUrl projectUrl, KUrl projectFolder, const QString &projectId, QWidget * parent) :
BackupWidget::BackupWidget(const KUrl &projectUrl, const KUrl &projectFolder, const QString &projectId, QWidget * parent) :
QDialog(parent)
{
setupUi(this);
setWindowTitle(i18n("Restore Backup File"));
KUrl backupFile;
if (projectUrl.isEmpty()) {
// No url, means we opened the backup dialog from an empty project
info_label->setText(i18n("Showing all backup files in folder"));
......@@ -106,7 +104,7 @@ void BackupWidget::slotDisplayBackupPreview()
backup_preview->setPixmap(pix);
}
QString BackupWidget::selectedFile()
QString BackupWidget::selectedFile() const
{
if (!backup_list->currentItem()) return QString();
return backup_list->currentItem()->data(Qt::UserRole).toString();
......
......@@ -37,11 +37,11 @@ class BackupWidget : public QDialog, public Ui::BackupDialog_UI
Q_OBJECT
public:
BackupWidget(KUrl projectUrl, KUrl projectFolder, const QString &projectId, QWidget * parent = 0);
BackupWidget(const KUrl &projectUrl, const KUrl &projectFolder, const QString &projectId, QWidget * parent = 0);
// Constructor for extracting widget
~BackupWidget();
/** @brief Return the path for selected backup file. */
QString selectedFile();
QString selectedFile() const;
private slots:
/** @brief Parse the backup files in project folder. */
......
......@@ -41,7 +41,7 @@
#include <KApplication>
CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
CollapsibleEffect::CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, ItemInfo info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
AbstractCollapsibleWidget(parent),
m_paramWidget(NULL),
m_effect(effect),
......@@ -145,7 +145,7 @@ CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_ef
CollapsibleEffect::~CollapsibleEffect()
{
if (m_paramWidget) delete m_paramWidget;
delete m_paramWidget;
delete m_menu;
}
......
......@@ -43,7 +43,7 @@ class CollapsibleEffect : public AbstractCollapsibleWidget
Q_OBJECT
public:
CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0);
CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, ItemInfo info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0);
~CollapsibleEffect();
QLabel *title;
......
......@@ -26,7 +26,7 @@
#include <KLocale>
AbstractClipJob::AbstractClipJob(JOBTYPE type, CLIPTYPE cType, const QString &id, QStringList) :
AbstractClipJob::AbstractClipJob(JOBTYPE type, CLIPTYPE cType, const QString &id, const QStringList &) :
QObject(),
clipType(cType),
jobType(type),
......
......@@ -33,7 +33,7 @@ class AbstractClipJob : public QObject
Q_OBJECT
public:
AbstractClipJob(JOBTYPE type, CLIPTYPE cType, const QString &id, QStringList parameters); virtual ~ AbstractClipJob();
AbstractClipJob(JOBTYPE type, CLIPTYPE cType, const QString &id, const QStringList &parameters); virtual ~ AbstractClipJob();
CLIPTYPE clipType;
JOBTYPE jobType;
QString description;
......
......@@ -25,7 +25,7 @@
#include <KDebug>
#include <KLocale>
CutClipJob::CutClipJob(CLIPTYPE cType, const QString &id, QStringList parameters) : AbstractClipJob(CUTJOB, cType, id, parameters)
CutClipJob::CutClipJob(CLIPTYPE cType, const QString &id, const QStringList &parameters) : AbstractClipJob(CUTJOB, cType, id, parameters)
{
m_jobStatus = JOBWAITING;
m_dest = parameters.at(0);
......
......@@ -32,7 +32,7 @@ class CutClipJob : public AbstractClipJob
Q_OBJECT
public:
CutClipJob(CLIPTYPE cType, const QString &id, QStringList parameters);
CutClipJob(CLIPTYPE cType, const QString &id, const QStringList &parameters);
virtual ~ CutClipJob();
const QString destination() const;
void startJob();
......
......@@ -44,7 +44,7 @@ void tracking_finished(mlt_service *owner, RotoWidget *self, char *data)
self->setSpline(QString(data));
}
RotoWidget::RotoWidget(QString data, Monitor *monitor, ItemInfo info, Timecode t, QWidget* parent) :
RotoWidget::RotoWidget(const QString &data, Monitor *monitor, ItemInfo info, Timecode t, QWidget* parent) :
QWidget(parent),
m_monitor(monitor),
m_showScene(true),
......@@ -355,7 +355,7 @@ void RotoWidget::setupTrackingListen(ItemInfo info)
delete clip;
}
void RotoWidget::setSpline(QString spline, bool notify)
void RotoWidget::setSpline(const QString &spline, bool notify)
{
QJson::Parser parser;
bool ok;
......
......@@ -42,14 +42,14 @@ class RotoWidget : public QWidget
Q_OBJECT
public:
RotoWidget(QString data, Monitor *monitor, ItemInfo info, Timecode t, QWidget* parent = 0);
RotoWidget(const QString &data, Monitor *monitor, ItemInfo info, Timecode t, QWidget* parent = 0);
virtual ~RotoWidget();
/** @brief Returns the spline(s) in the JSON format used by filter_rotoscoping (MLT). */
QString getSpline();
/** @brief Replaces current data with \param spline (JSON). */
void setSpline(QString spline, bool notify = true);
void setSpline(const QString &spline, bool notify = true);
/** @brief Passed on to the keyframe timeline. Switches between frames and hh:mm:ss:ff timecode. */
void updateTimecodeFormat();
......
......@@ -47,7 +47,7 @@ SimpleTimelineWidget::SimpleTimelineWidget(QWidget* parent) :
m_colKeyframeBg = scheme.shade(KColorScheme::MidShade);
}
void SimpleTimelineWidget::setKeyframes(QList <int> keyframes)
void SimpleTimelineWidget::setKeyframes(const QList<int> &keyframes)
{
m_keyframes = keyframes;
qSort(m_keyframes);
......
......@@ -28,7 +28,7 @@ class SimpleTimelineWidget : public QWidget
public:
SimpleTimelineWidget(QWidget* parent = 0);
void setKeyframes(QList <int> keyframes);
void setKeyframes(const QList <int>& keyframes);
void setDuration(int dur);
public slots:
......
......@@ -112,9 +112,7 @@ SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
SlideshowClip::~SlideshowClip()
{
if (m_thumbJob) {
delete m_thumbJob;
}
delete m_thumbJob;
}
void SlideshowClip::slotEnableLuma(int state)
......
......@@ -26,7 +26,7 @@
#include <KDebug>
SpacerDialog::SpacerDialog(const GenTime duration, Timecode tc, int track, QList <TrackInfo> tracks, QWidget * parent) :
SpacerDialog::SpacerDialog(const GenTime duration, Timecode tc, int track, const QList<TrackInfo> &tracks, QWidget * parent) :
QDialog(parent),
m_in(tc)
{
......
......@@ -38,7 +38,7 @@ class SpacerDialog : public QDialog, public Ui::SpacerDialog_UI
Q_OBJECT
public:
SpacerDialog(const GenTime duration, Timecode tc, int track, QList <TrackInfo> tracks, QWidget * parent = 0);
SpacerDialog(const GenTime duration, Timecode tc, int track, const QList <TrackInfo>& tracks, QWidget * parent = 0);
GenTime selectedDuration();
int selectedTrack();
......
......@@ -50,7 +50,7 @@ MyLabel::MyLabel(QWidget* parent) :
{
}
void MyLabel::setImage(QImage img)
void MyLabel::setImage(const QImage& img)
{
m_img = img;
}
......@@ -139,7 +139,7 @@ void StopmotionMonitor::slotMouseSeek(int /*eventDelta*/, bool /*fast*/)
{
}
StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder, QList< QAction* > actions, QWidget* parent) :
StopmotionWidget::StopmotionWidget(MonitorManager *manager, const KUrl &projectFolder, QList< QAction* > actions, QWidget* parent) :
QDialog(parent)
, Ui::Stopmotion_UI()
, m_projectFolder(projectFolder)
......
......@@ -37,7 +37,7 @@ class MyLabel : public QLabel
Q_OBJECT
public:
MyLabel(QWidget* parent = 0);
void setImage(QImage img);
void setImage(const QImage &img);
protected:
virtual void paintEvent(QPaintEvent* event);
......@@ -92,7 +92,7 @@ public:
* @param projectFolder The current project folder, where captured files will be stored.
* @param actions The actions for this widget that can have a keyboard shortcut.
* @param parent (optional) parent widget */
StopmotionWidget(MonitorManager *manager, KUrl projectFolder, QList< QAction* > actions, QWidget* parent = 0);
StopmotionWidget(MonitorManager *manager, const KUrl &projectFolder, QList< QAction* > actions, QWidget* parent = 0);
virtual ~StopmotionWidget();
protected:
......
......@@ -64,7 +64,7 @@ const int BLUREFFECT = 1;
const int SHADOWEFFECT = 2;
const int TYPEWRITEREFFECT = 3;
TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render *render, QWidget *parent) :
TitleWidget::TitleWidget(const KUrl &url, Timecode tc, const QString &projectTitlePath, Render *render, QWidget *parent) :
QDialog(parent),
Ui::TitleWidget_UI(),
m_startViewport(NULL),
......
......@@ -63,7 +63,7 @@ public:
* @param projectPath default path to save to or load from title documents
* @param render project renderer
* @param parent (optional) parent widget */
TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render *render, QWidget *parent = 0);
TitleWidget(const KUrl &url, Timecode tc, const QString &projectTitlePath, Render *render, QWidget *parent = 0);
virtual ~TitleWidget();
QDomDocument xml();
void setXml(QDomDocument doc);
......
......@@ -259,7 +259,7 @@ void TransitionSettings::slotCheckMonitorPosition(int renderPos)
}
}
void TransitionSettings::setKeyframes(const QString data, int maximum)
void TransitionSettings::setKeyframes(const QString &data, int maximum)
{
m_effectEdit->setKeyframes(data, maximum);
}
......
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