Commit ff2dda64 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify, use isEmpty()

parent 9a2c18e6
...@@ -382,7 +382,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration) ...@@ -382,7 +382,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration)
m_view.guide_start->clear(); m_view.guide_start->clear();
m_view.guide_end->clear(); m_view.guide_end->clear();
QDomNodeList nodes = guidesxml.elementsByTagName("guide"); QDomNodeList nodes = guidesxml.elementsByTagName("guide");
if (nodes.count() > 0) { if (!nodes.isEmpty()) {
m_view.guide_start->addItem(i18n("Beginning"), "0"); m_view.guide_start->addItem(i18n("Beginning"), "0");
m_view.render_guide->setEnabled(true); m_view.render_guide->setEnabled(true);
m_view.create_chapter->setEnabled(true); m_view.create_chapter->setEnabled(true);
...@@ -400,7 +400,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration) ...@@ -400,7 +400,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double duration)
m_view.guide_end->addItem(e.attribute("comment") + '/' + guidePos, e.attribute("time").toDouble()); 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)); m_view.guide_end->addItem(i18n("End"), QString::number(duration));
} }
...@@ -408,7 +408,7 @@ void RenderWidget::setGuides(QDomElement guidesxml, double 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. * Will be called when the user selects an output file via the file dialog.
* File extension will be added automatically. * File extension will be added automatically.
*/ */
void RenderWidget::slotUpdateButtons(KUrl url) void RenderWidget::slotUpdateButtons(const KUrl &url)
{ {
if (m_view.out_file->url().isEmpty()) { if (m_view.out_file->url().isEmpty()) {
m_view.buttonGenerateScript->setEnabled(false); m_view.buttonGenerateScript->setEnabled(false);
...@@ -423,9 +423,8 @@ void RenderWidget::slotUpdateButtons(KUrl url) ...@@ -423,9 +423,8 @@ void RenderWidget::slotUpdateButtons(KUrl url)
m_view.buttonGenerateScript->setEnabled(false); m_view.buttonGenerateScript->setEnabled(false);
return; return;
} }
QString extension = item->data(ExtensionRole).toString(); const QString extension = item->data(ExtensionRole).toString();
url = filenameWithExtension(url, extension); m_view.out_file->setUrl(filenameWithExtension(url, extension));
m_view.out_file->setUrl(url);
} }
} }
......
...@@ -145,7 +145,7 @@ public slots: ...@@ -145,7 +145,7 @@ public slots:
void slotExport(bool scriptExport, int zoneIn, int zoneOut, const QMap <QString, QString> metadata, const QString &playlistPath, const QString &scriptPath, bool exportAudio); void slotExport(bool scriptExport, int zoneIn, int zoneOut, const QMap <QString, QString> metadata, const QString &playlistPath, const QString &scriptPath, bool exportAudio);
private slots: private slots:
void slotUpdateButtons(KUrl url); void slotUpdateButtons(const KUrl &url);
void slotUpdateButtons(); void slotUpdateButtons();
void refreshView(const QString &profile = QString()); void refreshView(const QString &profile = QString());
void refreshCategory(const QString &group = QString(), const QString &profile = QString()); void refreshCategory(const QString &group = QString(), const QString &profile = QString());
......
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