}
-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),
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()));
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()));
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);
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));
}
* 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);
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));
}
}
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.
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());
}
}
-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);
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();
refreshCategory(group, profile);
}
-void RenderWidget::parseFile(QString exportFile, bool editable)
+void RenderWidget::parseFile(const QString &exportFile, bool editable)
{
kDebug() << "// Parsing file: " << exportFile;
kDebug() << "------------------------------";
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();