From 5469bfff0aa441bc2ca6049abc1419251abccad4 Mon Sep 17 00:00:00 2001 From: Keith Vetter Date: Wed, 14 Aug 2024 10:35:54 -0500 Subject: [PATCH] Clean warnings in videowindow.cpp when there is no MPV If koviz is built without mpv a lot of the method bodies in videowindow.cpp are #ifdef'ed out so needed some Q_UNUSED(arg) statements etc. . --- libkoviz/videowindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libkoviz/videowindow.cpp b/libkoviz/videowindow.cpp index 400ea7a..b71d394 100644 --- a/libkoviz/videowindow.cpp +++ b/libkoviz/videowindow.cpp @@ -1,16 +1,21 @@ #include "videowindow.h" +#ifdef HAS_MPV static void wakeup(void *ctx) { VideoWindow *mainwindow = (VideoWindow *)ctx; mainwindow->wrap_mpv_events(); } +#endif VideoWindow::VideoWindow(const QList > &videos, QWidget *parent) : QMainWindow(parent), _startTime(0.0) { +#ifndef HAS_MPV + Q_UNUSED(videos) +#endif #ifdef HAS_MPV std::setlocale(LC_NUMERIC, "C"); setFocusPolicy(Qt::StrongFocus); @@ -173,6 +178,9 @@ bool VideoWindow::eventFilter(QObject *obj, QEvent *event) } void VideoWindow::seek_time(double time) { +#ifndef HAS_MPV + Q_UNUSED(time) +#endif #ifdef HAS_MPV int isIdle; int i = 0; @@ -252,6 +260,9 @@ void VideoWindow::on_mpv_events() // Input is a list of "filename,timeoffset" pairs void VideoWindow::set_videos(const QList >& videos) { +#ifndef HAS_MPV + Q_UNUSED(videos) +#endif #ifdef HAS_MPV if ( videos.size() != _videos.size() ) { _resize_videos(videos); @@ -309,6 +320,9 @@ void VideoWindow::pause() void VideoWindow::_resize_videos(const QList > &videos) { +#ifndef HAS_MPV + Q_UNUSED(videos) +#endif #ifdef HAS_MPV if ( videos.size() > _videos.size() ) { // Add videos int d = videos.size() - _videos.size();