Fix more warnings and remove dead code

This commit is contained in:
Nicolas Werner 2021-12-28 22:30:12 +01:00
parent 409ff22d80
commit bb290f9fec
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
50 changed files with 276 additions and 695 deletions

View file

@ -49,9 +49,12 @@ MxcMediaProxy::MxcMediaProxy(QObject *parent)
void
MxcMediaProxy::setVideoSurface(QAbstractVideoSurface *surface)
{
qDebug() << "Changing surface";
m_surface = surface;
setVideoOutput(m_surface);
if (surface != m_surface) {
qDebug() << "Changing surface";
m_surface = surface;
setVideoOutput(m_surface);
emit videoSurfaceChanged();
}
}
QAbstractVideoSurface *
@ -84,9 +87,8 @@ MxcMediaProxy::startDownload()
return;
}
QString mxcUrl = QString::fromStdString(mtx::accessors::url(*event));
QString originalFilename = QString::fromStdString(mtx::accessors::filename(*event));
QString mimeType = QString::fromStdString(mtx::accessors::mimetype(*event));
QString mxcUrl = QString::fromStdString(mtx::accessors::url(*event));
QString mimeType = QString::fromStdString(mtx::accessors::mimetype(*event));
auto encryptionInfo = mtx::accessors::file(*event);
@ -99,10 +101,9 @@ MxcMediaProxy::startDownload()
const auto url = mxcUrl.toStdString();
const auto name = QString(mxcUrl).remove("mxc://");
QFileInfo filename(QString("%1/media_cache/media/%2.%3")
.arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation))
.arg(name)
.arg(suffix));
QFileInfo filename(
QString("%1/media_cache/media/%2.%3")
.arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), name, suffix));
if (QDir::cleanPath(name) != name) {
nhlog::net()->warn("mxcUrl '{}' is not safe, not downloading file", url);
return;