Skip to content

Commit

Permalink
Clean warnings in videowindow.cpp when there is no MPV
Browse files Browse the repository at this point in the history
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.
.
  • Loading branch information
keithvetter committed Aug 14, 2024
1 parent 10a47fa commit 5469bff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libkoviz/videowindow.cpp
Original file line number Diff line number Diff line change
@@ -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<QPair<QString, double> > &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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -252,6 +260,9 @@ void VideoWindow::on_mpv_events()
// Input is a list of "filename,timeoffset" pairs
void VideoWindow::set_videos(const QList<QPair<QString,double> >& videos)
{
#ifndef HAS_MPV
Q_UNUSED(videos)
#endif
#ifdef HAS_MPV
if ( videos.size() != _videos.size() ) {
_resize_videos(videos);
Expand Down Expand Up @@ -309,6 +320,9 @@ void VideoWindow::pause()

void VideoWindow::_resize_videos(const QList<QPair<QString, double> > &videos)
{
#ifndef HAS_MPV
Q_UNUSED(videos)
#endif
#ifdef HAS_MPV
if ( videos.size() > _videos.size() ) { // Add videos
int d = videos.size() - _videos.size();
Expand Down

0 comments on commit 5469bff

Please sign in to comment.