Commit 56536237 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Fix compile warnings

parent cf60d92f
Pipeline #8189 passed with stage
in 18 minutes and 14 seconds
......@@ -360,7 +360,6 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
if (offset != 0) {
// this is an endless resize clip
GenTime old_in(oldIn, pCore->getCurrentFps());
Keyframe kf = getKeyframe(old_in, &ok);
GenTime new_in(in + offset, pCore->getCurrentFps());
getKeyframe(new_in, &ok2);
positions = m_parameters.begin()->second->getKeyframePos();
......
......@@ -240,14 +240,14 @@ void AssetParameterView::refresh(const QModelIndex &topLeft, const QModelIndex &
m_widgets[0]->slotRefresh();
return;
}
int max;
size_t max;
if (!bottomRight.isValid()) {
max = (int)m_widgets.size() - 1;
max = m_widgets.size() - 1;
} else {
max = bottomRight.row();
max = (size_t)bottomRight.row();
}
Q_ASSERT(max < (int)m_widgets.size());
for (auto i = (size_t)topLeft.row(); i <= max; ++i) {
Q_ASSERT(max < m_widgets.size());
for (size_t i = (size_t)topLeft.row(); i <= max; ++i) {
m_widgets[i]->slotRefresh();
}
}
......
......@@ -250,7 +250,7 @@ void ColorWheel::mouseReleaseEvent(QMouseEvent *event)
void ColorWheel::resizeEvent(QResizeEvent *event)
{
m_image = QImage(event->size(), QImage::Format_ARGB32_Premultiplied);
m_image.fill(palette().background().color().rgb());
m_image.fill(palette().window().color().rgb());
drawWheel();
drawSlider();
......
......@@ -54,7 +54,7 @@ template <typename Curve_t> void AbstractCurveWidget<Curve_t>::paintBackground(Q
/*
* Background
*/
p->fillRect(rect().translated(-offsetX, -offsetY), palette().background());
p->fillRect(rect().translated(-offsetX, -offsetY), palette().window());
if (!m_pixmap.isNull()) {
if (m_pixmapIsDirty || !m_pixmapCache) {
m_pixmapCache = std::make_shared<QPixmap>(m_wWidth + 1, m_wHeight + 1);
......
......@@ -156,7 +156,7 @@ void CubicBezierSpline::validatePoints()
void CubicBezierSpline::keepSorted()
{
qSort(m_points.begin(), m_points.end(), pointLessThan);
std::sort(m_points.begin(), m_points.end(), pointLessThan);
}
int CubicBezierSpline::indexOf(const BPoint &p)
......
......@@ -278,7 +278,7 @@ void KisCubicCurve::Data::invalidate()
void KisCubicCurve::Data::keepSorted()
{
qSort(points.begin(), points.end(), pointLessThan);
std::sort(points.begin(), points.end(), pointLessThan);
}
qreal KisCubicCurve::Data::value(qreal x)
......
......@@ -301,7 +301,7 @@ template <typename CurveWidget_t> void CurveParamWidget<CurveWidget_t>::slotShow
m_edit->setPixmap(QPixmap());
} else {
auto color = modeToColorsRGB(m_mode);
m_edit->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit->size(), color, 1, palette().background().color().rgb())));
m_edit->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit->size(), color, 1, palette().window().color().rgb())));
}
} else {
m_edit->setPixmap(QPixmap());
......
......@@ -168,7 +168,7 @@ public:
QString line1 = index.data(Qt::DisplayRole).toString();
QString line2 = index.data(Qt::UserRole).toString();
int textW = qMax(option.fontMetrics.width(line1), option.fontMetrics.width(line2));
int textW = qMax(option.fontMetrics.horizontalAdvance(line1), option.fontMetrics.horizontalAdvance(line2));
QSize iconSize = icon.actualSize(option.decorationSize);
return {qMax(textW, iconSize.width()) + 4, option.fontMetrics.lineSpacing() * 2 + 4};
}
......@@ -400,7 +400,6 @@ void MyListView::focusInEvent(QFocusEvent *event)
void MyListView::mouseMoveEvent(QMouseEvent *event)
{
bool dragged = false;
if (event->modifiers() == Qt::ShiftModifier) {
QModelIndex index = indexAt(event->pos());
if (index.isValid()) {
......
......@@ -336,7 +336,7 @@ std::vector<size_t> MarkerListModel::getSnapPoints() const
READ_LOCK();
std::vector<size_t> markers;
for (const auto &marker : m_markerList) {
markers.push_back(marker.first.frames(pCore->getCurrentFps()));
markers.push_back((size_t)marker.first.frames(pCore->getCurrentFps()));
}
return markers;
}
......
......@@ -45,7 +45,7 @@ ProjectSubClip::ProjectSubClip(const QString &id, const std::shared_ptr<ProjectC
m_inPoint = in;
m_outPoint = out;
m_duration = timecode;
m_parentDuration = m_masterClip->frameDuration();
m_parentDuration = (int)m_masterClip->frameDuration();
m_parentClipId = m_masterClip->clipId();
QPixmap pix(64, 36);
pix.fill(Qt::lightGray);
......
......@@ -29,9 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
MediaCapture::MediaCapture(QObject *parent)
: QObject(parent)
, m_volume(1.)
, currentState(-1)
, m_audioDevice("default:")
, m_volume(1.)
, m_path(QUrl())
, m_recordState(0)
{
......
......@@ -129,7 +129,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
// Mime types
QStringList mimes = ClipCreationDialog::getExtensions();
qSort(mimes);
std::sort(mimes.begin(), mimes.end());
m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
m_page2 = addPage(p2, i18n("Environment"));
......@@ -562,6 +562,8 @@ void KdenliveSettingsDialog::setupJogshuttleBtns(const QString &device)
button->setCurrentIndex(action_pos[actions_map[i]]);
}
}
#else
Q_UNUSED(device)
#endif
}
......@@ -757,6 +759,8 @@ void KdenliveSettingsDialog::slotCheckShuttle(int state)
if (state != 0) {
setupJogshuttleBtns(m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString());
}
#else
Q_UNUSED(state)
#endif /* USE_JOGSHUTTLE */
}
......@@ -767,6 +771,8 @@ void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix)
// KdenliveSettings::setShuttledevice(device);
setupJogshuttleBtns(device);
m_configShuttle.kcfg_shuttledevice->setText(device);
#else
Q_UNUSED(ix)
#endif /* USE_JOGSHUTTLE */
}
......@@ -1035,7 +1041,7 @@ void KdenliveSettingsDialog::updateSettings()
// Update list
KdenliveSettings::setAddedExtensions(m_configEnv.kcfg_addedExtensions->text());
QStringList mimes = ClipCreationDialog::getExtensions();
qSort(mimes);
std::sort(mimes.begin(), mimes.end());
m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
}
......
......@@ -26,6 +26,7 @@
#include <QQuickItem>
#include <QQuickWindow>
#include <QStandardPaths>
#include <kdeclarative_version.h>
Splash::Splash(QObject *parent)
: QObject(parent)
......
......@@ -125,7 +125,7 @@ int KThumb::imageVariance(const QImage &image)
{
int delta = 0;
int avg = 0;
int bytes = image.byteCount();
int bytes = (int)image.sizeInBytes();
int STEPS = bytes / 2;
QVarLengthArray<uchar> pivot(STEPS);
const uchar *bits = image.bits();
......
......@@ -95,7 +95,7 @@ void DvdWizardChapters::slotAddChapter()
for (int i = 0; i < currentChaps.count(); ++i) {
chapterTimes.append(currentChaps.at(i).toInt());
}
qSort(chapterTimes);
std::sort(chapterTimes.begin(), chapterTimes.end());
// rebuild chapters
QStringList chaptersString;
......
......@@ -28,6 +28,7 @@
#include <KDeclarative/KDeclarative>
#include <QQmlContext>
#include <QQuickItem>
#include <kdeclarative_version.h>
BuiltStack::BuiltStack(AssetPanel *parent)
: QQuickWidget(parent)
......
......@@ -72,7 +72,7 @@ bool CacheJob::startJob()
qDebug() << "********\nCOULD NOT READ THUMB PRODUCER\n********";
return false;
}
int duration = m_outPoint > 0 ? m_outPoint - m_inPoint : m_binClip->frameDuration();
int duration = m_outPoint > 0 ? m_outPoint - m_inPoint : (int)m_binClip->frameDuration();
if (m_thumbsCount * 5 > duration) {
m_thumbsCount = duration / 10;
}
......@@ -80,7 +80,7 @@ bool CacheJob::startJob()
for (int i = 1; i <= m_thumbsCount; ++i) {
frames.insert(m_inPoint + (duration * i / m_thumbsCount));
}
int size = frames.size();
int size = (int)frames.size();
int count = 0;
connect(this, &CacheJob::jobCanceled, [&] () {
m_clipId.clear();
......@@ -111,6 +111,8 @@ bool CacheJob::startJob()
bool CacheJob::commitResult(Fun &undo, Fun &redo)
{
Q_UNUSED(undo)
Q_UNUSED(redo)
Q_ASSERT(!m_resultConsumed);
m_resultConsumed = true;
return m_done;
......
......@@ -211,7 +211,7 @@ QHash<ProjectClip *, AbstractClipJob *> FilterJob::prepareJob(const QList<Projec
if (clips.count() == 1) {
out = clips.constFirst()->duration().frames(KdenliveSettings::project_fps());
}
QPointer<ClipStabilize> d = new ClipStabilize(sources, filterName, out);
QPointer<ClipStabilize> d = new ClipStabilize(sources, filterName);
if (d->exec() == QDialog::Accepted) {
QMap<QString, QString> producerParams = d->producerParams();
QMap<QString, QString> filterParams = d->filterParams();
......
......@@ -86,7 +86,7 @@ int StabilizeJob::prepareJob(const std::shared_ptr<JobManager> &ptr, const std::
Q_ASSERT(supportedFilters().count(filterName) > 0);
if (filterName == QLatin1String("vidstab")) {
// vidstab
QScopedPointer<ClipStabilize> d(new ClipStabilize(binIds, filterName, 100000));
QScopedPointer<ClipStabilize> d(new ClipStabilize(binIds, filterName));
if (d->exec() == QDialog::Accepted) {
std::unordered_map<QString, QString> filterParams = d->filterParams();
QString destination = d->destination();
......
......@@ -32,7 +32,7 @@ AudioEnvelope::AudioEnvelope(const QString &binId, int clipId, size_t offset, si
m_offset = 0;
m_producer->set_in_and_out((int) offset, (int) (offset + length));
}
m_envelopeSize = m_producer->get_playtime();
m_envelopeSize = (size_t)m_producer->get_playtime();
m_producer->set("set.test_image", 1);
connect(&m_watcher, &QFutureWatcherBase::finished, this, [this] { envelopeReady(this); });
......
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