Commit ef46d1c5 authored by Laurent Montel's avatar Laurent Montel 😁

Use const'ref

parent 4bce0432
......@@ -948,7 +948,7 @@ QString KdenliveDoc::searchFileRecursively(const QDir &dir, const QString &match
return foundFileName;
}
void KdenliveDoc::deleteClip(const QString &clipId, ClipType type, const QString url)
void KdenliveDoc::deleteClip(const QString &clipId, ClipType type, const QString &url)
{
pCore->binController()->removeBinClip(clipId);
// Remove from file watch
......@@ -1570,7 +1570,7 @@ void KdenliveDoc::getFileProperties(const QDomElement &xml, const QString &clipI
pCore->producerQueue()->getFileProperties(xml, clipId, imageHeight, replaceProducer);
}
void KdenliveDoc::doAddAction(const QString &name, QAction *a, QKeySequence shortcut)
void KdenliveDoc::doAddAction(const QString &name, QAction *a, const QKeySequence &shortcut)
{
pCore->window()->actionCollection()->addAction(name, a);
a->setShortcut(shortcut);
......@@ -1587,7 +1587,7 @@ void KdenliveDoc::previewProgress(int p)
pCore->window()->setPreviewProgress(p);
}
void KdenliveDoc::displayMessage(const QString text, MessageType type, int timeOut)
void KdenliveDoc::displayMessage(const QString &text, MessageType type, int timeOut)
{
pCore->window()->displayMessage(text, type, timeOut);
}
......@@ -1620,7 +1620,7 @@ void KdenliveDoc::selectPreviewProfile()
continue;
}
bool rateFound = false;
foreach(const QString arg, data) {
foreach(const QString &arg, data) {
if (arg.startsWith(QStringLiteral("r="))) {
rateFound = true;
double fps = arg.section(QStringLiteral("="), 1).toDouble();
......
......@@ -90,7 +90,7 @@ public:
ClipManager *clipManager();
QString groupsXml() const;
void deleteClip(const QString &clipId, ClipType type, const QString url);
void deleteClip(const QString &clipId, ClipType type, const QString &url);
int getFramePos(const QString &duration);
/** @brief Get a bin's clip from its id. */
ProjectClip *getBinClip(const QString &clipId);
......@@ -161,12 +161,12 @@ public:
/** @brief Get an action from main actioncollection. */
QAction *getAction(const QString &name);
/** @brief Add an action to main actioncollection. */
void doAddAction(const QString &name, QAction *a, QKeySequence shortcut);
void doAddAction(const QString &name, QAction *a, const QKeySequence &shortcut);
void invalidatePreviews(QList <int> chunks);
void previewProgress(int p);
/** @brief Select most appropriate rendering profile for timeline preview based on fps / size. */
void selectPreviewProfile();
void displayMessage(const QString text, MessageType type = DefaultMessage, int timeOut = 0);
void displayMessage(const QString &text, MessageType type = DefaultMessage, int timeOut = 0);
/** @brief Get a cache directory for this project. */
QDir getCacheDir(CacheType type, bool *ok) const;
/** @brief Create standard cache dirs for the project */
......
......@@ -251,7 +251,7 @@ void ClipManager::slotAddCopiedClip(KIO::Job*, const QUrl&, const QUrl &dst)
}
void ClipManager::slotAddTextTemplateClip(QString titleName, const QUrl &path, const QString &group, const QString &groupId)
void ClipManager::slotAddTextTemplateClip(const QString &titleName, const QUrl &path, const QString &group, const QString &groupId)
{
QDomDocument doc;
QDomElement prod = doc.createElement(QStringLiteral("producer"));
......
......@@ -70,7 +70,7 @@ Q_OBJECT public:
explicit ClipManager(KdenliveDoc *doc);
virtual ~ ClipManager();
void slotAddTextTemplateClip(QString titleName, const QUrl &path, const QString &group, const QString &groupId);
void slotAddTextTemplateClip(const QString &titleName, const QUrl &path, const QString &group, const QString &groupId);
void doDeleteClips(QStringList clipIds, QStringList folderIds, QStringList subClipIds, QUndoCommand *deleteCommand, bool execute);
int lastClipId() const;
/** @brief Prepare deletion of clips and folders from the Bin. */
......
......@@ -587,7 +587,7 @@ void TemporaryData::deleteSelected()
return;
}
const QString currentId = m_doc->getDocumentProperty(QStringLiteral("documentid"));
foreach(const QString folder, folders) {
foreach(const QString &folder, folders) {
if (folder == currentId) {
// Trying to delete current project's tmp folder. Do not delete, but clear it
deleteCurrentCacheData();
......
......@@ -317,7 +317,7 @@ QHash <ProjectClip *, AbstractClipJob *> CutClipJob::prepareCutClipJob(double fp
}
// static
QHash <ProjectClip *, AbstractClipJob *> CutClipJob::prepareTranscodeJob(double fps, QList <ProjectClip*> clips, QStringList parameters)
QHash <ProjectClip *, AbstractClipJob *> CutClipJob::prepareTranscodeJob(double fps, const QList <ProjectClip*> &clips, const QStringList &parameters)
{
QHash <ProjectClip *, AbstractClipJob *> jobs;
QString params = parameters.at(0);
......@@ -390,7 +390,7 @@ QHash <ProjectClip *, AbstractClipJob *> CutClipJob::prepareTranscodeJob(double
}
// static
QHash <ProjectClip *, AbstractClipJob *> CutClipJob::prepareAnalyseJob(double fps, QList <ProjectClip*> clips, QStringList parameters)
QHash <ProjectClip *, AbstractClipJob *> CutClipJob::prepareAnalyseJob(double fps, const QList <ProjectClip*> &clips, const QStringList &parameters)
{
// Might be useful some day
Q_UNUSED(parameters);
......
......@@ -51,9 +51,9 @@ public:
stringMap cancelProperties();
const QString statusMessage();
bool isExclusive();
static QHash <ProjectClip *, AbstractClipJob *> prepareTranscodeJob(double fps, QList <ProjectClip *> ids, QStringList parameters);
static QHash <ProjectClip *, AbstractClipJob *> prepareTranscodeJob(double fps, const QList<ProjectClip *> &ids, const QStringList &parameters);
static QHash <ProjectClip *, AbstractClipJob *> prepareCutClipJob(double fps, double originalFps, ProjectClip *clip);
static QHash <ProjectClip *, AbstractClipJob *> prepareAnalyseJob(double fps, QList <ProjectClip*> clips, QStringList parameters);
static QHash <ProjectClip *, AbstractClipJob *> prepareAnalyseJob(double fps, const QList <ProjectClip*> &clips, const QStringList &parameters);
static QList <ProjectClip *> filterClips(QList <ProjectClip *>clips, const QStringList &params);
private:
......
......@@ -35,7 +35,7 @@ static void consumer_frame_render(mlt_consumer, MeltJob * self, mlt_frame frame_
self->emitFrameNumber((int) frame.get_position());
}
MeltJob::MeltJob(ClipType cType, const QString id, const QMap <QString, QString> producerParams, const QMap <QString, QString> filterParams, const QMap <QString, QString> consumerParams, const QMap <QString, QString>extraParams)
MeltJob::MeltJob(ClipType cType, const QString &id, const QMap <QString, QString> &producerParams, const QMap <QString, QString> &filterParams, const QMap <QString, QString> &consumerParams, const QMap <QString, QString> &extraParams)
: AbstractClipJob(MLTJOB, cType, id),
addClipToProject(0),
m_consumer(NULL),
......
......@@ -54,7 +54,7 @@ public:
* @param consumerParams the parameters passed to the Mlt::Consumer. The "consumer" value should hold the consumer's initialization string.
@param extraParams these parameters can be used to further affect the Job handling.
*/
MeltJob(ClipType cType, const QString id, const QMap <QString, QString> producerParams, const QMap <QString, QString> filterParams, const QMap <QString, QString> consumerParams, const stringMap extraParams = stringMap());
MeltJob(ClipType cType, const QString &id, const QMap <QString, QString> &producerParams, const QMap <QString, QString> &filterParams, const QMap <QString, QString> &consumerParams, const stringMap &extraParams = stringMap());
virtual ~ MeltJob();
/** @brief Returns the file path that will be written by this Mlt job. Empty when no file is written. */
const QString destination() const;
......
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