]> git.sesse.net Git - kdenlive/blobdiff - src/renderwidget.cpp
const'ref.
[kdenlive] / src / renderwidget.cpp
index c350e747e25ef61b7ec82211bcf41a564d8de7bd..9bba7f58d9a8196be432b8de52245a4484cb4ef1 100644 (file)
@@ -134,7 +134,7 @@ const QString RenderJobItem::metadata() const
 }
 
 
-RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, MltVideoProfile profile, QWidget * parent) :
+RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, const MltVideoProfile &profile, QWidget * parent) :
         QDialog(parent),
         m_projectFolder(projectfolder),
         m_profile(profile),
@@ -236,7 +236,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, MltVi
     connect(m_view.delete_script, SIGNAL(clicked()), this, SLOT(slotDeleteScript()));
     connect(m_view.scripts_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckScript()));
     connect(m_view.running_jobs, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckJob()));
-    connect(m_view.running_jobs, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotPlayRendering(QTreeWidgetItem *, int)));
+    connect(m_view.running_jobs, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(slotPlayRendering(QTreeWidgetItem*,int)));
 
     connect(m_view.buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel()));
 
@@ -255,13 +255,13 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, MltVi
     connect(m_view.buttonClose3, SIGNAL(clicked()), this, SLOT(hide()));
     connect(m_view.rescale, SIGNAL(toggled(bool)), this, SLOT(setRescaleEnabled(bool)));
     connect(m_view.destination_list, SIGNAL(activated(int)), this, SLOT(refreshCategory()));
-    connect(m_view.out_file, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateButtons()));
-    connect(m_view.out_file, SIGNAL(urlSelected(const KUrl &)), this, SLOT(slotUpdateButtons(const KUrl &)));
+    connect(m_view.out_file, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateButtons()));
+    connect(m_view.out_file, SIGNAL(urlSelected(KUrl)), this, SLOT(slotUpdateButtons(KUrl)));
     connect(m_view.format_list, SIGNAL(currentRowChanged(int)), this, SLOT(refreshView()));
     connect(m_view.size_list, SIGNAL(currentRowChanged(int)), this, SLOT(refreshParams()));
     connect(m_view.show_all_profiles, SIGNAL(stateChanged(int)), this, SLOT(refreshView()));
 
-    connect(m_view.size_list, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(slotEditItem(QListWidgetItem *)));
+    connect(m_view.size_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(slotEditItem(QListWidgetItem*)));
 
     connect(m_view.render_guide, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
     connect(m_view.render_zone, SIGNAL(clicked(bool)), this, SLOT(slotUpdateGuideBox()));
@@ -382,7 +382,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration)
     m_view.guide_start->clear();
     m_view.guide_end->clear();
     QDomNodeList nodes = guidesxml.elementsByTagName("guide");
-    if (nodes.count() > 0) {
+    if (!nodes.isEmpty()) {
         m_view.guide_start->addItem(i18n("Beginning"), "0");
         m_view.render_guide->setEnabled(true);
         m_view.create_chapter->setEnabled(true);
@@ -400,7 +400,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration)
             m_view.guide_end->addItem(e.attribute("comment") + '/' + guidePos, e.attribute("time").toDouble());
         }
     }
-    if (nodes.count() > 0)
+    if (!nodes.isEmpty())
         m_view.guide_end->addItem(i18n("End"), QString::number(duration));
 }
 
@@ -408,7 +408,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration)
  * Will be called when the user selects an output file via the file dialog.
  * File extension will be added automatically.
  */
-void RenderWidget::slotUpdateButtons(KUrl url)
+void RenderWidget::slotUpdateButtons(const KUrl &url)
 {
     if (m_view.out_file->url().isEmpty()) {
         m_view.buttonGenerateScript->setEnabled(false);
@@ -423,9 +423,8 @@ void RenderWidget::slotUpdateButtons(KUrl url)
             m_view.buttonGenerateScript->setEnabled(false);
             return;
         }
-        QString extension = item->data(ExtensionRole).toString();
-        url = filenameWithExtension(url, extension);
-        m_view.out_file->setUrl(url);
+        const QString extension = item->data(ExtensionRole).toString();
+        m_view.out_file->setUrl(filenameWithExtension(url, extension));
     }
 }
 
@@ -1184,7 +1183,7 @@ int RenderWidget::waitingJobsCount() const
     return count;
 }
 
-void RenderWidget::setProfile(MltVideoProfile profile)
+void RenderWidget::setProfile(const MltVideoProfile &profile)
 {
     m_view.scanning_list->setCurrentIndex(0);
     m_view.rescale_width->setValue(KdenliveSettings::defaultrescalewidth());
@@ -1392,7 +1391,7 @@ void RenderWidget::refreshView(const QString &profile)
     }
 }
 
-KUrl RenderWidget::filenameWithExtension(KUrl url, QString extension)
+KUrl RenderWidget::filenameWithExtension(KUrl url, const QString &extension)
 {
     if (url.isEmpty()) url = KUrl(m_projectFolder);
     QString directory = url.directory(KUrl::AppendTrailingSlash | KUrl::ObeyTrailingSlash);
@@ -1507,7 +1506,7 @@ void RenderWidget::reloadProfiles()
     parseProfiles();
 }
 
-void RenderWidget::parseProfiles(QString meta, QString group, QString profile)
+void RenderWidget::parseProfiles(const QString &meta, const QString &group, const QString &profile)
 {
     m_view.destination_list->blockSignals(true);
     m_view.destination_list->clear();
@@ -1547,7 +1546,7 @@ void RenderWidget::parseProfiles(QString meta, QString group, QString profile)
     refreshCategory(group, profile);
 }
 
-void RenderWidget::parseFile(QString exportFile, bool editable)
+void RenderWidget::parseFile(const QString &exportFile, bool editable)
 {
     kDebug() << "// Parsing file: " << exportFile;
     kDebug() << "------------------------------";
@@ -2020,7 +2019,7 @@ void RenderWidget::slotHideLog()
     m_view.error_box->setVisible(false);
 }
 
-void RenderWidget::setRenderProfile(QMap <QString, QString> props)
+void RenderWidget::setRenderProfile(const QMap<QString, QString> &props)
 {
     m_view.scanning_list->setCurrentIndex(props.value("renderscanning").toInt());
     int exportAudio = props.value("renderexportaudio").toInt();