]> git.sesse.net Git - kdenlive/blobdiff - src/renderwidget.cpp
const'ify
[kdenlive] / src / renderwidget.cpp
index c521e39fc7d5ec22543fea6d741ee13af8654902..d2104d619807ebd76c27319947f17b542c5fc8d3 100644 (file)
@@ -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));
     }
 }
 
@@ -866,7 +865,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
     QListWidgetItem *item = m_view.size_list->currentItem();
     if (!item) return;
 
-    QString dest = m_view.out_file->url().path();
+    QString dest = m_view.out_file->url().path().trimmed();
     if (dest.isEmpty()) return;
 
     // Check whether target file has an extension.
@@ -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() << "------------------------------";