cleanup: more Coverity silencing

Mostly irrelevant std::move() stuff of copy-on-write Qt objects,
a few real bugs, a timestamp_t downconversion and some codingsyle
adaptation.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-01-16 17:39:19 +01:00 committed by Dirk Hohndel
parent 35ff6eea35
commit 91e4fb4769
27 changed files with 47 additions and 47 deletions

View file

@ -15,6 +15,7 @@
CylindersModel::CylindersModel(bool planner, QObject *parent) : CleanerTableModel(parent),
d(nullptr),
dcNr(-1),
inPlanner(planner),
numRows(0),
tempRow(-1),

View file

@ -281,7 +281,7 @@ void DivePictureModel::updateThumbnail(QString filename, QImage thumbnail, durat
addDurationToThumbnail(thumbnail, duration); // If we know the duration paint it on top of the thumbnail
pictures[i].length = duration;
}
pictures[i].image = thumbnail;
pictures[i].image = std::move(thumbnail);
emit dataChanged(createIndex(i, 0), createIndex(i, 1));
}
}
@ -295,7 +295,7 @@ void DivePictureModel::pictureOffsetChanged(dive *d, const QString filenameIn, o
auto to = std::find_if(from, pictures.end(), [d](const PictureEntry &e) { return e.d != d; });
// Find picture with the given filename
auto oldPos = std::find_if(from, to, [filename](const PictureEntry &e) { return e.filename == filename; });
auto oldPos = std::find_if(from, to, [&filename](const PictureEntry &e) { return e.filename == filename; });
if (oldPos == to)
return;

View file

@ -1312,7 +1312,7 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
disclaimerBegin = disclaimer.left(disclaimerMid);
disclaimerEnd = disclaimer.mid(disclaimerMid + 2);
} else {
disclaimerBegin = disclaimer;
disclaimerBegin = std::move(disclaimer);
}
int disclaimerPositionStart = oldnotes.indexOf(disclaimerBegin);
if (disclaimerPositionStart >= 0) {

View file

@ -1386,7 +1386,7 @@ void DiveTripModelTree::divesSelectedSlot(const QVector<dive *> &divesIn, dive *
QVector<QModelIndex> indices;
indices.reserve(dives.count());
processByTrip(dives, [this, &indices] (dive_trip *trip, const QVector<dive *> &divesInTrip)
processByTrip(std::move(dives), [this, &indices] (dive_trip *trip, const QVector<dive *> &divesInTrip)
{ divesSelectedTrip(trip, divesInTrip, indices); });
emit divesSelected(indices, diveToIdx(currentDive), currentDC);

View file

@ -22,14 +22,12 @@ static QString siteMapDisplayName(const char *sitename)
const char Separator = '/';
QString fullname(sitename);
if (!qPrefDisplay::map_short_names() ) {
if (!qPrefDisplay::map_short_names() )
return fullname;
}
QString name = fullname.section(Separator, -1).trimmed();
if (name.isEmpty()) {
name = fullname;
}
if (name.isEmpty())
name = std::move(fullname);
return name;
}