mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix crash after sending image caused by the recent refactor
This commit is contained in:
parent
b847623fbe
commit
203ddb20de
1 changed files with 4 additions and 4 deletions
|
@ -712,7 +712,7 @@ InputBar::showPreview(const QMimeData &source, const QString &path, const QStrin
|
||||||
|
|
||||||
QSize dimensions;
|
QSize dimensions;
|
||||||
QString blurhash;
|
QString blurhash;
|
||||||
auto mimeClass = mime.splitRef(u'/')[0];
|
auto mimeClass = mime.left(mime.indexOf(u'/'));
|
||||||
nhlog::ui()->debug("Mime: {}", mime.toStdString());
|
nhlog::ui()->debug("Mime: {}", mime.toStdString());
|
||||||
if (mimeClass == u"image") {
|
if (mimeClass == u"image") {
|
||||||
QImage img = utils::readImage(data);
|
QImage img = utils::readImage(data);
|
||||||
|
@ -760,11 +760,11 @@ InputBar::showPreview(const QMimeData &source, const QString &path, const QStrin
|
||||||
if (encryptedFile)
|
if (encryptedFile)
|
||||||
encryptedFile->url = res.content_uri;
|
encryptedFile->url = res.content_uri;
|
||||||
|
|
||||||
if (mimeClass == "image")
|
if (mimeClass == u"image")
|
||||||
image(filename, encryptedFile, url, mime, size, dimensions, blurhash);
|
image(filename, encryptedFile, url, mime, size, dimensions, blurhash);
|
||||||
else if (mimeClass == "audio")
|
else if (mimeClass == u"audio")
|
||||||
audio(filename, encryptedFile, url, mime, size);
|
audio(filename, encryptedFile, url, mime, size);
|
||||||
else if (mimeClass == "video")
|
else if (mimeClass == u"video")
|
||||||
video(filename, encryptedFile, url, mime, size);
|
video(filename, encryptedFile, url, mime, size);
|
||||||
else
|
else
|
||||||
file(filename, encryptedFile, url, mime, size);
|
file(filename, encryptedFile, url, mime, size);
|
||||||
|
|
Loading…
Reference in a new issue