diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-23 13:19:24 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-23 13:55:53 +0200 |
commit | d5a6a46bc5db9ae2bc924becd148f6e3a5ba1c5c (patch) | |
tree | 9d73d90ae0ac0b937966dea655e5e1a31ec7d447 /src/timeline/InputBar.cpp | |
parent | Explicitly upgrade ca-certs (diff) | |
download | nheko-d5a6a46bc5db9ae2bc924becd148f6e3a5ba1c5c.tar.xz |
Pass context object to properly disconnect when this is deleted
Diffstat (limited to '')
-rw-r--r-- | src/timeline/InputBar.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 47efa867..4ac2708e 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -921,6 +921,7 @@ MediaUpload::MediaUpload(std::unique_ptr<QIODevice> source_, }); connect(mediaPlayer, qOverload<const QString &, const QVariant &>(&QMediaPlayer::metaDataChanged), + this, [this, mediaPlayer](QString t, QVariant) { nhlog::ui()->debug("Got metadata {}", t.toStdString()); @@ -937,14 +938,15 @@ MediaUpload::MediaUpload(std::unique_ptr<QIODevice> source_, } } }); - connect(mediaPlayer, &QMediaPlayer::durationChanged, [this, mediaPlayer](qint64 duration) { - if (duration > 0) { - this->duration_ = mediaPlayer->duration(); - if (mimeClass_ == u"audio") - mediaPlayer->stop(); - } - nhlog::ui()->debug("Duration changed {}", duration); - }); + connect( + mediaPlayer, &QMediaPlayer::durationChanged, this, [this, mediaPlayer](qint64 duration) { + if (duration > 0) { + this->duration_ = mediaPlayer->duration(); + if (mimeClass_ == u"audio") + mediaPlayer->stop(); + } + nhlog::ui()->debug("Duration changed {}", duration); + }); auto originalFile = qobject_cast<QFile *>(source.get()); |