Commit 54407666 authored by Laurent Montel's avatar Laurent Montel

USe const'ref here too

parent 13b2d9d2
......@@ -1010,7 +1010,7 @@ void Bin::setDocument(KdenliveDoc* project)
autoSelect();
}
void Bin::slotAddUrl(QString url, int folderId, QMap <QString, QString> data)
void Bin::slotAddUrl(const QString &url, int folderId, const QMap <QString, QString> &data)
{
QList <QUrl>urls;
urls << QUrl::fromLocalFile(url);
......@@ -1026,7 +1026,7 @@ void Bin::slotAddUrl(QString url, int folderId, QMap <QString, QString> data)
ClipCreationDialog::createClipsCommand(m_doc, urls, folderInfo, this, data);
}
void Bin::slotAddUrl(QString url, QMap <QString, QString> data)
void Bin::slotAddUrl(const QString &url, const QMap <QString, QString> &data)
{
QList <QUrl>urls;
urls << QUrl::fromLocalFile(url);
......@@ -1035,7 +1035,7 @@ void Bin::slotAddUrl(QString url, QMap <QString, QString> data)
}
void Bin::createClip(QDomElement xml)
void Bin::createClip(const QDomElement &xml)
{
// Check if clip should be in a folder
QString groupId = ProjectClip::getXmlProperty(xml, QStringLiteral("kdenlive:folderid"));
......@@ -1182,7 +1182,7 @@ void Bin::renameFolder(const QString &id, const QString &name)
}
void Bin::slotLoadFolders(QMap<QString,QString> foldersData)
void Bin::slotLoadFolders(const QMap<QString,QString> &foldersData)
{
// Folder parent is saved in folderId, separated by a dot. for example "1.3" means parent folder id is "1" and new folder id is "3".
ProjectFolder *parentFolder;
......@@ -1809,7 +1809,7 @@ void Bin::showClipProperties(ProjectClip *clip, bool forceRefresh)
}
void Bin::slotEditClipCommand(const QString &id, QMap<QString, QString>oldProps, QMap<QString, QString>newProps)
void Bin::slotEditClipCommand(const QString &id, const QMap<QString, QString> &oldProps, const QMap<QString, QString> &newProps)
{
EditClipCommand *command = new EditClipCommand(this, id, oldProps, newProps, true);
m_doc->commandStack()->push(command);
......@@ -1877,7 +1877,7 @@ void Bin::slotRemoveInvalidClip(const QString &id, bool replace, const QString &
emit requesteInvalidRemoval(id, clip->url(), errorMessage);
}
void Bin::slotProducerReady(requestClipInfo info, ClipController *controller)
void Bin::slotProducerReady(const requestClipInfo &info, ClipController *controller)
{
ProjectClip *clip = m_rootFolder->clip(info.clipId);
if (clip) {
......@@ -2036,7 +2036,7 @@ void Bin::setupGeneratorMenu()
m_menu->insertSeparator(m_deleteAction);
}
void Bin::setupMenu(QMenu *addMenu, QAction *defaultAction, QHash <QString, QAction*> actions)
void Bin::setupMenu(QMenu *addMenu, QAction *defaultAction, const QHash <QString, QAction*> &actions)
{
// Setup actions
QAction *first = m_toolbar->actions().at(0);
......@@ -2112,7 +2112,7 @@ void Bin::slotUpdateJobStatus(const QString&id, int jobType, int status, const Q
}
}
void Bin::doDisplayMessage(const QString &text, KMessageWidget::MessageType type, QList <QAction*> actions)
void Bin::doDisplayMessage(const QString &text, KMessageWidget::MessageType type, const QList <QAction*>& actions)
{
// Remove axisting actions if any
QList <QAction *> acts = m_infoMessage->actions();
......@@ -2167,7 +2167,7 @@ void Bin::gotProxy(const QString &id, const QString &path)
}
}
void Bin::reloadProducer(const QString &id, QDomElement xml)
void Bin::reloadProducer(const QString &id, const QDomElement &xml)
{
m_doc->getFileProperties(xml, id, 150, true);
}
......@@ -2259,7 +2259,7 @@ void Bin::slotCreateProjectClip()
}
}
void Bin::slotItemDropped(QStringList ids, const QModelIndex &parent)
void Bin::slotItemDropped(const QStringList &ids, const QModelIndex &parent)
{
AbstractProjectItem *parentItem;
if (parent.isValid()) {
......@@ -2321,7 +2321,7 @@ void Bin::slotUpdateEffect(QString id, QDomElement oldEffect, QDomElement newEff
m_doc->commandStack()->push(command);
}
void Bin::slotChangeEffectState(QString id, QList<int> indexes, bool disable)
void Bin::slotChangeEffectState(QString id, const QList<int> &indexes, bool disable)
{
if (id.isEmpty()) id = m_monitor->activeClipId();
if (id.isEmpty()) return;
......@@ -2329,7 +2329,7 @@ void Bin::slotChangeEffectState(QString id, QList<int> indexes, bool disable)
m_doc->commandStack()->push(command);
}
void Bin::slotEffectDropped(QString effect, const QModelIndex &parent)
void Bin::slotEffectDropped(const QString &effect, const QModelIndex &parent)
{
if (parent.isValid()) {
AbstractProjectItem *parentItem;
......@@ -2360,7 +2360,7 @@ void Bin::slotDeleteEffect(const QString &id, QDomElement effect)
m_doc->commandStack()->push(command);
}
void Bin::slotMoveEffect(const QString &id, QList <int> currentPos, int newPos)
void Bin::slotMoveEffect(const QString &id, const QList <int>& currentPos, int newPos)
{
MoveBinEffectCommand *command = new MoveBinEffectCommand(this, id, currentPos, newPos);
m_doc->commandStack()->push(command);
......@@ -2474,7 +2474,7 @@ void Bin::doMoveFolder(const QString &id, const QString &newParentId)
emit storeFolder(id, newParent->clipId(), currentParent->clipId(), currentItem->name());
}
void Bin::droppedUrls(QList <QUrl> urls, const QStringList &folderInfo)
void Bin::droppedUrls(const QList <QUrl> &urls, const QStringList &folderInfo)
{
QModelIndex current;
if (folderInfo.isEmpty()) {
......@@ -2486,7 +2486,7 @@ void Bin::droppedUrls(QList <QUrl> urls, const QStringList &folderInfo)
slotItemDropped(urls, current);
}
void Bin::slotAddClipToProject(QUrl url)
void Bin::slotAddClipToProject(const QUrl &url)
{
QList <QUrl> urls;
urls << url;
......@@ -2538,7 +2538,7 @@ void Bin::slotItemDropped(const QList<QUrl>&urls, const QModelIndex &parent)
}
}
void Bin::slotExpandUrl(ItemInfo info, QUrl url, QUndoCommand *command)
void Bin::slotExpandUrl(const ItemInfo &info, const QUrl &url, QUndoCommand *command)
{
QStringList folderInfo;
// Create folder to hold imported clips
......@@ -2655,7 +2655,7 @@ void Bin::slotExpandUrl(ItemInfo info, QUrl url, QUndoCommand *command)
pCore->projectManager()->currentTimeline()->importPlaylist(info, idMap, doc, command);
}
void Bin::slotItemEdited(QModelIndex ix,QModelIndex,QVector<int>)
void Bin::slotItemEdited(const QModelIndex &ix, const QModelIndex &, const QVector<int> &)
{
if (ix.isValid()) {
// Clip renamed
......@@ -2871,7 +2871,7 @@ void Bin::updateTimecodeFormat()
}
void Bin::slotGotFilterJobResults(QString id, int startPos, int track, stringMap results, stringMap filterInfo)
void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, const stringMap &results, const stringMap &filterInfo)
{
if (filterInfo.contains(QStringLiteral("finalfilter"))) {
if (filterInfo.contains(QStringLiteral("storedata"))) {
......@@ -2999,7 +2999,7 @@ void Bin::slotGotFilterJobResults(QString id, int startPos, int track, stringMap
}
}
void Bin::slotAddClipMarker(const QString &id, QList <CommentedTime> newMarkers, QUndoCommand *groupCommand)
void Bin::slotAddClipMarker(const QString &id, const QList <CommentedTime> &newMarkers, QUndoCommand *groupCommand)
{
ProjectClip *clip = getBinClip(id);
if (!clip) return;
......@@ -3264,7 +3264,7 @@ void Bin::slotShowDescColumn(bool show)
}
}
void Bin::slotQueryRemoval(const QString &id, QUrl url, const QString &errorMessage)
void Bin::slotQueryRemoval(const QString &id, const QUrl &url, const QString &errorMessage)
{
if (m_invalidClipDialog) {
if (!url.isEmpty()) m_invalidClipDialog->addClip(id, url.toLocalFile());
......@@ -3307,7 +3307,7 @@ void Bin::slotAddClipExtraData(const QString &id, const QString &key, const QStr
if (!groupCommand) m_doc->commandStack()->push(command);
}
void Bin::slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties, bool refreshPropertiesPanel)
void Bin::slotUpdateClipProperties(const QString &id, const QMap <QString, QString> &properties, bool refreshPropertiesPanel)
{
ProjectClip *clip = m_rootFolder->clip(id);
if (clip) {
......@@ -3315,7 +3315,7 @@ void Bin::slotUpdateClipProperties(const QString &id, QMap <QString, QString> pr
}
}
void Bin::updateTimelineProducers(const QString &id, QMap <QString, QString> passProperties)
void Bin::updateTimelineProducers(const QString &id, const QMap<QString, QString> &passProperties)
{
pCore->projectManager()->currentTimeline()->updateClipProperties(id, passProperties);
m_doc->renderer()->updateSlowMotionProducers(id, passProperties);
......@@ -3437,7 +3437,7 @@ QStringList Bin::getProxyHashList()
return list;
}
void Bin::slotSendAudioThumb(QString id)
void Bin::slotSendAudioThumb(const QString &id)
{
ProjectClip *clip = m_rootFolder->clip(id);
if (clip && clip->audioThumbCreated()) {
......@@ -3525,7 +3525,7 @@ QImage Bin::findCachedPixmap(const QString &path)
return img;
}
void Bin::cachePixmap(const QString &path, QImage img)
void Bin::cachePixmap(const QString &path, const QImage &img)
{
if (!m_doc->clipManager()->pixmapCache->contains(path)) {
m_doc->clipManager()->pixmapCache->insertImage(path, img);
......@@ -3573,7 +3573,7 @@ void Bin::showClearButton(bool show)
m_searchLine->setClearButtonEnabled(show);
}
void Bin::saveZone(QStringList info, QDir dir)
void Bin::saveZone(const QStringList &info, const QDir &dir)
{
if (info.size() != 3) {
return;
......
......@@ -374,7 +374,7 @@ public:
ProjectFolder *rootFolder();
/** @brief Create a clip item from its xml description */
void createClip(QDomElement xml);
void createClip(const QDomElement &xml);
/** @brief Used to notify the Model View that an item was updated */
void emitItemUpdated(AbstractProjectItem* item);
......@@ -408,7 +408,7 @@ public:
bool hasPendingJob(const QString &id, AbstractClipJob::JOBTYPE type);
/** @brief Reload / replace a producer */
void reloadProducer(const QString &id, QDomElement xml);
void reloadProducer(const QString &id, const QDomElement &xml);
/** @brief Current producer has changed, refresh monitor and timeline*/
void refreshClip(const QString &id);
......@@ -418,7 +418,7 @@ public:
void emitItemAdded(AbstractProjectItem* item);
void emitAboutToRemoveItem(AbstractProjectItem* item);
void emitItemRemoved(AbstractProjectItem* item);
void setupMenu(QMenu *addMenu, QAction *defaultAction, QHash <QString, QAction*> actions);
void setupMenu(QMenu *addMenu, QAction *defaultAction, const QHash<QString, QAction *> &actions);
/** @brief The source file was modified, we will reload it soon, disable item in the meantime */
void setWaitingStatus(const QString &id);
......@@ -521,7 +521,7 @@ public:
QDockWidget *clipPropertiesDock();
/** @brief Returns a cached thumbnail. */
QImage findCachedPixmap(const QString &path);
void cachePixmap(const QString &path, QImage img);
void cachePixmap(const QString &path, const QImage &img);
/** @brief Returns a document's cache dir. ok is set to false if folder does not exist */
QDir getCacheDir(CacheType type, bool *ok) const;
/** @brief Command adding a bin clip */
......@@ -532,7 +532,7 @@ public:
/** @brief Get info (id, name) of a folder (or the currently selected one) */
const QStringList getFolderInfo(const QModelIndex &selectedIx = QModelIndex());
/** @brief Save a clip zone as MLT playlist */
void saveZone(QStringList info, QDir dir);
void saveZone(const QStringList &info, const QDir &dir);
private slots:
void slotAddClip();
......@@ -555,22 +555,22 @@ private slots:
void selectProxyModel(const QModelIndex &id);
void autoSelect();
void slotSaveHeaders();
void slotItemDropped(QStringList ids, const QModelIndex &parent);
void slotItemDropped(const QStringList &ids, const QModelIndex &parent);
void slotItemDropped(const QList<QUrl>&urls, const QModelIndex &parent);
void slotEffectDropped(QString effect, const QModelIndex &parent);
void slotEffectDropped(const QString &effect, const QModelIndex &parent);
void slotUpdateEffect(QString id, QDomElement oldEffect, QDomElement newEffect, int ix);
void slotChangeEffectState(QString id, QList<int> indexes, bool disable);
void slotItemEdited(QModelIndex,QModelIndex,QVector<int>);
void slotAddUrl(QString url, int folderId, QMap <QString, QString> data = QMap <QString, QString>());
void slotAddUrl(QString url, QMap <QString, QString> data = QMap <QString, QString>());
void slotChangeEffectState(QString id, const QList<int> &indexes, bool disable);
void slotItemEdited(const QModelIndex &, const QModelIndex &, const QVector<int> &);
void slotAddUrl(const QString &url, int folderId, const QMap<QString, QString> &data = QMap <QString, QString>());
void slotAddUrl(const QString &url, const QMap<QString, QString> &data = QMap <QString, QString>());
void slotPrepareJobsMenu();
void slotShowJobLog();
/** @brief process clip job result. */
void slotGotFilterJobResults(QString ,int , int, stringMap, stringMap);
void slotGotFilterJobResults(const QString & , int , int, const stringMap &, const stringMap &);
/** @brief Reset all text and log data from info message widget. */
void slotResetInfoMessage();
/** @brief Show dialog prompting for removal of invalid clips. */
void slotQueryRemoval(const QString &id, QUrl url, const QString &errorMessage);
void slotQueryRemoval(const QString &id, const QUrl &url, const QString &errorMessage);
/** @brief Request display of current clip in monitor. */
void slotOpenCurrent();
void slotZoomView(bool zoomIn);
......@@ -583,7 +583,7 @@ private slots:
void slotCreateAudioThumbs();
void doRefreshPanel(const QString &id);
/** @brief Send audio thumb data to monitor for display. */
void slotSendAudioThumb(QString id);
void slotSendAudioThumb(const QString &id);
void doRefreshAudioThumbs(const QString &id);
/** @brief Enable item view and hide message */
void slotMessageActionTriggered();
......@@ -600,10 +600,10 @@ public slots:
* @param id the clip id
* @param controller The Controller for this clip
*/
void slotProducerReady(requestClipInfo info, ClipController *controller);
void slotProducerReady(const requestClipInfo &info, ClipController *controller);
void slotRemoveInvalidClip(const QString &id, bool replace, const QString &errorMessage);
/** @brief Create a folder when opening a document */
void slotLoadFolders(QMap<QString,QString> foldersData);
void slotLoadFolders(const QMap<QString, QString> &foldersData);
/** @brief Reload clip thumbnail - when frame for thumbnail changed */
void slotRefreshClipThumbnail(const QString &id);
void slotDeleteClip();
......@@ -617,7 +617,7 @@ public slots:
void slotStartCutJob(const QString &id);
/** @brief Triggered by a clip job action, start the job */
void slotStartClipJob(bool enable);
void slotEditClipCommand(const QString &id, QMap<QString, QString>oldProps, QMap<QString, QString>newProps);
void slotEditClipCommand(const QString &id, const QMap<QString, QString> &oldProps, const QMap<QString, QString> &newProps);
void slotCancelRunningJob(const QString &id, const QMap<QString, QString> &newProps);
/** @brief Start a filter job requested by a filter applied in timeline */
void slotStartFilterJob(const ItemInfo &info, const QString&id, QMap <QString, QString> &filterParams, QMap <QString, QString> &consumerParams, QMap <QString, QString> &extraParams);
......@@ -625,36 +625,36 @@ public slots:
void slotAddClipCut(const QString&id, int in, int out);
/** @brief Open current clip in an external editing application */
void slotOpenClip();
void slotAddClipMarker(const QString &id, QList <CommentedTime> newMarker, QUndoCommand *groupCommand = Q_NULLPTR);
void slotAddClipMarker(const QString &id, const QList<CommentedTime> &newMarker, QUndoCommand *groupCommand = Q_NULLPTR);
void slotLoadClipMarkers(const QString &id);
void slotSaveClipMarkers(const QString &id);
void slotDuplicateClip();
void slotLocateClip();
void slotDeleteEffect(const QString &id, QDomElement effect);
void slotMoveEffect(const QString &id, QList <int> currentPos, int newPos);
void slotMoveEffect(const QString &id, const QList<int> &currentPos, int newPos);
/** @brief Request audio thumbnail for clip with id */
void slotCreateAudioThumb(const QString &id);
/** @brief Abort audio thumbnail for clip with id */
void slotAbortAudioThumb(const QString &id, long duration);
/** @brief Add extra data to a clip. */
void slotAddClipExtraData(const QString &id, const QString &key, const QString &data = QString(), QUndoCommand *groupCommand = Q_NULLPTR);
void slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties, bool refreshPropertiesPanel);
void slotUpdateClipProperties(const QString &id, const QMap<QString, QString> &properties, bool refreshPropertiesPanel);
/** @brief Pass some important properties to timeline track producers. */
void updateTimelineProducers(const QString &id, QMap <QString, QString> passProperties);
void updateTimelineProducers(const QString &id, const QMap<QString, QString> &passProperties);
/** @brief Add effect to active Bin clip (used when double clicking an effect in list). */
void slotEffectDropped(QString id, QDomElement);
/** @brief Request current frame from project monitor. */
void slotGetCurrentProjectImage(bool request);
void slotExpandUrl(ItemInfo info, QUrl url, QUndoCommand *command);
void slotExpandUrl(const ItemInfo &info, const QUrl &url, QUndoCommand *command);
void abortAudioThumbs();
void doDisplayMessage(const QString &text, KMessageWidget::MessageType type, QList <QAction*> actions = QList <QAction*>());
void doDisplayMessage(const QString &text, KMessageWidget::MessageType type, const QList<QAction *> &actions = QList <QAction*>());
/** @brief Reset all clip usage to 0 */
void resetUsageCount();
/** @brief Select a clip in the Bin from its id. */
void selectClipById(const QString &id, int frame = -1, const QPoint &zone = QPoint());
void slotAddClipToProject(QUrl url);
void slotAddClipToProject(const QUrl &url);
void doUpdateThumbsProgress(long ms);
void droppedUrls(QList <QUrl> urls, const QStringList &folderInfo = QStringList());
void droppedUrls(const QList<QUrl> &urls, const QStringList &folderInfo = QStringList());
protected:
void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
......
......@@ -199,7 +199,7 @@ void ChangeMasterEffectStateCommand::redo()
m_refreshEffectStack = true;
}
MoveBinEffectCommand::MoveBinEffectCommand(Bin *bin, const QString &clipId, QList <int> oldPos, int newPos, QUndoCommand *parent) :
MoveBinEffectCommand::MoveBinEffectCommand(Bin *bin, const QString &clipId, const QList <int> &oldPos, int newPos, QUndoCommand *parent) :
QUndoCommand(parent),
m_bin(bin),
m_clipId(clipId),
......
......@@ -138,7 +138,7 @@ private:
class MoveBinEffectCommand : public QUndoCommand
{
public:
explicit MoveBinEffectCommand(Bin *bin, const QString &clipId, QList <int> oldPos, int newPos, QUndoCommand *parent = Q_NULLPTR);
explicit MoveBinEffectCommand(Bin *bin, const QString &clipId, const QList<int> &oldPos, int newPos, QUndoCommand *parent = Q_NULLPTR);
void undo() Q_DECL_OVERRIDE;
void redo() Q_DECL_OVERRIDE;
private:
......
......@@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KMessageBox>
ProjectClip::ProjectClip(const QString &id, QIcon thumb, ClipController *controller, ProjectFolder* parent) :
ProjectClip::ProjectClip(const QString &id, const QIcon &thumb, ClipController *controller, ProjectFolder* parent) :
AbstractProjectItem(AbstractProjectItem::ClipItem, id, parent)
, m_abortAudioThumb(false)
, m_controller(controller)
......@@ -70,7 +70,7 @@ ProjectClip::ProjectClip(const QString &id, QIcon thumb, ClipController *control
createAudioThumbs();
}
ProjectClip::ProjectClip(const QDomElement& description, QIcon thumb, ProjectFolder* parent) :
ProjectClip::ProjectClip(const QDomElement& description, const QIcon &thumb, ProjectFolder* parent) :
AbstractProjectItem(AbstractProjectItem::ClipItem, description, parent)
, m_abortAudioThumb(false)
, m_controller(Q_NULLPTR)
......@@ -139,7 +139,7 @@ QString ProjectClip::getXmlProperty(const QDomElement &producer, const QString &
return value;
}
void ProjectClip::updateAudioThumbnail(QVariantList audioLevels)
void ProjectClip::updateAudioThumbnail(const QVariantList &audioLevels)
{
audioFrameCache = audioLevels;
m_controller->audioThumbCreated = true;
......@@ -302,7 +302,7 @@ QDomElement ProjectClip::toXml(QDomDocument& document, bool includeMeta)
}
}
void ProjectClip::setThumbnail(QImage img)
void ProjectClip::setThumbnail(const QImage &img)
{
QPixmap thumb = roundedPixmap(QPixmap::fromImage(img));
if (hasProxy() && !thumb.isNull()) {
......@@ -586,7 +586,7 @@ bool ProjectClip::hasProxy() const
return true;
}
void ProjectClip::setProperties(QMap <QString, QString> properties, bool refreshPanel)
void ProjectClip::setProperties(const QMap <QString, QString> &properties, bool refreshPanel)
{
QMapIterator<QString, QString> i(properties);
QMap <QString, QString> passProperties;
......@@ -826,7 +826,7 @@ QVariant ProjectClip::data(DataType type) const
return AbstractProjectItem::data(type);
}
void ProjectClip::slotQueryIntraThumbs(QList <int> frames)
void ProjectClip::slotQueryIntraThumbs(const QList <int> &frames)
{
QMutexLocker lock(&m_intraThumbMutex);
for (int i = 0; i < frames.count(); i++) {
......@@ -873,7 +873,7 @@ void ProjectClip::doExtractIntra()
}
void ProjectClip::slotExtractImage(QList <int> frames)
void ProjectClip::slotExtractImage(const QList <int> &frames)
{
QMutexLocker lock(&m_thumbMutex);
for (int i = 0; i < frames.count(); i++) {
......
......@@ -59,12 +59,12 @@ public:
/**
* @brief Constructor; used when loading a project and the producer is already available.
*/
ProjectClip(const QString &id, QIcon thumb, ClipController *controller, ProjectFolder* parent);
ProjectClip(const QString &id, const QIcon &thumb, ClipController *controller, ProjectFolder* parent);
/**
* @brief Constructor.
* @param description element describing the clip; the "id" attribute and "resource" property are used
*/
ProjectClip(const QDomElement &description, QIcon thumb, ProjectFolder *parent);
ProjectClip(const QDomElement &description, const QIcon &thumb, ProjectFolder *parent);
virtual ~ProjectClip();
void reloadProducer(bool refreshOnly = false);
......@@ -121,7 +121,7 @@ public:
QVariant data(DataType type) const Q_DECL_OVERRIDE;
/** @brief Sets thumbnail for this clip. */
void setThumbnail(QImage);
void setThumbnail(const QImage &);
QPixmap thumbnail(int width, int height);
/** @brief Sets the MLT producer associated with this clip
......@@ -141,7 +141,7 @@ public:
ClipController *controller();
/** @brief Set properties on this clip. TODO: should we store all in MLT or use extra m_properties ?. */
void setProperties(QMap <QString, QString> properties, bool refreshPanel = false);
void setProperties(const QMap<QString, QString> &properties, bool refreshPanel = false);
/** @brief Get an XML property from MLT produced xml. */
static QString getXmlProperty(const QDomElement &producer, const QString &propertyName, const QString &defaultValue = QString());
......@@ -213,14 +213,14 @@ public:
const QString getAudioThumbPath(AudioStreamInfo *audioInfo);
/** @brief Returns a cached pixmap for a frame of this clip */
QImage findCachedThumb(int pos);
void slotQueryIntraThumbs(QList <int> frames);
void slotQueryIntraThumbs(const QList<int> &frames);
/** @brief Returns true if this producer has audio and can be splitted on timeline*/
bool isSplittable() const;
public slots:
void updateAudioThumbnail(QVariantList audioLevels);
void updateAudioThumbnail(const QVariantList &audioLevels);
/** @brief Extract image thumbnails for timeline. */
void slotExtractImage(QList <int> frames);
void slotExtractImage(const QList<int> &frames);
void slotCreateAudioThumbs();
/** @brief Set the Job status on a clip.
* @param jobType The job type
......
......@@ -56,7 +56,7 @@ ProjectSubClip::~ProjectSubClip()
// controller is deleted in bincontroller
}
void ProjectSubClip::gotThumb(int pos, QImage img)
void ProjectSubClip::gotThumb(int pos, const QImage &img)
{
if (pos == m_in) {
setThumbnail(img);
......@@ -130,7 +130,7 @@ void ProjectSubClip::setCurrent(bool current, bool notify)
}
}
void ProjectSubClip::setThumbnail(QImage img)
void ProjectSubClip::setThumbnail(const QImage &img)
{
QPixmap thumb = roundedPixmap(QPixmap::fromImage(img));
m_thumbnail = QIcon(thumb);
......
......@@ -71,7 +71,7 @@ public:
void setCurrent(bool current, bool notify = true) Q_DECL_OVERRIDE;
/** @brief Sets thumbnail for this clip. */
void setThumbnail(QImage);
void setThumbnail(const QImage &);
/** @brief Remove reference to this subclip in the master clip, to be done before a subclip is deleted. */
void discard();
......@@ -85,7 +85,7 @@ private:
int m_out;
private slots:
void gotThumb(int pos, QImage img);
void gotThumb(int pos, const QImage &img);
};
#endif
......@@ -58,7 +58,7 @@ const int LUMAPLACEHOLDER = 12;
enum TITLECLIPTYPE { TITLE_IMAGE_ELEMENT = 20, TITLE_FONT_ELEMENT = 21 };
DocumentChecker::DocumentChecker(QUrl url, const QDomDocument &doc):
DocumentChecker::DocumentChecker(const QUrl &url, const QDomDocument &doc):
m_url(url), m_doc(doc), m_dialog(Q_NULLPTR)
{
}
......@@ -482,7 +482,7 @@ DocumentChecker::~DocumentChecker()
}
QString DocumentChecker::getProperty(QDomElement effect, const QString &name)
QString DocumentChecker::getProperty(const QDomElement &effect, const QString &name)
{
QDomNodeList params = effect.elementsByTagName(QStringLiteral("property"));
for (int i = 0; i < params.count(); ++i) {
......@@ -494,7 +494,7 @@ QString DocumentChecker::getProperty(QDomElement effect, const QString &name)
return QString();
}
void DocumentChecker::setProperty(QDomElement effect, const QString &name, const QString &value)
void DocumentChecker::setProperty(const QDomElement &effect, const QString &name, const QString &value)
{
QDomNodeList params = effect.elementsByTagName(QStringLiteral("property"));
for (int i = 0; i < params.count(); ++i) {
......
......@@ -35,7 +35,7 @@ class DocumentChecker: public QObject
Q_OBJECT
public:
explicit DocumentChecker(QUrl url, const QDomDocument &doc);
explicit DocumentChecker(const QUrl &url, const QDomDocument &doc);
~DocumentChecker();
/**
* @brief checks for problems with the clips in the project
......@@ -52,8 +52,8 @@ private slots:
void slotEditItem(QTreeWidgetItem *item, int);
void slotPlaceholders();
void slotDeleteSelected();
QString getProperty(QDomElement effect, const QString &name);
void setProperty(QDomElement effect, const QString &name, const QString &value);
QString getProperty(const QDomElement &effect, const QString &name);
void setProperty(const QDomElement &effect, const QString &name, const QString &value);
QString searchLuma(const QDir &dir, const QString &file) const;
/** @brief Check if images and fonts in this clip exists, returns a list of images that do exist so we don't check twice. */
void checkMissingImagesAndFonts(const QStringList &images, const QStringList &fonts, const QString &id, const QString &baseClip);
......
......@@ -229,7 +229,7 @@ LibraryWidget::LibraryWidget(ProjectManager *manager, QWidget *parent) : QWidget
connect(m_libraryTree, &LibraryTree::itemChanged, this, &LibraryWidget::slotItemEdited, Qt::UniqueConnection);
}
void LibraryWidget::setupActions(QList <QAction *>list)
void LibraryWidget::setupActions(const QList <QAction *> &list)
{
QList <QAction *> menuList;
m_addAction = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-add-clip")), i18n("Add Clip to Project"), this);
......@@ -395,7 +395,7 @@ void LibraryWidget::slotRenameItem()
m_libraryTree->editItem(current);
}
void LibraryWidget::slotMoveData(QList <QUrl> urls, QString dest)
void LibraryWidget::slotMoveData(const QList<QUrl> &urls, QString dest)
{
if (urls.isEmpty()) return;
if (dest .isEmpty()) {
......@@ -417,7 +417,7 @@ void LibraryWidget::slotMoveData(QList <QUrl> urls, QString dest)
}
}
void LibraryWidget::slotSaveSequence(QStringList info, QString dest)
void LibraryWidget::slotSaveSequence(const QStringList &info, QString dest)
{
if (info.isEmpty()) return;
if (dest .isEmpty()) {
......
......@@ -165,7 +165,7 @@ class LibraryWidget : public QWidget
public:
explicit LibraryWidget(ProjectManager *m_manager, QWidget *parent = Q_NULLPTR);
void setupActions(QList <QAction *>list);
void setupActions(const QList<QAction *> &list);
public slots:
void slotAddToLibrary();
......@@ -177,8 +177,8 @@ private slots:
void updateActions();
void slotAddFolder();
void slotRenameItem();
void slotMoveData(QList <QUrl>, QString);
void slotSaveSequence(QStringList info, QString dest);
void slotMoveData(const QList<QUrl> &, QString);
void slotSaveSequence(const QStringList &info, QString dest);
void slotItemEdited(QTreeWidgetItem *item, int column);
void slotDownloadFinished(KJob *);
void slotDownloadProgress(KJob *, unsigned long);
......
......@@ -2433,7 +2433,7 @@ void MainWindow::slotUnselectAllTracks()
pCore->projectManager()->currentTimeline()->projectView()->clearSelection();
}
void MainWindow::slotEditGuide(int pos, QString text)
void MainWindow::slotEditGuide(int pos, const QString &text)
{
if (pCore->projectManager()->currentTimeline())
pCore->projectManager()->currentTimeline()->projectView()->slotEditGuide(pos, text);
......@@ -4000,7 +4000,7 @@ void MainWindow::slotSwitchTrimMode()
}
}
void MainWindow::setTrimMode(const QString mode)
void MainWindow::setTrimMode(const QString &mode)
{
if (pCore->projectManager()->currentTimeline()) {
m_trimLabel->setText(mode);
......
......@@ -362,7 +362,7 @@ private slots:
void slotRemoveSpace();
void slotRemoveAllSpace();
void slotAddGuide();
void slotEditGuide(int pos = -1, QString text = QString());
void slotEditGuide(int pos = -1, const QString &text = QString());
void slotDeleteGuide();
void slotDeleteAllGuides();
void slotGuidesUpdated();
......@@ -475,7 +475,7 @@ private slots:
void slotUpdateCompositeAction(int mode);
/** @brief Cycle through the different timeline trim modes. */
void slotSwitchTrimMode();
void setTrimMode(const QString mode);
void setTrimMode(const QString &mode);
/** @brief Set timeline toolbar icon size. */
void setTimelineToolbarIconSize(QAction *a);
......
......@@ -278,7 +278,7 @@ void ClipController::updateProducer(const QString &id, Mlt::Producer* producer)
}
Mlt::Producer *ClipController::getTrackProducer(const QString trackName, PlaylistState::ClipState clipState, double speed)
Mlt::Producer *ClipController::getTrackProducer(const QString &trackName, PlaylistState::ClipState clipState, double speed)
{
//TODO
Q_UNUSED(speed)
......@@ -735,7 +735,7 @@ EffectsList ClipController::xmlEffectList(Mlt::Profile *profile, Mlt::Service &s
return effList;
}
void ClipController::changeEffectState(const QList <int> indexes, bool disable)
void ClipController::changeEffectState(const QList <int> &indexes, bool disable)
{
Mlt::Service service = m_masterProducer->parent();
for (int i = 0; i < service.filter_count(); ++i) {
......@@ -819,7 +819,7 @@ void ClipController::disableEffects(bool disable)
if (changed) m_binController->updateTrackProducer(clipId());
}
void ClipController::saveZone(QPoint zone, QDir dir)
void ClipController::saveZone(QPoint zone, const QDir &dir)
{
QString path = QString(clipName() + "_" + QString::number(zone.x()) + ".mlt");
if (dir.exists(path)) {
......