Commit a98c4138 authored by Vincent Pinon's avatar Vincent Pinon

fix clazy warning: detach-temporary

parent 150253fe
......@@ -1849,7 +1849,7 @@ void Bin::setupGeneratorMenu()
void Bin::setupMenu(QMenu *addMenu, QAction *defaultAction, QHash <QString, QAction*> actions)
{
// Setup actions
QAction *first = m_toolbar->actions().first();
QAction *first = m_toolbar->actions().at(0);
m_deleteAction = actions.value(QStringLiteral("delete"));
m_toolbar->insertAction(first, m_deleteAction);
......
......@@ -234,7 +234,7 @@ void ParameterPlotter::mousePressEvent(QMouseEvent * event)
} else {
if (m_newPoints && m_activeIndexPlot >= 0) {
//setup new points
KPlotObject* p = plotObjects()[m_activeIndexPlot];
KPlotObject* p = plotObjects().at(m_activeIndexPlot);
QList<KPlotPoint*> points = p->points();
QList<QPointF> newpoints;
......
......@@ -125,7 +125,7 @@ void KisCurveWidget::inOutChanged(int)
d->m_curve.setPoint(d->m_grab_point_index, pt);
d->m_grab_point_index = d->m_curve.points().indexOf(pt);
} else
pt = d->m_curve.points()[d->m_grab_point_index];
pt = d->m_curve.points().at(d->m_grab_point_index);
d->m_intIn->blockSignals(true);
......@@ -161,14 +161,14 @@ void KisCurveWidget::keyPressEvent(QKeyEvent *e)
if (e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace) {
if (d->m_grab_point_index > 0 && d->m_grab_point_index < d->m_curve.points().count() - 1) {
//x() find closest point to get focus afterwards
double grab_point_x = d->m_curve.points()[d->m_grab_point_index].x();
double grab_point_x = d->m_curve.points().at(d->m_grab_point_index).x();
int left_of_grab_point_index = d->m_grab_point_index - 1;
int right_of_grab_point_index = d->m_grab_point_index + 1;
int new_grab_point_index;
if (fabs(d->m_curve.points()[left_of_grab_point_index].x() - grab_point_x) <
fabs(d->m_curve.points()[right_of_grab_point_index].x() - grab_point_x)) {
if (fabs(d->m_curve.points().at(left_of_grab_point_index).x() - grab_point_x) <
fabs(d->m_curve.points().at(right_of_grab_point_index).x() - grab_point_x)) {
new_grab_point_index = left_of_grab_point_index;
} else {
new_grab_point_index = d->m_grab_point_index;
......@@ -313,10 +313,10 @@ void KisCurveWidget::mousePressEvent(QMouseEvent * e)
d->m_grab_point_index = closest_point_index;
}
d->m_grabOriginalX = d->m_curve.points()[d->m_grab_point_index].x();
d->m_grabOriginalY = d->m_curve.points()[d->m_grab_point_index].y();
d->m_grabOffsetX = d->m_curve.points()[d->m_grab_point_index].x() - x;
d->m_grabOffsetY = d->m_curve.points()[d->m_grab_point_index].y() - y;
d->m_grabOriginalX = d->m_curve.points().at(d->m_grab_point_index).x();
d->m_grabOriginalY = d->m_curve.points().at(d->m_grab_point_index).y();
d->m_grabOffsetX = d->m_curve.points().at(d->m_grab_point_index).x() - x;
d->m_grabOffsetY = d->m_curve.points().at(d->m_grab_point_index).y() - y;
d->m_curve.setPoint(d->m_grab_point_index, QPointF(x + d->m_grabOffsetX, y + d->m_grabOffsetY));
d->m_draggedAwayPointIndex = -1;
......@@ -386,18 +386,18 @@ void KisCurveWidget::mouseMoveEvent(QMouseEvent * e)
leftX = 0.0;
rightX = 0.0;
/*if (d->m_curve.points().count() > 1)
rightX = d->m_curve.points()[d->m_grab_point_index + 1].x() - POINT_AREA;
rightX = d->m_curve.points().at(d->m_grab_point_index + 1).x() - POINT_AREA;
else
rightX = 1.0;*/
} else if (d->m_grab_point_index == d->m_curve.points().count() - 1) {
leftX = d->m_curve.points()[d->m_grab_point_index - 1].x() + POINT_AREA;
leftX = d->m_curve.points().at(d->m_grab_point_index - 1).x() + POINT_AREA;
rightX = 1.0;
} else {
Q_ASSERT(d->m_grab_point_index > 0 && d->m_grab_point_index < d->m_curve.points().count() - 1);
// the 1E-4 addition so we can grab the dot later.
leftX = d->m_curve.points()[d->m_grab_point_index - 1].x() + POINT_AREA;
rightX = d->m_curve.points()[d->m_grab_point_index + 1].x() - POINT_AREA;
leftX = d->m_curve.points().at(d->m_grab_point_index - 1).x() + POINT_AREA;
rightX = d->m_curve.points().at(d->m_grab_point_index + 1).x() - POINT_AREA;
}
x = bounds(x, leftX, rightX);
......@@ -406,7 +406,7 @@ void KisCurveWidget::mouseMoveEvent(QMouseEvent * e)
d->m_curve.setPoint(d->m_grab_point_index, QPointF(x, y));
if (removePoint && d->m_curve.points().count() > 2) {
d->m_draggedAwayPoint = d->m_curve.points()[d->m_grab_point_index];
d->m_draggedAwayPoint = d->m_curve.points().at(d->m_grab_point_index);
d->m_draggedAwayPointIndex = d->m_grab_point_index;
d->m_curve.removePoint(d->m_grab_point_index);
d->m_grab_point_index = bounds(d->m_grab_point_index, 0, d->m_curve.points().count() - 1);
......
......@@ -194,8 +194,8 @@ int KisCurveWidget::Private::nearestPointInRange(QPointF pt, int wWidth, int wHe
}
if (nearestIndex >= 0) {
if (fabs(pt.x() - m_curve.points()[nearestIndex].x()) *(wWidth - 1) < 5 &&
fabs(pt.y() - m_curve.points()[nearestIndex].y()) *(wHeight - 1) < 5) {
if (fabs(pt.x() - m_curve.points().at(nearestIndex).x()) *(wWidth - 1) < 5 &&
fabs(pt.y() - m_curve.points().at(nearestIndex).y()) *(wHeight - 1) < 5) {
return nearestIndex;
}
}
......@@ -243,8 +243,8 @@ void KisCurveWidget::Private::syncIOControls()
m_intIn->blockSignals(true);
m_intOut->blockSignals(true);
m_intIn->setValue(sp2io(m_curve.points()[m_grab_point_index].x()));
m_intOut->setValue(sp2io(m_curve.points()[m_grab_point_index].y()));
m_intIn->setValue(sp2io(m_curve.points().at(m_grab_point_index).x()));
m_intOut->setValue(sp2io(m_curve.points().at(m_grab_point_index).y()));
m_intIn->blockSignals(false);
m_intOut->blockSignals(false);
......
......@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
QString mltPath = parser.value(QStringLiteral("mlt-path"));
QUrl url;
if (parser.positionalArguments().count()) {
url = QUrl::fromLocalFile(parser.positionalArguments().first());
url = QUrl::fromLocalFile(parser.positionalArguments().at(0));
// Make sure we get an absolute URL so that we can autosave correctly
QString currentPath = QDir::currentPath();
QUrl startup = QUrl::fromLocalFile(currentPath.endsWith(QDir::separator()) ? currentPath : currentPath + QDir::separator());
......
......@@ -63,7 +63,7 @@ SplineItem::SplineItem(const QList< BPoint >& points, QGraphicsItem* parent, QGr
setPen(framepen);
setBrush(Qt::NoBrush);
setAcceptHoverEvents(true);
m_view = scene->views().first();
m_view = scene->views().at(0);
initSpline(scene, points);
}
......
......@@ -298,7 +298,7 @@ bool ProjectManager::saveFileAs()
if (fd.selectedFiles().isEmpty()) {
return false;
}
QString outputFile = fd.selectedFiles().first();
QString outputFile = fd.selectedFiles().at(0);
if (QFile::exists(outputFile)) {
// Show the file dialog again if the user does not want to overwrite the file
......
......@@ -670,7 +670,7 @@ void TitleWidget::slotImageTool()
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setNameFilters(mimeTypeFilters);
if (dialog.exec() != QDialog::Accepted) return;
QUrl url = QUrl::fromLocalFile(dialog.selectedFiles().first());
QUrl url = QUrl::fromLocalFile(dialog.selectedFiles().at(0));
if (url.isValid()) {
KRecentDirs::add(QStringLiteral(":KdenliveImageFolder"), url.adjusted(QUrl::RemoveFilename).path());
if (url.path().endsWith(QLatin1String(".svg"))) {
......
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