]> git.sesse.net Git - kdenlive/commitdiff
Const'ify, use isEmpty()
authorMontel Laurent <montel@kde.org>
Sun, 12 May 2013 06:36:50 +0000 (08:36 +0200)
committerMontel Laurent <montel@kde.org>
Sun, 12 May 2013 06:36:50 +0000 (08:36 +0200)
src/renderwidget.cpp
src/renderwidget.h

index ab8183e91eeefa1ad9d413f0d176115687cf4545..60ee904b2ccf40ee6615c8558aaf09205902d016 100644 (file)
@@ -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));
     }
 }
 
index c604aa8ae8121a1c63878cc20daddfa4c7bede75..f0dd03e6fc2a0c11b624a4a3e1ecd0b5465d2e7f 100644 (file)
@@ -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);
 
 private slots:
-    void slotUpdateButtons(KUrl url);
+    void slotUpdateButtons(const KUrl &url);
     void slotUpdateButtons();
     void refreshView(const QString &profile = QString());
     void refreshCategory(const QString &group = QString(), const QString &profile = QString());