Commit b3c9bc59 authored by Vincent Pinon's avatar Vincent Pinon

fix some more clazy warnings

parent e09b06e1
......@@ -1290,36 +1290,21 @@ void KdenliveSettingsDialog::slotReloadShuttleDevices()
devDirStr = QStringLiteral("/dev/input");
}
DeviceMap devMap = JogShuttle::enumerateDevices(devDirStr);
if (!devMap.isEmpty()) {
m_configShuttle.shuttledevicelist->clear();
}
QStringList devNamesList;
QStringList devPathList;
m_configShuttle.shuttledevicelist->clear();
DeviceMap devMap = JogShuttle::enumerateDevices(devDirStr);
DeviceMapIter iter = devMap.begin();
if (iter == devMap.end()) {
KdenliveSettings::shuttledevicenames().clear();
KdenliveSettings::shuttledevicepaths().clear();
m_configShuttle.shuttledevicelist->clear();
}
while (iter != devMap.end()) {
//qDebug() << iter.key() << ": " << iter.value();
m_configShuttle.shuttledevicelist->addItem(iter.key(), iter.value());
devNamesList << iter.key();
devPathList << iter.value();
++iter;
}
KdenliveSettings::setShuttledevicenames(devNamesList);
KdenliveSettings::setShuttledevicepaths(devPathList);
QTimer::singleShot(200, this, SLOT(slotUpdateShuttleDevice()));
//qDebug() << "Devices reloaded";
#endif //USE_JOGSHUTTLE
}
......@@ -1122,7 +1122,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
if (m_view.export_meta->isChecked()) {
QMap<QString, QString>::const_iterator i = metadata.constBegin();
while (i != metadata.constEnd()) {
renderArgs.append(QStringLiteral(" %1=%2").arg(i.key()).arg(QString(QUrl::toPercentEncoding(i.value()))));
renderArgs.append(QStringLiteral(" %1=%2").arg(i.key(), QString(QUrl::toPercentEncoding(i.value()))));
++i;
}
}
......
......@@ -1232,13 +1232,13 @@ const QString EffectStackView2::getStyleSheet()
stylesheet.append(QStringLiteral("QFrame#framegroup {border-top-left-radius:2px;border-top-right-radius:2px;background: palette(dark);} QFrame#framegroup[target=\"true\"] {background: palette(highlight);} "));
// draggable effect bar content
stylesheet.append(QStringLiteral("QProgressBar::chunk:horizontal {background: palette(button);border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %2;}").arg(alt_bg.name()).arg(selected_bg.name()));
stylesheet.append(QStringLiteral("QProgressBar::chunk:horizontal {background: palette(button);border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %2;}").arg(alt_bg.name(), selected_bg.name()));
// draggable effect bar
stylesheet.append(QStringLiteral("QProgressBar:horizontal {border: 1px solid palette(dark);border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%3;padding: 0px;text-align:left center} QProgressBar:horizontal:disabled {border: 1px solid palette(button)} QProgressBar:horizontal#dragOnly {background: %3} QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %1;border-right: 0px;background: %2;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %1;}").arg(hover_bg.name()).arg(light_bg.name()).arg(alt_bg.name()));
stylesheet.append(QStringLiteral("QProgressBar:horizontal {border: 1px solid palette(dark);border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%3;padding: 0px;text-align:left center} QProgressBar:horizontal:disabled {border: 1px solid palette(button)} QProgressBar:horizontal#dragOnly {background: %3} QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %1;border-right: 0px;background: %2;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %1;}").arg(hover_bg.name(), light_bg.name(), alt_bg.name()));
// spin box for draggable widget
stylesheet.append(QStringLiteral("QAbstractSpinBox#dragBox {border: 1px solid palette(dark);border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox:disabled#dragBox {border: 1px solid palette(button);} QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %1;} QAbstractSpinBox:hover#dragBox {border: 1px solid %2;} ").arg(hover_bg.name()).arg(selected_bg.name()));
stylesheet.append(QStringLiteral("QAbstractSpinBox#dragBox {border: 1px solid palette(dark);border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox:disabled#dragBox {border: 1px solid palette(button);} QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %1;} QAbstractSpinBox:hover#dragBox {border: 1px solid %2;} ").arg(hover_bg.name(), selected_bg.name()));
// group editable labels
stylesheet.append(QStringLiteral("MyEditableLabel { background-color: transparent; color: palette(bright-text); border-radius: 2px;border: 1px solid transparent;} MyEditableLabel:hover {border: 1px solid palette(highlight);} "));
......
......@@ -73,9 +73,9 @@ QString CubicBezierSpline::toString() const
QLocale locale;
locale.setNumberOptions(QLocale::OmitGroupSeparator);
foreach(const BPoint &p, m_points) {
spline << QStringLiteral("%1;%2#%3;%4#%5;%6").arg(locale.toString(p.h1.x())).arg(locale.toString(p.h1.y()))
.arg(locale.toString(p.p.x())).arg(locale.toString(p.p.y()))
.arg(locale.toString(p.h2.x())).arg(locale.toString(p.h2.y()));
spline << QStringLiteral("%1;%2#%3;%4#%5;%6").arg(locale.toString(p.h1.x()), locale.toString(p.h1.y()),
locale.toString(p.p.x()), locale.toString(p.p.y()),
locale.toString(p.h2.x()), locale.toString(p.h2.y()));
}
return spline.join(QStringLiteral("|"));
}
......
......@@ -1398,7 +1398,7 @@ void MainWindow::setStatusBarStyleSheet(const QPalette &p)
QColor buttonBord = scheme.foreground(KColorScheme::LinkText).color();
QColor buttonBord2 = scheme.shade(KColorScheme::LightShade);
statusBar()->setStyleSheet(QStringLiteral("QStatusBar QLabel {font-size:%1pt;} QStatusBar::item { border: 0px; font-size:%1pt;padding:0px; }").arg(statusBar()->font().pointSize()));
QString style1 = QStringLiteral("QToolBar { border: 0px } QToolButton { border-style: inset; border:1px solid transparent;border-radius: 3px;margin: 0px 3px;padding: 0px;} QToolButton#timecode {padding-right:10px;} QToolButton:hover { background: %3;border-style: inset; border:1px solid %3;border-radius: 3px;} QToolButton:checked { background-color: %1; border-style: inset; border:1px solid %2;border-radius: 3px;}").arg(buttonBg.name()).arg(buttonBord.name()).arg(buttonBord2.name());
QString style1 = QStringLiteral("QToolBar { border: 0px } QToolButton { border-style: inset; border:1px solid transparent;border-radius: 3px;margin: 0px 3px;padding: 0px;} QToolButton#timecode {padding-right:10px;} QToolButton:hover { background: %3;border-style: inset; border:1px solid %3;border-radius: 3px;} QToolButton:checked { background-color: %1; border-style: inset; border:1px solid %2;border-radius: 3px;}").arg(buttonBg.name(), buttonBord.name(), buttonBord2.name());
statusBar()->setStyleSheet(style1);
}
......
......@@ -61,10 +61,10 @@ void BinController::destroyBin()
delete m_binPlaylist;
m_binPlaylist = NULL;
}
qDeleteAll(m_extraClipList.values());
qDeleteAll(m_extraClipList);
m_extraClipList.clear();
qDeleteAll(m_clipList.values());
qDeleteAll(m_clipList);
m_clipList.clear();
}
......
......@@ -687,8 +687,7 @@ void ClipPropertiesController::fillProperties()
QMimeType mimeType;
mimeType = mimeDatabase.mimeTypeForFile( m_controller->clipUrl().toLocalFile() );
for( KFileMetaData::Extractor* plugin : metaDataCollection.fetchExtractors( mimeType.name() ) )
{
foreach(KFileMetaData::Extractor* plugin, metaDataCollection.fetchExtractors(mimeType.name())) {
ExtractionResult extractionResult(m_controller->clipUrl().toLocalFile(), mimeType.name(), m_propertiesTree);
plugin->extract(&extractionResult);
}
......
......@@ -266,11 +266,12 @@ void RotoWidget::slotRemoveKeyframe(int pos)
QMap<QString, QVariant> map = m_data.toMap();
map.remove(QString::number(pos + m_in).rightJustified(log10((double)m_out) + 1, '0'));
m_data = QVariant(map);
if (m_data.toMap().count() == 1) {
if (map.count() == 1) {
// only one keyframe -> switch from map to list again
m_data = m_data.toMap().begin().value();
m_data = map.begin().value();
} else {
m_data = QVariant(map);
}
slotPositionChanged(m_keyframeWidget->getPosition(), false);
......
......@@ -123,7 +123,6 @@ void SplineItem::setPoints(const QList< BPoint >& points)
}
qDeleteAll(childItems());
childItems().clear();
QPainterPath path(points.at(0).p);
for (int i = 0; i < points.count(); ++i) {
......
......@@ -56,7 +56,7 @@ ClipStabilize::ClipStabilize(const QStringList &urls, const QString &filterName,
"QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %4;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}"
"QAbstractSpinBox#dragBox {border: 1px solid %1;border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;}"
"QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %2;} QAbstractSpinBox:hover#dragBox {border: 1px solid %3;} "
).arg(dark_bg.name()).arg(selected_bg.name()).arg(hover_bg.name()).arg(light_bg.name()));
).arg(dark_bg.name(), selected_bg.name(), hover_bg.name(), light_bg.name()));
setStyleSheet(stylesheet);
if (m_urls.count() == 1) {
......
......@@ -131,7 +131,7 @@ void OAuth2::ForgetAccessToken()
QString OAuth2::loginUrl()
{
QString str = QString("%1?client_id=%2&redirect_uri=%3&response_type=%4").arg(m_strEndPoint).arg(m_strClientID).arg(m_strRedirectURI).arg(m_strResponseType);
QString str = QString("%1?client_id=%2&redirect_uri=%3&response_type=%4").arg(m_strEndPoint, m_strClientID, m_strRedirectURI, m_strResponseType);
// qDebug() << "Login URL" << str;
return str;
}
......
......@@ -444,7 +444,7 @@ int Render::setSceneList(QString playlist, int position)
if (m_mltProducer) {
m_mltProducer->set_speed(0);
qDeleteAll(m_slowmotionProducers.values());
qDeleteAll(m_slowmotionProducers);
m_slowmotionProducers.clear();
delete m_mltProducer;
......
......@@ -845,7 +845,7 @@ void Timeline::updatePalette()
p.setColor(QPalette::Button, norm);
QColor col = scheme.background().color();
QColor col2 = scheme.foreground().color();
headers_container->setStyleSheet(QStringLiteral("QLineEdit { background-color: transparent;color: %1;} QLineEdit:hover{ background-color: %2;} QLineEdit:focus { background-color: %2;}").arg(col2.name()).arg(col.name()));
headers_container->setStyleSheet(QStringLiteral("QLineEdit { background-color: transparent;color: %1;} QLineEdit:hover{ background-color: %2;} QLineEdit:focus { background-color: %2;}").arg(col2.name(), col.name()));
m_trackview->updatePalette();
}
......@@ -1544,7 +1544,7 @@ void Timeline::removeSplitOverlay()
bool Timeline::createOverlay(Mlt::Filter *filter, int tk, int startPos)
{
Track *sourceTrack = track(tk);
if (!sourceTrack) return NULL;
if (!sourceTrack) return false;
m_tractor->lock();
int clipIndex = sourceTrack->playlist().get_clip_index_at(startPos);
Mlt::Producer *clipProducer = sourceTrack->playlist().get_clip(clipIndex);
......
......@@ -256,7 +256,7 @@ void ArchiveOrg::slotParseResults(KJob* job)
if (format!=QLatin1String("Animated GIF") && format!=QLatin1String("Metadata") && format!=QLatin1String("Archive BitTorrent") && format!=QLatin1String("Thumbnail") && format!=QLatin1String("JSON") && format!=QLatin1String("JPEG") && format!=QLatin1String("JPEG Thumb") && format!=QLatin1String("PNG")&& format!=QLatin1String("Video Index") )
{// the a href url has the tag _import added at the end. This tag is removed by ResourceWidget::slotOpenLink before being used to download the file
html += "<tr><td>" + format + " (" + fileSize + "kb " + minsLong + "min) " + QStringLiteral("</td><td><a href=\"%1\">%2</a></td></tr>").arg(sDownloadUrl + "_import").arg(i18n("Import"));
html += "<tr><td>" + format + " (" + fileSize + "kb " + minsLong + "min) " + QStringLiteral("</td><td><a href=\"%1\">%2</a></td></tr>").arg(sDownloadUrl + "_import", i18n("Import"));
}
//if (format==QLatin1String("Animated GIF"))// widget does not run through the frames of the animated gif
if (format==QLatin1String("Thumbnail") && !bThumbNailFound)
......
......@@ -207,7 +207,7 @@ void ResourceWidget::slotUpdateCurrentSound()
// the info for the current item.
// updateLayout() adds m_image,m_desc and m_meta to the title to make up the html that displays on the widget
if (!m_currentInfo.infoUrl.isEmpty())
title += QStringLiteral(" (<a href=\"%1\">%2</a>)").arg(m_currentInfo.infoUrl).arg(i18nc("the url link pointing to a web page", "link"));
title += QStringLiteral(" (<a href=\"%1\">%2</a>)").arg(m_currentInfo.infoUrl, i18nc("the url link pointing to a web page", "link"));
title.append("</h3>");
if (!m_currentInfo.authorUrl.isEmpty()) {
......
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